Partition naming, fstab, and geli

Polytropon freebsd at edvax.de
Mon Nov 16 03:21:35 UTC 2009


On Sun, 15 Nov 2009 19:23:15 -0700, David Allen <the.real.david.allen at gmail.com> wrote:
> 1. The Handbook suggests there is a convention that when partitioning a a
> drive that's been added, to label the first new partition on that drive as
> 'e' as opposed to 'a' (which is reserved for the /root partition).  Does
> the following satisfy that convention, or would starting with 'a' in each
> case make more sense?
> 
>     /dev/ad1e  /foo1  ufs  rw  2  2
>     /dev/ad1f  /bar1  ufs  rw  2  2
>     /dev/ad1g  /baz1  ufs  rw  2  2
> 
>     /dev/ad2e  /foo2  ufs  rw  2  2
>     /dev/ad2f  /bar2  ufs  rw  2  2
> 
>     /dev/ad3e  /foo3  ufs  rw  2  2
>     /dev/ad3f  /bar3  ufs  rw  2  2

The Handbook says in 18.3.1 sub 3:

	A disk can have up to eight partitions, labeled a-h.
	A few of the partition labels have special uses.
	The a partition is used for the root partition (/).
	Thus only your system disk (e.g, the disk you boot
	from) should have an a partition. The b partition
	is used for swap partitions, and you may have many 
	disks with swap partitions. The c partition addresses 
	the entire disk in dedicated mode, or the entire 
	FreeBSD slice in slice mode. The other partitions 
	are for general use.

Note the last sentence. Due to this statement, I think the
usage of 'e' is arbitrary, 'd' could be okay, too, but when
the Handbook says 'e' in the example (maybe with the intention
of 'e' like in 'example'?), you can use 'e', too, especially
when you want to use more than one partition.

I have to admit that I never put slices on extra hard disks,
I'm always using the whole disk, so

	# newfs /dev/ad3

would give me /dev/ad3 (which is the same as /dev/ad3c), and
the entry

	/dev/ad3  /foo  ufs  rw  2  2

would go into fstab.

I'm sure you already know this because it seems that you read
up until 18.3.2.2 - you're omitting slices, "dedicated" mode. :-)

Bottom line: The naming convention mentioned in the Handbook
and your examples are completely okay.



> 2.  My second question is in regards to using the 'xx' fstype to have the
> system ignore that device.
> 
> Consider, for example, a geli encrypted partition.  The .eli device
> doesn't exist at boot time.  I discovered by accident that the system
> won't boot with an fstab entry for a device that doesn't exist. 

That's completely intended. :-)



> So if I
> was to record an entry in fstab, I couldn't use
> 
>     /dev/ad1e.eli  /home/david/private  ufs  rw  0  0
> 
> Does that mean that the following is what's typically to record fstab
> entries for ignored devices?
> 
>     /dev/ad1e.eli  /home/david/private  xx   rw  0  0
>     /dev/ad3e      /fake                xx   rw  0  0
>     /dev/ad3f      /reserved            xx   rw  0  0

I would say: No. The entry for those partitions should rather be:

	/dev/ad1e.eli  /home/david/private  ufs   rw,noauto  0  0
	/dev/ad3e      /fake                ufs   rw,noauto  0  0
	/dev/ad3f      /reserved            ufs   rw,noauto  0  0

The "ufs" in the FS field tells the system which FS to use when
later mounting (e. g. with requiring a pass phrase from the
operator), and "noauto" in the options field that prohibits
mounting the file system at startup.

If you used "xx" in the FS field, you could not easily

	# mount /reserved

because the mount command wouldn't know which FS to use (allthough
I think UFS might be a default here).




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


More information about the freebsd-questions mailing list