Modifying SystemRescueCD for a Custom Task
Recently I had the need to build a custom boot CD that could perform a task that we needed to accomplish. It needed to be sent out over the network and it couldn’t use the OS of the computer. The original disk that we had was dated and didn’t work on some of our newer computers. So I set out on a task of rebuilding this Linux based LiveCD to make our lives easier. You will need some Linux CLI skills to make this work for you, just because there not a GUI for this process.
Well the original was build on SystemRescueCD, but I didn’t have any real experience with this LiveCD. To make a long story short, the disk is very user friendly and can be modified very easily. The download ISO is already a very nice set of tools to have in a System Administrators bag of goodies. Here is the discription of the disk for thier website.
Description: SystemRescueCd is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the hard disk partitions. It comes with a lot of linux software such as systemtools (parted, partimage, fstools, … ) and basic tools (editors, midnight commander, network tools). It requires no installation. It can be used on linux servers, linux desktops or windows boxes. The kernel supports the important file systems (ext2/ext3/ext4, reiserfs, reiser4, btrfs, xfs, jfs, vfat, ntfs, iso9660), as well as network filesystems (samba and nfs).
Here are a few screen shots of the interface, I left out the CLI because we all know what that looks like:
Now that we know what it is and what it looks like lets talk about customizing it. The process it pretty simple. What I did was create a small partition on my laptop that was 2 Gigs. SystemRescueCD recommends that it is 850 Megs. Anyhow once that was completed I booted into SystemRescueCD and used Gparted to format the partition using ext3 file system. We know have a place to write the files so we can work on them. Lets note that I used this version: SystemRescueCd-x86-2.4.0
Still being booted into SystemRescueCD, I mounted the partition for use by Linux. I only had 3 partitions and one hard drive. Do the partition I mounted was sda3. There is already a directory setup for you to map the partition to and to make all of this work as planned you have to map to this directory. Use th following command:
mount /dev/sda3 /mnt/custom
Remember the hard drive designation may be different for you machine. With access to the partition you go and run this command to write the OS files to the partition.
Now we have our files and we can begin modifying them. I started by copying over the Linux program files that we already used for our task. These files for use are complied Linux CLI applications. Once that was complete I created a few scripts to make things easier to access and automate some tasks. You can add some Linux packages to the liveCD as well. I didn’t do this but it is cover HERE. This document also covers everything I am talking about here.
Once I got everything put into the LiveCD files I ran the following commands:\
This creates the sysdat.dat file that is the LiveCD files in a compressed format. Then I created the ISO to burn using:
/usr/sbin/sysresccd-custom isogen my_srcd
This creates the ISO file in the hard drive partition that can be burned to a disk using the CD burning application that is part of the LiveCd or by running the following command.
The ISO will have the date and time on the end of the file name.
We use this primarily because it has a DHCP and TFTP server. We use this to PXE boot the remote machines so we can perform the tasks and move on to the next one without having to wait for the disk to load or having multiple disks. The PXE server loads the image I created in about 30 seconds where as loading from a disk takes more than 2 minutes. Plus at the time we had 218 machines to perform the tasks on and they were scattered through 7 different buildings. This really worked well.
My point is that this LiveCd can do several things from disk partitioning, booting PXE images, and more. Plus you can modify it to fit your needs as an Systems Administrator. You should go and check this out at: http://www.sysresccd.org/Main_Page . It may not fit your needs now but in the future it can be a valuable tool in to kit. Check it out.