Identifying disks with serial number

Boris Kochergin spawk at acm.poly.edu
Fri Sep 4 14:44:23 UTC 2009


Graham Todd wrote:
> Miroslav Lachman wrote:
>   
>> Graham Todd wrote:
>>     
>>> Hello all,
>>>
>>> Quick question on disk serial numbers. Besides manually geom_label-ling
>>> disks by serial number is there an automagic way for geom to present
>>> serial numbers to the system/devfs?  I'm not using ZFS or anything but
>>> I've got to the point where anything that helps with juggling disks would
>>> be nice.
>>>
>>> I noticed a newish DragonflyBSD feature that does this. They "label"
>>> disks with serial numbers, devfs seems to see them and then you can 
>>> use convenience aliases in /etc/devtab to make the serial number ID
>>> referenceable in /etc/fstab). See:
>>>
>>>  http://leaf.dragonflybsd.org/mailarchive/users/2009-08/msg00149.html
>>>
>>> Something similar was discussed in freebsd-arch thread long ago (by the
>>> usual suspects (-: ):
>>>
>>>  http://lists.freebsd.org/pipermail/freebsd-arch/2006-June/005344.html
>>>
>>> Is there a documented way to "autolabel" disks by serial number in
>>> FreeBSD?
>>>       
>> It was discussed [1], but there are no labels by disk ID at this time.
>> There are auto labels for partitions. You can then use ufsid in your fstab.
>>
>> GEOM_LABEL: Label for provider ad4s1a is ufsid/4a985d01cb85f79f.
>> GEOM_LABEL: Label for provider ad4s1d is ufsid/4a985d015b316798.
>> GEOM_LABEL: Label for provider ad4s1e is ufsid/4a985d015260f27c.
>>
>> 1] http://lists.freebsd.org/pipermail/freebsd-geom/2009-July/003625.html
>>     
>
> Thanks for the reference. I'm already using geom labels for juggling file
> systems and it's great.  I hope that can extend to disks in the future.
>   
FYI, you can glabel an entire disk. The man page has an example.

-Boris
> One of the replies to Ivan Voras's original post asked about a use case. I
> think in the message to the dragonfly users mailing list (see link above)
> Matt Dillon lays one out: booting from a specific disk ID no matter how it
> is attached (firewire, USB, external/internal SATA etc.). Since that might
> involve changes to the boot loader perhaps it's not a great example.
>
> I wasn't thinking of ZFS in particular and didn't realize that the
> implications were complicated for zpools etc (nor that there was a
> particular devfs namespace pollution issue for disk labels). As far as I
> can tell the dfly feature isn't specific to hammer but maybe it is more
> useful in their particular case.
>
> Anyway, thanks to all for the excellent work on FreeBSD file systems and
> geom classes ;-)
>
>
>
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
>   


More information about the freebsd-fs mailing list