From stock@sba.nl Tue Nov 27 02:51:41 2001 +0100 Date: Tue, 27 Nov 2001 02:51:41 +0100 (CET) From: "Robert M. Stockmann" To: Matthew Hyne Subject: Re: Using Crash Recovery CDROM In-Reply-To: <4.3.2.7.2.20011126162552.01dc3958@ringer.cisco.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: RO X-Status: X-Keywords: On Mon, 26 Nov 2001, Matthew Hyne wrote: > Date: Mon, 26 Nov 2001 16:49:53 +1100 > From: Matthew Hyne > To: stock@sba.nl > Subject: Using Crash Recovery CDROM > > Hi, > > I am trying to use your Crash Recovery CDROM to create a turn-key bare-metal > recovery CD for our linux box. I need to take your original CDROM and > include some more binaries and scripts including adding some modules into > the kernel so our RAID controller is initialised. I also want to make it > start a script automatically after the kernel is booted (eg, an init script). > > Do you have any more information on the steps to create your own recovery > disk like CRK ? > > I understand that you used a hard disk partition - which is included in > the diskfiles245.tar.gz. > How did you then turn this into a diskimage.bin file ? Also, since the > diskfiles245.tar.gz only contains the kernel and other boot stuff - how > did you get the binaries and modules onto the CDROM - these don't seem to > have been in your hard disk partition ? > > When I boot the CDROM, I get can access binaries (/bin) and config files > (/etc) that are in /dev/ram (mounted as root) but none of these appear in > diskfiles245.tar.gz. > > Can you tell me where these came from ? the setup is like this : diskfiles245.tar.gz is the contents of the stuff which is on /dev/hda1 (or /dev/sda1 , whichever disk is 0x80h on your PC) . /dev/hda1 or /dev/sda1 is the only partition allowed on that disk, so you need at least two seperate disks inside your PC, to be able to generate the diskimage.bin file like outlined inside the HOWTO.iso. My setup is that i have two disks. /dev/hda is basicly an empty disk with only 1 partition of 1 cylinder. /dev/hdb is the second disk which i have redhat7.1 installed on. I boot my rh7.1 by using LILO and using the MBR /dev/hda . there is one very important file inside the diskfiles245.tar.gz file collection, and that is rootrh71.gz . This is a gzip compressed root file system, which is used by initrd and uncompressed into /dev/ram. /dev/ram is 8192 kbytes, but can easily be expanded. So just grab rootrh71.gz and perform the following actions : [root@tinker root]# cd /tmp [root@tinker tmp]# gunzip rootrh71.gz [root@tinker tmp]# losetup /dev/loop0 /tmp/rootrh71.img [root@tinker tmp]# mount /dev/loop0 /mnt/floppy and now adjust the contents of /mnt/floppy as needed. and your changed init script, maybe edit /tmp/floppy/etc/inittab ... etc... Basicly you are now editing your /dev/ram root filesystem, as it is ready and waiting after you have booted the CRK. When your done, turn the result into a rootrh71.gz compressed root initrd image again. this is done as follows : [root@tinker tmp]# sync [root@tinker tmp]# sync [root@tinker tmp]# sync [root@tinker tmp]# cd /tmp [root@tinker tmp]# umount /mnt/floppy [root@tinker tmp]# sync [root@tinker tmp]# sync [root@tinker tmp]# losetup -d /dev/loop0 [root@tinker tmp]# gzip -v -9 /tmp/rootrh71.img [root@tinker tmp]# mv rootrh71.img.gz rootrh71.gz and now move it inside the diskfiles245.tar.gz tarball next build a adjusted kernel which should be preferably done also on a redhat 7.1 system. The reason for that is , that if you take a brandnew kernel, one has to obey the outlines made inside /usr/src/linux/Documentation/Changes. sometimes one needs a newer version of a basic linux runtime package, and in that case , of course, also the contents of the ram-rootfile system should be adjusted. But normally thats not the case. A redhat 7.1 system is ready for any 2.4.x kernel out of the box. configure the kernel just as you like it to be. when you are finished just copy the modules-tree to the cdrom directory tree layout. and copy bzImage into the diskfiles245.tar.gz file collection. then use these new diskfiles to make a new diskimage.bin like outlined inside the HOWTO.iso. Regards Robert