Archive

Archive for the ‘Red Hat’ Category

Create Red Hat Enterprise Linux Kickstart CD ISO

January 15, 2011 Leave a comment
I had a requirement to create a kickstart CD, so I thought I’d post the basics:
[root@localhost ~]# cd /tmp
[root@localhost tmp]# mkdir bootiso
[root@localhost tmp]# mkdir bootisoks
[root@localhost tmp]# cd /media/CentOS_5.5_Final/images
[root@localhost images]# mount -o loop boot.iso /tmp/bootiso
[root@localhost images]# cp -r /tmp/bootiso/* /tmp/bootisoks
[root@localhost images]# cd /tmp/bootisoks
Kickstart file (ks.cfg) created by me & copied to /tmp/bootisoks/isolinux.
install
cdrom
key --skip
# Localisation
lang en_GB.UTF-8
keyboard uk
timezone --utc Europe/London
# Display
xconfig --startxonboot --resolution 800x600
# Network
network --device eth0 --bootproto dhcp
# Security
rootpw --iscrypted <GetYourOwnDamnedHash!>
firewall --enabled --port=22:tcp
authconfig --useshadow --enablemd5
selinux --enforcing
# System
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
#clearpart --all --initlabel
#part /boot --fstype ext3 --size=50
#part / --fstype ext3 --size=3000 --grow --maxsize=4000
#part swap --size=1024 --grow --maxsize=2048
#part /home --fstype ext3 --size=1000 --grow
%packages
@X Window System
@GNOME Desktop Environment
@Graphical Internet
@Development Tools
python
Creating the ISO:
[root@localhost bootisoks]# mkisofs -o bootks.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/
INFO:   UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs 2.01 (cpu-pc-linux-gnu)
Scanning isolinux/
Excluded by match: isolinux/boot.cat
Excluded: isolinux/TRANS.TBL
Writing:   Initial Padblock                        Start Block 0
Done with: Initial Padblock                        Block(s)    16
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Eltorito Volume Descriptor              Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor              Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 18
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 19
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 20
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 21
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 25
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 29
Done with: Directory tree                          Block(s)    1
Writing:   Joliet directory tree                   Start Block 30
Done with: Joliet directory tree                   Block(s)    1
Writing:   Directory tree cleanup                  Start Block 31
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 31
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 32
Total translation table size: 4925
Total rockridge attributes bytes: 1307
Total directory bytes: 0
Path table size(bytes): 10
Done with: The File(s)                             Block(s)    4674
Writing:   Ending Padblock                         Start Block 4706
Done with: Ending Padblock                         Block(s)    150
Max brk space used 0
4856 extents written (9 MB)
Advertisements
Categories: BASH, Linux, Red Hat, RHCE, RHCT

Tips: Handy Linux Commands

January 15, 2011 1 comment

This is by no means an exhaustive list, merely commands that I use on a daily basis that will be updated periodically as I can be bothered.

Use root complete with variables & script access:

sudo -

Renew DHCP lease:

dhclient -r

Restart networking:

 /etc/init.d/network restart

Check CPU usage/processes:

top

Find commands:

apropos <command-or-pattern>
man -k <command-or-pattern>

Find files & directories:

locate <pattern>

Display PCI devices:

lspci

Display USB devices:

lsusb

Display storage devices:

fdisk -l

Check for new hardware (Happens at boot time automatically):

kudzu --probe

Check for new hardware & test kudzu (requires rhpxl package):

ddcprobe

Gather information from the BIOS:

dmidecode
biosdecode
ownership #(Compaq specific)
vpddecode #(IBM specific)

List drivers/kernel modules:

lsmod

Manually load a module and its dependencies:

modprobe <modulename>

Display information about a specific module or modules:

modinfo <packagename>

Launch the HAL device manager to examine all devices HAL knows about:

hal-device-manager
Categories: BASH, Linux, Red Hat, RHCE, RHCT, Tips