Friday, July 18, 2008

Creating Partimages of Host Machines (Very Customized For My Environment)


- Boot up the Knoppix CDROM into textual mode in RAM
knoppix 2 toram

- Eject the CDROM for possible use in another host

- Setup basic networking.

- Setup Ethernet interface:
ifconfig eth0 <ip> netmask <nm> up
- Setup default gateway (this can be skipped if files on same subnet):
route add default gw <ip_address>

- Setup correct date / time info. This information will be assumed to be correct by the partimage backup script.

export TZ=CDT
date 07181314 (MMDDhhmm)

- Assign "normal" root password

- Start up SSH server

/etc/init.d/ssh start

- SCREEN a new BASH session

chmod 755 /var/run/screen
screen bash

- Make a working directory and cd there:

mkdir /tmp/partimage
cd /tmp/partimage

- Scp the "partimage-backup.pl" script and the <hostname>-source-me.txt file.

- Source the <hostname>-source-me.txt file in.

- Use perl to execute the "partimage-backup.pl" script.

Wednesday, July 16, 2008

Creating a RHEL 5.2 KickStart Bootdisk (x86_64)


1 - Download Binary Disc 1 ISO (rhel-5.2-server-x86_64-disc1.iso)
2 - Mount ISO (step 1) via loopback on a Linux box
3 - Copy the boot.iso file somewhere else (/var/tmp for example)
4 - Umount the ISO from step 2
5 - Mount the boot.iso file (step 3) via loopback
6 - Copy that structure somewhere else, for example, /var/tmp/myiso
7 - Umount the ISO from step 5
8 - Following my example path, alter the /var/tmp/myiso/isolinux/isolinux.cfg file. Add in any necessary boot labels to address all of the KickStart scenarios you need. A simple boot stanza might look like this:

label scenario_04
kernel vmlinuz
append ks=nfs:<ip_address>:/kickstartstuff/RH5.1_server_x86_64/scenario_04.cfg initrd=initrd.img

9 - Use the mkisofs(8) command to make a new ISO. My little script looked like this:

#!/bin/bash
cd /var/tmp/myiso
rm -f ../mycustomks.iso
/usr/bin/mkisofs -r -N -allow-leading-dots -d -J -T -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -V "RHEL5U1 Custom KickStart" -boot-load-size 4 -boot-info-table -o ../mycustomks.iso .

10 - Burn/boot/test the ISO created in step 9

NOTE: The mkisofs command line was acquired from here.