Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Nov 2009 22:48:45 -0800
From:      David Allen <the.real.david.allen@gmail.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Partition naming, fstab, and geli
Message-ID:  <2daa8b4e0911152248l228e6bd2va78853defdf40009@mail.gmail.com>
In-Reply-To: <20091116042131.d522b7f6.freebsd@edvax.de>
References:  <2daa8b4e0911151823sd98f726ma4b8eebf05b16dd0@mail.gmail.com> <20091116042131.d522b7f6.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/15/09, Polytropon wrote:
> On Sun, 15 Nov 2009 19:23:15 -0700, David Allen 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.

Well, you and I seem to be on the same page, but I was referring to the
following:

	2.6.5 Creating Partitions Using Disklabel

		Table 2-3. Partition Layout for Subsequent Disks

		The rest of the disk is taken up with one big partition. This could
		easily be put on the a partition, instead of the e partition.
		However, convention says that the a partition on a slice is reserved
		for the filesystem that will be the root (/) filesystem. You do not
		have to follow this convention, but sysinstall does, so
		following it yourself makes the installation slightly cleaner.  You
		can choose to mount this filesystem anywhere; this example suggests
		that you mount them as directories /diskn, where n is a number that
		changes for each disk. But you can use another scheme if you prefer.

The 'e' partition is again used in the Handbook section 18.3 Adding
Disks.

I guess I'm looking for the pedantic answer, but I'll settle for less.

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

I'd prefer the same with the "first" disk, but sysinstall won't
accomodate it, and on most installations, it's more work trying to work
around sysinstall than it is using it.  So non-dedicated it is.

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

Great.

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

LOL.  Surprised me.  I figured a 'noauto' for a non-existent device
would be acceptable.

>> 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

But the eli device doesn't exist until after it's attached, which, in my
case, will happen manually and on-demand after boot.

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

A pass phrase from the operator?  Not likely.  It's not a desktop.

Each of the following will result in the system not booting:

	# there is no ad4
	/dev/ad4a       /foo  ufs  rw,noauto  0  0

	# ad1e is encrypted so ufs is not a valid fstype
	/dev/ad1e       /foo  ufs  rw,noauto  0  0

	# the eli device doesn't exist at boot time
	/dev/ad1e.eli   /foo  ufs  rw,noauto  0  0

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

I can live with that (the encrypted partition has to be attached
manually anyways).  But I do want to use fstab to record what goes
where.  I end up with two devices, right?  So what two entries should I
make in fstab?  The following won't work.

	/dev/ad1e     /foo  ufs  rw,noauto  0  0
	/dev/ad1.eli  /foo  ufs  rw,noauto  0  0



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