Disk idents as labels

Ivan Voras ivoras at freebsd.org
Fri Mar 1 14:19:22 UTC 2013


Hello,

It's silly how this often-requested feature is still not implemented, so
I've made this simple patch which introduces the facility to glabel:

https://bitbucket.org/ivoras/freebsd-head/commits/2ee41dd299e82a8659b61d95ebd35f08306735e9

Basically, it looks up the GEOM::ident attribute and the GEOM class name
and creates a label in the form of "/dev/diskid/CLASS_NAME-ident".

I've added the CLASS_NAME part since there are many classes which simply
pass-through the attribute requests, which can lead to the same drive
being labeled more than once. There are other ways in which this can be
handled, for example by maintaining a table of previously seen ident
strings and not creating a label device if there already exists one for
this ident, or by only restricting the glabel code to create label nodes
for devices of class DISK. I sort of like the latter solution best, but
I don't know if "DISK" is the only class to which such labeling should
be restricted.

I'd like very much for people with complex GEOM topologies or with
non-common RAID controllers to test this and report what they get in
/dev/diskid. The patch should also apply to 9-stable.

For example, on a virtual machine I get this:

crw-r-----  1 root  operator   0x66  1 Mar 14:59
/dev/diskid/DISK-01000000000000000001
crw-r-----  1 root  operator   0x68  1 Mar 14:59
/dev/diskid/PART-00000000000000000001

The DISK one is ok, since it's an unused drive attached to the system,
but the PART one isn't, since it's an unused partition on a drive. This
is why I'd like to restrict this functionality to devices of DISK class.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20130301/c4df7519/attachment.sig>


More information about the freebsd-geom mailing list