*BSD News Article 71127


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!vic.news.telstra.net!act.news.telstra.net!psgrain!news.uoregon.edu!arclight.uoregon.edu!news.sprintlink.net!news-stk-200.sprintlink.net!news.mathworks.com!newscaster-1.mcast.net!informatik.uni-bremen.de!cs.tu-berlin.de!uni-erlangen.de!news.tu-chemnitz.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How to boot single user with root partition writable ?
Date: 15 Jun 1996 17:17:53 GMT
Organization: Private BSD site, Dresden
Lines: 76
Message-ID: <4pur81$84e@uriah.heep.sax.de>
References: <31BCC040.41C67EA6@telstra.net> <4pj93l$o8@jraynard.demon.co.uk>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

james@jraynard.demon.co.uk (James Raynard) wrote:

> >2) What is the best way to make a bootable floppy which has a reasonable
> >no. of maintenance commands available OR is the fixit floppy the best
> >way ?
> 
> The fixit floppy is the best way. Unfortunately making a boot floppy
> for FreeBSD is not a simple task, although I believe someone is
> working on it.

[Julian Elischer did the latter meanwhile...]

Making a bootable floppy is simpler than you might think.  All you
need is to disklabel and newfs one (take care to not waste too much
space in useless i-nodes), and put /kernel onto it.  Don't forget to
specify the -B option to disklabel either, so the floppy gets a
bootstrap.

Since the kernel is rather large, you won't have much space left on a
single floppy.  Better put the root file system onto a separate one
(ever wondered why there used to be a ``root.flp'' in the
distributions until very recently?).  You can quickly swap the
floppies once the kernel is loaded.  You can also boot with -c, and
continue after swapping the floppies, or configure a ``generic
kernel'' with ``config kernel swap generic'' in the config file, and
boot this one with the -a flag.

Here's the procedure for the absolutely minimum boot floppy set:

uriah # disklabel -Brw fd0 floppy3
uriah # newfs -t0 -u0 -i65536 -l1 -m3 -c80 -ospace /dev/rfd0a
/dev/rfd0a:     2880 sectors in 80 cylinders of 2 tracks, 18 sectors
        1.4MB in 1 cyl groups (80 c/g, 1.41MB/g, 32 i/g)
super-block backups (for fsck -b #) at:
 32,
uriah # mount /dev/fd0a /mnt
uriah # cp /kernel.GENERIC /mnt/kernel
uriah # umount /mnt

[swap floppies]

uriah # disklabel -Brw fd0 floppy3
uriah # newfs -t0 -u0 -i65536 -l1 -m3 -c80 -ospace /dev/rfd0a
/dev/rfd0a:     2880 sectors in 80 cylinders of 2 tracks, 18 sectors
        1.4MB in 1 cyl groups (80 c/g, 1.41MB/g, 32 i/g)
super-block backups (for fsck -b #) at:
 32,
uriah # mount /dev/fd0a /mnt
uriah # mkdir /mnt/bin /mnt/etc /mnt/sbin /mnt/dev
uriah # cp /bin/sh /mnt/bin
uriah # cp /sbin/init /mnt/sbin
uriah # touch /mnt/etc/spwd.db
uriah # mknod /mnt/dev/console c 0 0
uriah # cat > /mnt/etc/rc
echo "Multi-user mode impossible, sorry."
exit 1
uriah # umount /mnt

Of course, this is not a useful floppy set, but you get the picture
about what is required.  Remember the nice little program called
crunchgen when thinking about creating your own fixit floppy.  I've
been doing this a couple of days ago, and established a full internet-
capable two-floppy server machine, even including an inetd and
telnetd.  (It's only purpose was to offer the entire contents of its
[non-FreeBSD] harddisk across the network.)


(The really difficult thing is to build an _installation_ floppy, but
that's not exactly needed for a recovery set.)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)