Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 1996 19:01:02 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Cc:        Andries.Brouwer@cwi.nl
Subject:   Re: installation fails
Message-ID:  <199607201701.TAA04947@uriah.heep.sax.de>
In-Reply-To: <9607201402.AA16759=aeb@zeus-184.cwi.nl> from "Andries.Brouwer@cwi.nl" at "Jul 20, 96 04:02:13 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
As Andries.Brouwer@cwi.nl wrote:

> 		4:sd(1,a)/kernel
> 
> 	(The `4' means `5th BIOS disk'.)
> 
> Yesterday I decided that that couldnt work, but now that you
> say it explicitly, I tried, and it doesnt work.
> (Yields an infinite string of
> 	Error C:0 H:0 S:0
> error messages.)
> 
> My BIOS only knows about disks 0 and 1, so anything booted
> directly must come from there, or from floppy.

Of course, if your BIOS does only know about disks 0 and 1, you cannot
boot off a different disk.  (You didn't write this before, and for
recent BIOSes it's no longer that unusual that they provide a mapping
for more than two drives.)

> So, my Linux kernels live on disk 1 and get a boot parameter
> to tell them which partition on which disk is to be mounted
> as root directory.
> 
> I am searching for the way to communicate to a FreeBSD kernel
> what device contains the root file system.

There are basically two opportunities.

You can configure a custom kernel, and tell it

	config kernel root on sd1

But then, the bootstrap defaults to override this statement, and
reassign the root device to the boot device (which usually makes
sense).  You have to boot with the -r option in order to avoid this
(from boot(8)):

     -r    do not establish the root directory of
           the file system hierarchy on the device
           where the boot file is being loaded
           from

The second version is to create a `generic' kernel (alas, the GENERIC
kernel is not a `generic' one), and use the -a option to the boot
loader, meaning ``askroot''.  A generic kernel is characterized by
just only

	config kernel swap generic

as its configuration statement.  This is only rarely used by now, but
should probably be used for GENERIC, too.  (I'm moving the discussion
to -hackers for that purpose.)

Both options are not very satisfactory to you.  The existing bootstrap
didn't maintain any state information across reboots.  One can see
this as a good behaviour, since it doesn't clobber the disk if it
never writes. :)  In your case, it were desirable however to maintain
state.  Julian Elischer has been working on an alternate scheme
recently, but i don't have the slightest idea about its status.

> Being an absolute beginner with FreeBSD (although with 20+
> years of Unix experience) I also experience a lack of
> information. For example: what is the naming scheme for
> disks and partitions and slices?

Partitions stand in the Unix tradition, and have trailing letters
assigned, from `a' through `h'.  Partition `c' is magic in that it
always covers the entire slice or disk, even if no label is (yet)
available.  This is required to put the initial label on a disk.
Partition `a' is conventionally used for a bootable partition, and
partition `b' is conventionally used for swap/paging space.

Slices have not been available in classic Unices, but had to be
introduced since the PeeCee did already use another partitioning
scheme, the fdisk table.  There are four pre-defined slices 1 through
4, mapping to the four slots of the primary fdisk table (regardless of
whether they contain something useful or not).  Additional slices,
numbered >= 5 are being assigned for so-called ``extended
partitions''.  Slice numbers precede the partition letter, together
with the letter `s'.

Slice 0 is magic in that it is not mentioned in the device name (thus
no `s0') but always covers the first (by fdisk table slot number, not
by disk position) FreeBSD slice.  It is also available if there is no
valid fdisk table, covering the entire disk then.  (``Dangerously
dedicated'' disk, roughly comparable to the classic Unix setup.)

There are four major disk controller names (not mentioning CD-ROMs),
fd for floppy disk, sd for SCSI disk, od for MO disk, and wd for
WD1003/WD1007 or compatible disks.  Each of them is followed by a unit
number.  Thus

	sd0s2a		partition `a' (presumably bootable) of second
			slice on third SCSI disk, slice has a BSD label

	sd0b		partition `b' (presumably swap) of the
			compatibility slice of first SCSI disk, disk
			or slice has a BSD label

	wd0		entire ``compatibility'' slice of first IDE disk

	wd0c		the same as above, but expressed as the magic
			`c' partition (no BSD label required)

	wd1s4		fourth slice on second IDE disk, slice need not
			have a BSD label (i.e., can be a MS-Dog slice)

All of them are available in their /dev/XXX buffered incarnation,
suitable for mounting file systems, or /dev/rXXX unbuffered, suitable
for handling the raw disks as for backups etc.


(Maybe somebod should compile an entry for the handbook.)

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



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