From owner-freebsd-geom@FreeBSD.ORG Fri Mar 1 14:19:22 2013 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9806D464 for ; Fri, 1 Mar 2013 14:19:22 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 56683F75 for ; Fri, 1 Mar 2013 14:19:22 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UBQoD-0003V2-LX for freebsd-geom@freebsd.org; Fri, 01 Mar 2013 15:19:37 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Mar 2013 15:19:37 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Mar 2013 15:19:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Subject: Disk idents as labels Date: Fri, 01 Mar 2013 15:19:05 +0100 Lines: 57 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4D4ED7B5883AB784B97DA116" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120812 Thunderbird/14.0 X-Enigmail-Version: 1.4.3 Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2013 14:19:22 -0000 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--