Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Mar 2013 15:19:05 +0100
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-geom@freebsd.org
Cc:        freebsd-current@freebsd.org
Subject:   Disk idents as labels
Message-ID:  <kgqdcm$ivv$1@ger.gmane.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig4D4ED7B5883AB784B97DA116
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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/2ee41dd299e82a8659b61d9=
5ebd35f08306735e9

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.


--------------enig4D4ED7B5883AB784B97DA116
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlEwuNkACgkQ/QjVBj3/HSwUgwCdHLUYfLgQbkOShQuJTOv2MyPU
LW0An3FHDHRAWwWN9D395eTylAgBEYuX
=vepy
-----END PGP SIGNATURE-----

--------------enig4D4ED7B5883AB784B97DA116--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kgqdcm$ivv$1>