Subject: Re: making bootable rescue CD?
To: Steve Bellovin <smb@research.att.com>
From: Simon Burge <simonb@wasabisystems.com>
List: netbsd-users
Date: 04/14/2001 16:28:50
Steve Bellovin wrote:

> I decided it would be good to have a bootable rescue CD -- one that had 
> all of /bin, /usr/bin, etc.  I wrote a script that created the file 
> system image that I wanted, then -- following the instructions in the 
> bootable CD How-To -- I ran mkhybrid.  Here I ran into my first 
> problem:  I needed a boot image.  My attempt to compile from source
> failed (no, I don't know why), so I picked up boot-big.fs from from the 
> 1.5 distribution tree on ftp.netbsd.org.  And it did indeed produce a 
> mostly-usable CD.  But...
> 
> I was rather surprised, when it booted, to find myself in sysinst.  I 
> assume that this is some attribute of boot-big -- is there a way to 
> make that not happen?  I also found that root was /dev/mcd0a, which 
> isn't what I wanted -- I wanted /dev/cd0a to be root, so that /bin, /
> usr/share/man, etc., would be where they should be.  (I bypassed that 
> operationally via 'mount -t cd9660 /dev/cd0a /mnt' and 'chroot /mnt'.)

The install floppy images are configured to use an internal RAM disk
for their root filesystems and thus you used that filesystem as your
root filesystem instead of the one you created.  You may be better off
looking at the magic in /usr/src/distrib/i386/floppies to work out how
to make a floppy image that suits your needs - there are a couple of
rescue type images available.

I'm not sure if a cd9660 filesystem supports device entries for /dev.
If it doesn't and you want to use a cd9660 filesystem for your root
filesystem, you'll almost certainly want to create an mfs for /dev (and
possibly /etc if you want things like dhclient to run) and extract some
tar files containing backups of these directories.  I believe one of
the current i386 floppy images does this for /dev because the ramdisk
filesystem doesn't have enough inodes.

Another idea, does a PC support booting of a FFS burnt onto a CDROM?  I
know that (some) other platforms support this...

> My next problem is that I would like to have /tmp as an mfs file 
> system.  But where can I mount it?  I may not have a /dev/wd0b (and, in 
> fact, I did not when I test-booted the disk on a laptop that has only a
> n EvilOS2000 partition).  /dev/cd0a is busy, and there is no disk label 
> on /dev/cd0d, for example.

You should be able to mount an mfs against "swap" - see mfs(8).  For
example, I have the following in my /etc/fstab:

	swap /tmp mfs rw,-s=131072

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/