Partition naming, fstab, and geli

Jerry McAllister jerrymc at msu.edu
Mon Nov 16 18:03:57 UTC 2009


On Tue, Nov 17, 2009 at 03:04:27AM +1100, Ian Smith wrote:

> In freebsd-questions Digest, Vol 285, Issue 2, Message 2
> On Sun, 15 Nov 2009 19:23:15 -0700 David Allen wrote:
> 
>  > Say I have performed a standard installation of FreeBSD onto a single IDE
>  > drive with the following entries in /etc/fstab:
>  > 
>  >     /dev/ad0s1b  none  swap  sw  0  0
>  >     /dev/ad0s1a  /     ufs   rw  1  1
>  >     /dev/ad0s1d  /var  ufs   rw  2  2
>  >     /dev/ad0s1e  /tmp  ufs   rw  2  2
>  >     /dev/ad0s1f  /usr  ufs   rw  2  2
>  > 
>  > Then I added more drives.
>  > 
>  > 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
> 
> If you added these with sysinstall (or sade) it will tend to choose 'd' 
> for the first partition on other than the / partition (which is named
> 'a' on install).  Or at least, it's always started with 'd' for me :)


Generally, using 'a' for root is needed if the slice is a device and
root (/) will be there.   But, probably because of that, the tradition
of reserving 'a' is strong enough that many people and some utilities
just do it that way unless specifically directed otherwise.   But, if
it is a second (third, fourth, etc) slice/drive that will not have
a root partition, it doesn't actually matter.  I tend to use 'a' if
the drive will be entirely one slice and one partition used for some
special work or scratch space, but stick with 'd..h' if there will be
more than one partition and just leave 'a' alone - for no other 
reason than habit.   

As for 'd' vs 'e', sometime a long time and many generations ago there
was a convention of reserving 'd' for something.  I don't remember what
it was.  It was pre FreeBSD 3 and pre 1997 and maybe even pre any FreeBSD
and applied in some earlier Unix-en before the court cases, but not after.
That old convention accounts for documentation starting with using 'e' for 
extra partitions and skipping 'd'.   But, whatever that old convention
was, it has not been used for so long that it is meaningless nowdays
and 'd' can be used for whatever extra partition you want.

////jerry    
   
> 
> But if you're doing it manually starting with 'e' is fine.  I suspect 
> the handbook section you quoted to Polytropon later is more an example 
> than definitive.  You can happily mount an 'a' partition from another 
> drive that was once a system disk; it's more of a convention really.
> 
>  > 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.  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
> 
> Yes.  Here I must differ with Polytropon, though your format for the 
> options isn't perhaps quite right.  From an old fstab here:
> 
> # Device                Mountpoint      FStype  Options         Dump    Pass#
> /dev/acd0               /cdrom          cd9660  ro,noauto       0       0
> /dev/ad0s1              /dos            msdosfs ro,noauto       0       0
> /dev/ad0s2b             none            swap    sw              0       0
> /dev/ad0s2a             /               ufs     rw              1       1
> /dev/ad0s2d             /var            ufs     rw,noatime      2       2
> /dev/ad0s2e             /usr            ufs     rw,noatime      2       2
> /dev/ad0s4d     /paqi4.5        ufs ro,noauto,nodev,noexec,nosymfollow,noatime 2  3
> /dev/ad0s4e     /paqi4.5/var    ufs ro,noauto,nodev,noexec,nosymfollow,noatime 2  4
> /dev/ad0s4f     /paqi4.5/usr    ufs ro,noauto,nodev,noexec,nosymfollow,noatime 2  4
> # 25Apr06 ext 20Gb USB disk.  DON'T autoadd these, deadly if da0 absent!
> # .. xx fsopts, everything incl fsck must ignore ..
> /dev/da0s3d     /usbdsk         ufs     xx,noauto,nosymfollow   3       3
> /dev/da0s3e     /usbdsk/var     ufs     xx,noauto,nosymfollow   4       4
> /dev/da0s3f     /usbdsk/usr     ufs     xx,noauto,nosymfollow   4       4
> # 26May06 shintaro 1G flashdrive .. just doc, can't mount using these ..
> /dev/da0s1      /flash/dos      msdosfs xx,noauto               0       0
> /dev/da0s2d     /flash/ufs      ufs     xx,noauto,noatime       3       3
> /dev/da0s3d     /flash/pvt      ufs     xx,noauto,noatime       3       3
> 
> As you say they're useful for doc, and not hard to edit into action. 
> Note the additions above were assigned starting at 'd' by sysinstall.
> 
> cheers, Ian
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list