HOWTO create your own iso 

http://crashrecovery.org/CrashRecoveryKit/contrib/CREATE_ISO.txt

The older crash recovery kit iso's used the 2.88 Mb floppy El-torito boot-emulation. However the thing has gone to big and i'm not able anymore to use 2.88 Mb floppy-emulation with mkisofs to make cdboot.img bootable inside my iso. Instead i now use the disk-emulation option.

here's the one-liner to create the iso :

/usr/bin/mkisofs -b boot/diskimage.img -c boot/boot.catalog \
      -hard-disk-boot -o /mnt/data2/crash2418.iso  -l -r -L -J \
      -V "CRK for Linux 2.4.18" -P "CRK-2002032801" -p "stock" \
      -A "CRK for Linux 2.4.18"  "/mnt/data2/crash2418"

The downside is i have to use a physical partition on my first harddisk (/dev/sda /dev/sda1) to manipulate the contents of diskimage.img. The procedure to activate lilo is :

# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 255 heads, 63 sectors, 555 cylinders
Units = cylinders of 16065 * 512 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1         1      8001   83  Linux

Command (m for help): q

# mount /dev/sda1 /mnt/root
# cd /mnt/root
# lilo -C etc/lilo.conf
# sync
# sync
# cd /
# umount /mnt/root
# dd if=/dev/sda of=diskimage.img bs=1k count=8192

here's the contents of /mnt/root/etc/lilo.conf :

boot=/dev/sda
map=boot/map
install=boot/boot.b
message=etc/message.txt
compact
prompt
image=vmlinuz
        label=linux
        append="root=/dev/ram0 ramdisk_size=8192"
        initrd=boot/rootrh72.gz
        root=/dev/ram0
        read-only
Important

If you use the procedure outlined above always rerun lilo on your ordinary /etc/lilo.conf . Otherwise you will only be able to boot your CRK for Linux 2.4.18 from harddisk ( i.e. /dev/sda1 ) afterwards.

With every release of CRK for 2.4.x i will include a tar.gz tarball of the contents of the /dev/sda1 partition described above. It will be on the CRK cdrom and as a seperate download. They are located inside the boot directory and called in this case diskfiles2418.tar.gz .

For more info email me at stock@stokkie.net

Robert M. Stockmann

documented on: Mon Apr 15 09:55:58 CEST 2002

Using Crash Recovery CDROM 

http://crashrecovery.org/CrashRecoveryKit/contrib/CUSTOM.txt

> 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.

Robert

Using SYSLINUX 

http://crashrecovery.org/CrashRecoveryKit/contrib/SYSLINUX.txt

I've tried to build the disk, following your HOWTO but when things came to LILO I met some problems. Problems like: Too big harddisk (>1024 cylinders), more than one partition on the harddisk, etc.

But I downloaded SYSLINUX since I know most distros use this these days. It worked without problems!

I put isolinux.bin in the boot-directory on a cd with isolinux.cfg, message.txt and the boot image.

isolinux.cfg (looks something like this):

display message.txt
label linux
        kernel vmlinuz
        append root=/dev/ram0 ramdisk_size=8192 initrd=rootrh71.gz

Now I just created the iso using something like

# mkisofs -o <isofile> -b boot/isolinux.bin -c boot/boot.cat -r -R -l -L
-J -no-boot-emul -load-boot-size 4 -boot-info-table <iso-directory>

I think this approach is much better than using LILO, simply because you don't need to worry about putting a boot sector temporarily on your harddisk.

Jan Vidar Krey

documented on: 31 Jul 2001