Blade Server CDROM/Network Cloning (http://bsnc.sourceforge.net)
1. Make sure your DHCP/DD Image server server is running properly at Blade server ethernet 1 network segment.
2. Make sure your DHCP/DD Image server IP address is 192.168.10.1.
3. Make sure your DD Image file path is /data/diskimage/blade.ddimg on DHCP/DD Image server.
4. Make sure /tftpboot directory and subdirectories on TFTP server is owned by user nobody
and group nobody, otherwise, blade serer will get 'permission denied' when it boots from network.
5. For your information, the BSNC CDROM will execute the following script to clone back blade DD image.
=====================
dhcpcd eth1
IPADDR=`ifconfig eth1 | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'`
echo "Eth1 got IP address through DHCP server"
echo "Ejecting CDROM before cloning"
eject /dev/sr0
echo "Starting to clone..."
echo "Running command rsh 192.168.10.1 'dd if=/data/diskimage/blade.ddimg | gzip -dc | dd of=/dev/hda"
rsh 192.168.10.1 'dd if=/data/diskimage/blade.ddimg' | gzip -dc | dd of=/dev/hda
echo "Syncing data before rebooting"
sync;sync;sync;
echo "Rebooting system..."
sleep 3
reboot
=======================
6. How to change this script then make another CDROM for your environment.
# mount /mnt/cdrom (mounting cdrom to /mnt/cdrom under Linux)
# mkdir /root/bsnc.cdrom
# cp /mnt/cdrom/* /root/bsnc.cdrom/ -a
# cd /root/bsnc.cdrom/isolinux
# gzip -d rescue.gz
# mkdir rescue.dir
# mount rescue rescue.dir -o loop
# vi rescue.dir/etc/rc (making necessary changes as you need)
# umount rescue.dir
# rm -fr rescue.dir
# gzip rescue
# cd /root/bsnc.cdrom
# ./bsnciso.sh bsnc (will generate bsnc.iso under /root directory)
Then, you can use the following command to burn it into CDR:
# cdrecord -v speed=10 dev=1,0,0 -eject -data /root/bsnc.iso