Hard drive device names... Serial Numbers?

Fabian Keil freebsd-listen at fabiankeil.de
Mon Feb 25 11:03:34 UTC 2013


"Ronald F. Guilmette" <rfg at tristatelogic.com> wrote:

> So anyway, adding the PATA drive to this system of course rendered
> everything I had previously had in my /etc/fstab suddenly incorrect.
> Fortunately, I anticipated this and was prepared to boot FreeBSD Live
> from a CD, and then go in and edit my /etc/fstab as necessary to
> adjust everything for the new hard drive numbers.
> 
> This isn't the first time I've had to go through this process.  It is
> always an annoyance.
> 
> Up until today I was only dimly aware of the different approach described
> here:
> 
>     http://www.freebsd.org/doc/handbook/geom-glabel.html
> 
> but today I was finally motivated to seek out and read the above page,
> which I have now done.
> 
> Having now read all about temporary labels, permanment labels, and ufsids,
> and having noted the obvious drawbacks to each (including but not limited
> to the fact that these techniques generally only appear to be applicable
> exclusively to UFS file systems _and_ only recently created ones at that)

Only ufsids are limited to UFS, temporary and permanent labels are generic.

> I thought that I would take a second and ask about the general idea of
> using built-in hard drive serial numbers as a filesystem-independent
> and interface-independent way of identifying specific hard drive devices
> (and/or their sub-parts) e.g. within /etc/fstab.

Note that you can already do that manually by putting the serial number
in the permanent glabel label. If you are using GPT headers you need to
be careful with this, though, for details see gpart(8).
 
> This idea seems so obviously that I am forced to assume that I'm probably
> far from the first person to have suggested and/or asked about it.
> 
> So what gives?  Why can't we have something like /dev/hdsn/ (hdsn ==
> Hard Drive Serial Number) where a set of device numbers would automagically
> be created within that directory, all of whose names correspond to the
> actual hardware serial numbers of all currently attached hard drive
> type devices?  (If just the serial numbers are not seen an being unique
> enough, I can imagine other unique or semi-unique properties of the drive
> being concatenated with the serial numbers.)

I believe the main reasons is that so far nobody cared enough about
this to provide patches. It has been suggested before and I don't
remember anyone being against it.

Dragonfly BSD already supports this and maybe parts of the code
could be ported.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130225/d7346814/attachment.sig>


More information about the freebsd-fs mailing list