Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 1999 10:53:40 -0400
From:      Vince Gonzalez <vince@nycrc.net>
To:        Lukas Ruf <lpruf@stud.ee.ethz.ch>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Boot Disk
Message-ID:  <19990521105340.A9909@moe.nycrc.net>
In-Reply-To: <Pine.GSO.4.10.9905210925410.24809-100000@tardis-a2.ee.ethz.ch>; from Lukas Ruf on Fri, May 21, 1999 at 09:27:25AM %2B0200
References:  <Pine.GSO.4.10.9905210925410.24809-100000@tardis-a2.ee.ethz.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 21, 1999 at 09:27:25AM +0200, Lukas Ruf wrote:
> Hi all,
> 
> does a DOCUMENTATION on how to create a BOOT FLOPPY DISK exist anywhere?
> 
> Any points and hints are gratefully appreciated.

Here goes...

From /etc/disktab:
# To make a filesystem on a floppy:
#       fdformat [-f <size>] fd<drive>[.<size>]
#       disklabel -B -r -w fd<drive>[.<size>] fd<size>
#       newfs <opts> fd<drive>[.<size>]

Mount it, and copy a kernel there. You may need to gzip it first, be sure to 
call gzip with the -9 option.

Copy the entire /boot directory to your new floppy. (I'm pretty sure you can do
this without problems; anyone?)

You'll notice that after you copy your kernel and the boot directory there 
isn't a whole lot of space left.  You'll need an MFS root floppy.  So create
a file in /boot (on your floppy) called loader.rc that contains something 
like this:

load /kernel
echo Insert MFS root floppy and press enter:
read
load -t mfs_root /mfsroot
boot

Then repeat the fdformat,disklabel,newfs steps on a new floppy.  Make sure your
running kernel has vn(4) support.  Do this:

dd if=/dev/zero of=my.new.mfs.root count=5760

This will create a 2880k file.  Since you've recompiled your kernel with vn(4)
support, you can do this:

vnconfig /dev/vn0 my.new.mfs.root

And then this:

newfs /dev/vn0 minimum2

minimum2 is defined in /etc/disktab by the way.

Now mount your new mfs root. 

mount /dev/vn0 /mnt

Now put stuff on the filesystem you just mounted.  When you think you're done,
unmount the vn device and gzip -9 my.new.mfs.root.  I prefer to use gzip as
a filter in this case since it's annoying to compress and decompress the file
all the time.  However you do it, put the gzip'd file on your new mfs root fs.
Populating your mfsroot is the hard part.  You should now have a bootable
kernel floppy and mfs root floppy.  I have some images of these if you're
interested, but wouldn't doing it yourself be more fun? :)  BTW, if you
need to do more than just boot and run a shell and ls, you'll need to 
recompile most of the stock programs to use shared libraries.

I'm sure someone will let us know if I got anything wrong. :)

-- 
vince@nycrc.net


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990521105340.A9909>