* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
@ 2007-06-16 2:32 ` Kay Sievers
2007-06-16 7:31 ` Joel Becker
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-06-16 2:32 UTC (permalink / raw)
To: linux-hotplug
On 6/16/07, Joel Becker <Joel.Becker@oracle.com> wrote:
> Why does udev ignore md* and dm-* devices for persistent naming?
> I was utterly surprised to find that an ext3 on /dev/md0 or /dev/dm-0
> won't show up in /dev/disk/by-uuid. Given that dm and md devices can
> change names, isn't this something we'd really like to have?
Sure, they just have their own rules files. Both have specific
requirements/lifetime-rules and plug into "change" events.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
2007-06-16 2:32 ` Kay Sievers
@ 2007-06-16 7:31 ` Joel Becker
2007-06-16 7:49 ` Andrey Borzenkov
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Joel Becker @ 2007-06-16 7:31 UTC (permalink / raw)
To: linux-hotplug
On Sat, Jun 16, 2007 at 04:32:49AM +0200, Kay Sievers wrote:
> On 6/16/07, Joel Becker <Joel.Becker@oracle.com> wrote:
> > Why does udev ignore md* and dm-* devices for persistent naming?
> >I was utterly surprised to find that an ext3 on /dev/md0 or /dev/dm-0
> >won't show up in /dev/disk/by-uuid. Given that dm and md devices can
> >change names, isn't this something we'd really like to have?
>
> Sure, they just have their own rules files. Both have specific
> requirements/lifetime-rules and plug into "change" events.
I'm looking at rhel5, debian, and raw udev-105, and I can't find
anywhere in the rules that use vol_id to map md or dm devices to
/dev/disk/by-label and /dev/disk/by-uuid. The vol_id using files
(persistent.rules) skips those devices. I can see why perhaps you'd say
"loop and ramdisk may be garbage", but dm*, md*, and similar are
expected persistent environment things. And their names can certainly
change.
I ask because I am looking at implementing a robust "how to
determine what device is meant by UUID xxxxx". Robust in the face of
catching the raid1 and multipath and so on. So /dev/disk/by-uuid/xxxxx
wouldn't point to /dev/sdd1 if it really should be /dev/md0. I had
hoped udev + vol_id would do this for me, as vol_id seems to have
explicit ordering to make this work right. But the udev rules skip
checking uuids and labels on the aggregate devices.
Please, show me where I'm wrong :-)
Joel
--
"The question of whether computers can think is just like the question
of whether submarines can swim."
- Edsger W. Dijkstra
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
2007-06-16 2:32 ` Kay Sievers
2007-06-16 7:31 ` Joel Becker
@ 2007-06-16 7:49 ` Andrey Borzenkov
2007-06-16 8:46 ` Alexander E. Patrakov
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Andrey Borzenkov @ 2007-06-16 7:49 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 2345 bytes --]
On Saturday 16 June 2007, Joel Becker wrote:
> On Sat, Jun 16, 2007 at 04:32:49AM +0200, Kay Sievers wrote:
> > On 6/16/07, Joel Becker <Joel.Becker@oracle.com> wrote:
> > > Why does udev ignore md* and dm-* devices for persistent naming?
> > >I was utterly surprised to find that an ext3 on /dev/md0 or /dev/dm-0
> > >won't show up in /dev/disk/by-uuid. Given that dm and md devices can
> > >change names, isn't this something we'd really like to have?
> >
> > Sure, they just have their own rules files. Both have specific
> > requirements/lifetime-rules and plug into "change" events.
>
> I'm looking at rhel5, debian, and raw udev-105, and I can't find
> anywhere in the rules that use vol_id to map md or dm devices to
> /dev/disk/by-label and /dev/disk/by-uuid. The vol_id using files
> (persistent.rules) skips those devices. I can see why perhaps you'd say
> "loop and ramdisk may be garbage", but dm*, md*, and similar are
> expected persistent environment things. And their names can certainly
> change.
at least device mapper already has entries under /dev/mapper; I has been using
it for multipathing only so far, and multipath can be configured to create
persistent names there. I presume other device mapper modules can be told to
create persistent names too.
For mdadm you can specify persistent names based on UUID or array name as
well.
I agree that having everything in one place simplifies things.
> I ask because I am looking at implementing a robust "how to
> determine what device is meant by UUID xxxxx". Robust in the face of
> catching the raid1 and multipath and so on.
It depends what in imply by "implementing". It is definitely possible to write
such script; moreover, it is quite possible that blkid already does what you
need:
{pts/0}% sudo blkid -l -t UUID="72973377-c299-4ca6-ae94-2022b7dca58f"
/dev/sda2: UUID="72973377-c299-4ca6-ae94-2022b7dca58f" LABEL="/"
TYPE="reiserfs"
-andrey
> So /dev/disk/by-uuid/xxxxx
> wouldn't point to /dev/sdd1 if it really should be /dev/md0. I had
> hoped udev + vol_id would do this for me, as vol_id seems to have
> explicit ordering to make this work right. But the udev rules skip
> checking uuids and labels on the aggregate devices.
> Please, show me where I'm wrong :-)
>
>
> Joel
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (2 preceding siblings ...)
2007-06-16 7:49 ` Andrey Borzenkov
@ 2007-06-16 8:46 ` Alexander E. Patrakov
2007-06-16 10:40 ` Kay Sievers
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Alexander E. Patrakov @ 2007-06-16 8:46 UTC (permalink / raw)
To: linux-hotplug
Joel Becker wrote:
> Why does udev ignore md* and dm-* devices for persistent naming?
Please see http://lkml.org/lkml/2007/5/14/188 for device-mapper - but note
that the problems are now at least partially fixed.
--
Alexander E. Patrakov
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (3 preceding siblings ...)
2007-06-16 8:46 ` Alexander E. Patrakov
@ 2007-06-16 10:40 ` Kay Sievers
2007-06-16 10:53 ` martin f krafft
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-06-16 10:40 UTC (permalink / raw)
To: linux-hotplug
On Sat, 2007-06-16 at 00:31 -0700, Joel Becker wrote:
> On Sat, Jun 16, 2007 at 04:32:49AM +0200, Kay Sievers wrote:
> > On 6/16/07, Joel Becker <Joel.Becker@oracle.com> wrote:
> > > Why does udev ignore md* and dm-* devices for persistent naming?
> > >I was utterly surprised to find that an ext3 on /dev/md0 or /dev/dm-0
> > >won't show up in /dev/disk/by-uuid. Given that dm and md devices can
> > >change names, isn't this something we'd really like to have?
> >
> > Sure, they just have their own rules files. Both have specific
> > requirements/lifetime-rules and plug into "change" events.
>
> I'm looking at rhel5, debian, and raw udev-105, and I can't find
> anywhere in the rules that use vol_id to map md or dm devices to
> /dev/disk/by-label and /dev/disk/by-uuid. The vol_id using files
> (persistent.rules) skips those devices. I can see why perhaps you'd say
> "loop and ramdisk may be garbage", but dm*, md*, and similar are
> expected persistent environment things. And their names can certainly
> change.
dm: (requires a simple patch to dmsetup)
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-device-mapper.rules;hb=HEAD
md: (requires the latest mdadm)
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-md-raid.rules;hb=HEAD
> I ask because I am looking at implementing a robust "how to
> determine what device is meant by UUID xxxxx". Robust in the face of
> catching the raid1 and multipath and so on. So /dev/disk/by-uuid/xxxxx
> wouldn't point to /dev/sdd1 if it really should be /dev/md0. I had
> hoped udev + vol_id would do this for me, as vol_id seems to have
> explicit ordering to make this work right.
Right, vol_id recognizes md-metadata and doesn't return uuid/label for
raid members.
Udev has priorities for the symlink-stack (multiple devices can claim
the same name, but only one can actually own the symlink), and the
multipath rules for dm-devices specify a higher priority, so that
symlinks requested from the individual paths are overwritten.
> But the udev rules skip
> checking uuids and labels on the aggregate devices.
> Please, show me where I'm wrong :-)
All of that is not in RHEL or Debian at the moment. :)
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (4 preceding siblings ...)
2007-06-16 10:40 ` Kay Sievers
@ 2007-06-16 10:53 ` martin f krafft
2007-06-16 11:02 ` Kay Sievers
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: martin f krafft @ 2007-06-16 10:53 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 895 bytes --]
also sprach Kay Sievers <kay.sievers@vrfy.org> [2007.06.16.1140 +0100]:
> All of that is not in RHEL or Debian at the moment. :)
Please correct me if I'm wrong, but all this patch does is to
provide /dev/disk symlinks, right?
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-md-raid.rules;hb=HEAD
mdadm and udev need better integration and I'd rather not fuzz with
it before I have time to do it right. However, the above is really
tangential, so I see no problem with including it in Debian.
If you can confirm then I shall try to get it in.
--
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
spamtraps: madduck.bogus@madduck.net
"i must get out of these wet clothes and into a dry martini."
-- alexander woolcott
[-- Attachment #1.2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (5 preceding siblings ...)
2007-06-16 10:53 ` martin f krafft
@ 2007-06-16 11:02 ` Kay Sievers
2007-06-16 16:50 ` Dan Nicholson
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-06-16 11:02 UTC (permalink / raw)
To: linux-hotplug
On Sat, 2007-06-16 at 11:53 +0100, martin f krafft wrote:
> also sprach Kay Sievers <kay.sievers@vrfy.org> [2007.06.16.1140 +0100]:
> > All of that is not in RHEL or Debian at the moment. :)
>
> Please correct me if I'm wrong, but all this patch does is to
> provide /dev/disk symlinks, right?
>
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-md-raid.rules;hb=HEAD
>
> mdadm and udev need better integration and I'd rather not fuzz with
> it before I have time to do it right.
Sure, it's the first step in this direction, we are still working on it.
It didn't work at all with older kernels, that's why we skipped the
events for these devices in the past.
> However, the above is really
> tangential, so I see no problem with including it in Debian.
>
> If you can confirm then I shall try to get it in.
Right, it creates stuff in /dev/disk. It hooks into the "change" events
the kernel sends when the devices become online, or tables change. So it
creates the uuid/label links for the contained filesystem data, and some
by-id links to identify the device itself.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (6 preceding siblings ...)
2007-06-16 11:02 ` Kay Sievers
@ 2007-06-16 16:50 ` Dan Nicholson
2007-06-16 17:09 ` Kay Sievers
2007-06-16 18:38 ` Joel Becker
9 siblings, 0 replies; 11+ messages in thread
From: Dan Nicholson @ 2007-06-16 16:50 UTC (permalink / raw)
To: linux-hotplug
On 6/16/07, Kay Sievers <kay.sievers@vrfy.org> wrote:
>
> dm: (requires a simple patch to dmsetup)
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-device-mapper.rules;hb=HEAD
Is this device-mapper-dmsetup-export.patch in the opensuse package?
Any chance to get it upstream?
http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/device-mapper-1.02.19-11.src.rpm
--
Dan
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (7 preceding siblings ...)
2007-06-16 16:50 ` Dan Nicholson
@ 2007-06-16 17:09 ` Kay Sievers
2007-06-16 18:38 ` Joel Becker
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-06-16 17:09 UTC (permalink / raw)
To: linux-hotplug
On Sat, 2007-06-16 at 09:50 -0700, Dan Nicholson wrote:
> On 6/16/07, Kay Sievers <kay.sievers@vrfy.org> wrote:
> >
> > dm: (requires a simple patch to dmsetup)
> > http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-device-mapper.rules;hb=HEAD
>
> Is this device-mapper-dmsetup-export.patch in the opensuse package?
Yes, it is.
> Any chance to get it upstream?
>
> http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/device-mapper-1.02.19-11.src.rpm
Sure, I'll send it upstream after we are sure it works as expected. It's
currently tested in openSUSE and Ubuntu.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: udev and md/dm
2007-06-16 0:20 udev and md/dm Joel Becker
` (8 preceding siblings ...)
2007-06-16 17:09 ` Kay Sievers
@ 2007-06-16 18:38 ` Joel Becker
9 siblings, 0 replies; 11+ messages in thread
From: Joel Becker @ 2007-06-16 18:38 UTC (permalink / raw)
To: linux-hotplug
On Sat, Jun 16, 2007 at 12:40:08PM +0200, Kay Sievers wrote:
> dm: (requires a simple patch to dmsetup)
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-device-mapper.rules;hb=HEAD
>
>
> md: (requires the latest mdadm)
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=etc/udev/suse/64-md-raid.rules;hb=HEAD
Ok, so it's coming. But for now, I'll have to implement my own
thing, as existing distros (which I need to support) won't ever have
this.
Thanks!
Joel
--
"All alone at the end of the evening
When the bright lights have faded to blue.
I was thinking about a woman who had loved me
And I never knew"
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread