A request for unnested UFS implementation in MBR

Polytropon freebsd at edvax.de
Sun Jul 8 01:18:49 UTC 2018

On Sun, 8 Jul 2018 01:42:06 +0100, RW via freebsd-questions wrote:
> On Sun, 8 Jul 2018 01:42:04 +0200
> Polytropon wrote:
> > From my understanding (and explained off-list), FreeBSD
> > requires a 'a' BSD-labeled partition (inside a slice in
> > case of MBR, or on a disk if "dedicated") to boot from.
> > It doesn't seem to be possible to label a partition 'a'
> > without using labels.
> > 
> > The label 'c' for data partitions is implicit and will
> > be synonymous for "the whole thing" (slice, disk), as
> > it is generated by using newfs on a MBR slice directly
> > (no matter if "DOS primary partition" or "logical volume
> > inside DOS extended partition").
> It's certainly possible to put UFS on a disk, or an MBR partition,
> without labelling.

Of course it is, I do it all the time for data disks. :-)

If you have a disk da0 in your system and you "newfs /dev/da0",
then you get a UFS filesystem /dev/da0c which is equivalent
to /dev/da0, and you can "mount -t ufs /dev/da0 /mnt".

This works the same for a slice ("DOS primary partition"),
for example "newfs /dev/da0s1" and then "mount -t ufs /dev/da0s1
/mnt", where da0s1c equals da0s1.

Again, 'c' means "the whole thing" (disk, slice).

The other letters are usually reserved for use in this

	a	boot partition
	b	swap
	c	"the whole thing"
	d	user-defined (for example /tmp)
	e	user-defined (for example /var)
	f	user-defined (for example /usr)
	g	user-defined (for example /opt)
	h	user-defined (for example /home)

There is a limit on letters. :-)

Initially, this is how the BSDs partitioned a disk, and this
existed long before MBR. That's why the requirement of a boot
partition - where should the OS boot from?

The logical conclusion is: If you want to use an 'a' partition
for being able to boot from, you have to create labels. FreeBSD
won't boot from a 'c' partition.

>From "man 8 boot":

	The automatic boot will attempt to load /boot/loader from
	partition `a' of either the floppy or the hard disk.

There is no word about this mechanism working with 'c', too.

Of course, this would be subject to an interesting experiment:
Create a slice and directly format it. Put /boot/loader on it,
as well as a kernel and maybe the whole OS. Instruct the boot
loader to boot from it (e. g., boot device = /dev/ada0s7).

> I don't recall seeing a 'c' but I might be wrong.   

The 'c' isn't needed anymore as <dev>c == <dev>. As there
is no actual BSD label, you can't see it even if you use
the traditional disklabel / bsdlabel tool.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list