
I have made (or rather tried to make but not succeded) a custom rescue disk based on the image /disks/rescue on CD1 of SuSE Linux 7.3. I unziped the image, mounted a loopback filesystem, copied everything to a temporary directory, deleted some files and added some. Then I created an 8MiB file of zeroes, made an ext2 filesystem on that file, mounted it as a loopback filesystem and copied everything from the temporary directory to this filesystem. I then unmounted it, gziped the file and copied the onto a disk using dd. I had to try and fail a bit to get resulting image small enough to fit onto a floppy so I made a script to automate the process. I have attached the script to the end of this post. The problem is that when I boot using the unmodified /disks/bootdisk image, which I copied to a disk, and my custom rescue disk I get errors. After the boot disk is read I get the menus. I then select "rescue system" and "from floppy" (or at least something like that). I am asked to insert the rescue disk, it is read and it says "remove disk" and an OK button. I press the OK button. At this point I would normally get the login screen. I do when I use the supplied, unmodified rescue image. When I use my custom rescue image I get an error message telling me that e2fsck was run and it not find the filesystem entirely to its liking, specifically the superblock is missing. On a previous occasion, ie. with an earlier version of the rescue disk, which didn't work either, I got error messages telling me some program was respawning to fast. Thinking that something was wrong with my rescue disk I loaded the image back from the disk, gunziped it, mounted it as a loopback filesystem and ran e2fsck. e2fsck reported that the filesystem was OK. I also tried with a minix filesystem on the rescue image i case that's what the program (linuxrc is it?) that loads the rescue sytem expects but got, basically, the same result. Here's my rescue image when I've done a ls -s: 1404 -rw-r--r-- 1 root root 1437278 Dec 1 23:40 tmp/newrescue.gz Here's my "make rescue disk" script: #!/bin/bash #Modifies the SuSE rescue image and produces new image. Make a tmp directory #and cd to it before running this. New rescue image is 'newrescue.gz'. if [ $(mount | grep -c 'rescue.*res') != 0 ]; then umount res fi if [ $(mount | grep -c 'newrescue.*newres') != 0 ]; then umount newres fi if [ $(mount | grep -c 'bigrescue.*bigres') != 0 ]; then umount bigres fi #Mount SuSE disk rescue image and copy files to buffer test ! -d res && mkdir -v res cp /SuSE.7.3.CDs/CD1/disks/rescue rescue.gz test -f rescue && rm rescue gunzip -v rescue.gz mount -v -o loop -t ext2 rescue res test -d tmpres && rm -r tmpres test ! -d tmpres && mkdir -v tmpres cp -dpR res/* tmpres #Mount SuSE CD big rescue image test ! -d bigres && mkdir bigres cp /SuSE.7.3.CDs/CD1/suse/images/rescue bigrescue.gz test -f bigrescue && rm bigrescue gunzip -v bigrescue.gz mount -v -o loop -t ext2 bigrescue bigres #Files to add cp -vdp /lib/*lvm* tmpres/lib cp -vdpR /dev/hda16 tmpres/dev cp -vdpR /dev/hdb16 tmpres/dev cp /sbin/vgscan tmpres/sbin cp /sbin/vgchange tmpres/sbin cp bigres/sbin/insmod tmpres/sbin #Files to remove rm tmpres/usr/bin/basename #rm tmpres/usr/bin/chattr rm tmpres/usr/bin/cpio rm tmpres/usr/bin/cut rm tmpres/usr/bin/diff rm tmpres/usr/bin/du rm tmpres/usr/bin/egrep rm tmpres/usr/bin/fgrep rm tmpres/usr/bin/grep rm tmpres/usr/bin/ftp rm tmpres/usr/bin/find rm tmpres/usr/bin/lsattr rm tmpres/usr/bin/less rm tmpres/usr/bin/mt rm tmpres/usr/bin/sed rm tmpres/usr/bin/telnet #rm tmpres/usr/bin/touch rm tmpres/usr/bin/vim rm tmpres/usr/bin/vi rm tmpres/usr/bin/zgrep rm tmpres/usr/bin/wc rm tmpres/usr/bin/yes #rm tmpres/bin/cp rm tmpres/bin/dd rm tmpres/bin/df rm tmpres/bin/mv rm tmpres/bin/ps rm tmpres/bin/dmesg rm tmpres/bin/pwd rm tmpres/bin/fuser rm tmpres/bin/hostname rm tmpres/bin/gzip rm tmpres/bin/gunzip rm tmpres/bin/ping #rm tmpres/bin/sleep rm tmpres/bin/tar rm tmpres/sbin/hdparm rm tmpres/sbin/hwclock rm tmpres/sbin/ifconfig #rm tmpres/sbin/killproc #rm tmpres/sbin/mingetty #rm tmpres/sbin/restore rm tmpres/sbin/route rm tmpres/sbin/sfdisk rm tmpres/sbin/tune2fs #rm tmpres/sbin/update #rm tmpres/lib/libncurses.so.3.0 #rm tmpres/lib/libncurses.so.3.0.980228 #Make new rescue image test ! -d newres && mkdir newres dd if=/dev/zero of=newrescue bs=1k count=8192 echo y | mke2fs -m 0 -N1000 newrescue #echo y | mkfs.minix newrescue mount -v -o loop -t ext2 newrescue newres #mount -v -o loop -t minix newrescue newres cp -dpR tmpres/* newres ldconfig -r newres du -sh res newres #Cleanup umount res umount newres umount bigres rmdir -v res newres bigres rm rescue bigrescue rm -r tmpres #Zip up and report sizes gzip -fv9 newrescue du -k newrescue.gz /SuSE.7.3.CDs/CD1/disks/bootdisk