All of lore.kernel.org
 help / color / mirror / Atom feed
* Changes in device-mapper and LVM2 that can affect grub's functionality
@ 2009-09-09 10:01 Peter Rajnoha
  2009-09-09 10:26 ` Felix Zielcke
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rajnoha @ 2009-09-09 10:01 UTC (permalink / raw)
  To: grub-devel; +Cc: Alasdair G Kergon, Milan Broz

Hi,

(I'm speaking for the LVM/DM team)

we have integrated official udev support for device-mapper/LVM
devices lately which is now part of upstream LVM release (however
it's still turned off in default configuration). This includes
our own udev rules responsible for creating /dev nodes and
associated symlinks.

After discussing this with the udev team, we decided to create
DM nodes directly in /dev (with the kernel name of that particular
DM device, which is "dm-X", X being a number for now). The /dev/mapper
contains symlinks to these nodes then. This seems to be a standard
solution from udev point of view which is considered to be correct.
We would like to comply with this standard.

As for the LVM subsystem, the symlinks stay like in the old non-udev
approach -- /dev/VG_NAME subdir containing symlinks with LV names that
point to appropriate DM devices. The change here is only in their
target -- they point to /dev/dm-X devices now, not /dev/mapper ones.

However, we have to consider that not all configurations will have
this udev support turned on, therefore we still keep the old code
responsible for direct creation of the nodes/symlinks (this feature
can be turned on/off by particular configuration option).

Also, if we detect that udev daemon is not running or node/symlink
creation has failed for any reason, we fallback to the old way
of node/symlink creation.

To sum it up briefly, this means we have two layouts that should
be supported:

1. old layout -- nodes /dev/mapper/DM_NAME,
                 symlinks /dev/VG_NAME/LV_NAME

2. new (udev) layout -- nodes /dev/dm-X,
                        symlinks /dev/mapper/DM_NAME
                        symlinks /dev/VG_NAME/LV_NAME



Such layout breaks grub-probe because of the symlinks used afaik
(particularly "find_root_device" function that is used in this
situation).

My question is if supporting this would be a problem from grub's
point of view and if appropriate corrections could be made.

Also, I've spotted that you use some hardcodings in your code,
particularly when filtering out /dev/dm-[0-9] devices
(e.g. in "find_root_device" fn). The thing is that this number
part of the DM name could be changed in the future, so such
assumptions should not be made as well.

I'd like to open a discussion here and any comments are welcome
so finally we could end up with a working solution.

Thanks,

Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Changes in device-mapper and LVM2 that can affect grub's functionality
  2009-09-09 10:01 Changes in device-mapper and LVM2 that can affect grub's functionality Peter Rajnoha
@ 2009-09-09 10:26 ` Felix Zielcke
  2009-09-09 12:01   ` Peter Rajnoha
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Zielcke @ 2009-09-09 10:26 UTC (permalink / raw)
  To: The development of GRUB 2

Am Mittwoch, den 09.09.2009, 12:01 +0200 schrieb Peter Rajnoha:
> Hi,
> 
> (I'm speaking for the LVM/DM team)
> 
> we have integrated official udev support for device-mapper/LVM
> devices lately which is now part of upstream LVM release (however
> it's still turned off in default configuration). This includes
> our own udev rules responsible for creating /dev nodes and
> associated symlinks.
> 
> After discussing this with the udev team, we decided to create
> DM nodes directly in /dev (with the kernel name of that particular
> DM device, which is "dm-X", X being a number for now). The /dev/mapper
> contains symlinks to these nodes then. This seems to be a standard
> solution from udev point of view which is considered to be correct.
> We would like to comply with this standard.
> 
> As for the LVM subsystem, the symlinks stay like in the old non-udev
> approach -- /dev/VG_NAME subdir containing symlinks with LV names that
> point to appropriate DM devices. The change here is only in their
> target -- they point to /dev/dm-X devices now, not /dev/mapper ones.
> 
> However, we have to consider that not all configurations will have
> this udev support turned on, therefore we still keep the old code
> responsible for direct creation of the nodes/symlinks (this feature
> can be turned on/off by particular configuration option).
> 
> Also, if we detect that udev daemon is not running or node/symlink
> creation has failed for any reason, we fallback to the old way
> of node/symlink creation.
> 
> To sum it up briefly, this means we have two layouts that should
> be supported:
> 
> 1. old layout -- nodes /dev/mapper/DM_NAME,
>                  symlinks /dev/VG_NAME/LV_NAME
> 
> 2. new (udev) layout -- nodes /dev/dm-X,
>                         symlinks /dev/mapper/DM_NAME
>                         symlinks /dev/VG_NAME/LV_NAME
> 
> 
> 
> Such layout breaks grub-probe because of the symlinks used afaik
> (particularly "find_root_device" function that is used in this
> situation).
> 
> My question is if supporting this would be a problem from grub's
> point of view and if appropriate corrections could be made.
> 
> Also, I've spotted that you use some hardcodings in your code,
> particularly when filtering out /dev/dm-[0-9] devices
> (e.g. in "find_root_device" fn). The thing is that this number
> part of the DM name could be changed in the future, so such
> assumptions should not be made as well.
> 
> I'd like to open a discussion here and any comments are welcome
> so finally we could end up with a working solution.
> 

What's the point in having the /dev/dm-X devices at all?
Does anything use them?

Currently all symlinks are ignored.
If we use the target of the /dev/mapper/* symlinks, i.e. a /dev/dm-X
device this would at least with the default Debian initrd not work and I
doubt the responding persons for this will change this ever. Even
root=UUID= isn't working for LVM devices, because only the root LV is
activated and not all inside the initrd.

If we would use the symlink itself for root= it could break if there
were symlinks which aren't inside the initrd too.

I personally don't like this change at all.
Why not just remove the dm-X devices and make the /dev/mapper/ ones the
only and real ones?
Maybe the udev maintainers just prefer cryptic numbers for every real
device and only accept symlinks for descriptive ones.


-- 
Felix Zielcke
Proud Debian Maintainer




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Changes in device-mapper and LVM2 that can affect grub's functionality
  2009-09-09 10:26 ` Felix Zielcke
@ 2009-09-09 12:01   ` Peter Rajnoha
  2009-10-12 12:19     ` Felix Zielcke
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rajnoha @ 2009-09-09 12:01 UTC (permalink / raw)
  To: The development of GRUB 2

On 09/09/2009 12:26 PM, Felix Zielcke wrote:
> What's the point in having the /dev/dm-X devices at all?
> Does anything use them?

...nothing uses them and nothing ever should! These names are not
stable (the number depends on the activation sequence of those
devices). Not usable for anything, really, just to keep udev guys
happy :)

Actually, we wanted to abandon these nodes first, so they would never
be visible under /dev. And keep the old way instead.

But when we discussed this with Kay Sievers from udev:

"In general we do not want any unneeded disconnect from kernel names
and /dev names, and dm block devices should stay as /dev/dm-* device
nodes."

"Please do not rename kernel devices, they should match the kernel
names. Only create SYMLINK+= to the kernel names..."

"Sure, but there is still not enough reason to be different from the
kernel name. You support rename, that should never happen, that a device
node needs to be renamed, if the kernel does not change the device name."

"Sounds fine, as long as the /dev names match the kernel devices."

"There is the rule, that kernel block device names and /dev names match,
and the kernel log shows device names which translate directly to the
primary device nodes. DM is not an exception here, all block device
behave like that , and we like to continue that, and not make needless
rules just to be special here."

...and so on and on...

(the whole discussion is at http://markmail.org/message/bj4zkjo2peeocnhq)

> Currently all symlinks are ignored.
> If we use the target of the /dev/mapper/* symlinks, i.e. a /dev/dm-X
> device this would at least with the default Debian initrd not work and I
> doubt the responding persons for this will change this ever. Even
> root=UUID= isn't working for LVM devices, because only the root LV is
> activated and not all inside the initrd.
> 
> If we would use the symlink itself for root= it could break if there
> were symlinks which aren't inside the initrd too.
> 
> I personally don't like this change at all.
> Why not just remove the dm-X devices and make the /dev/mapper/ ones the
> only and real ones?

...we would like to, but...

> Maybe the udev maintainers just prefer cryptic numbers for every real
> device and only accept symlinks for descriptive ones.

Yes, that's the case.

OK, I'll try to talk with Kay again and discuss all the problems that
this "udev law" brings in real-life situations for dm devices and
everything using it.

I just needed your opinion, too, thanks! So maybe we have one more
argument against such layout for udev guys...

Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Changes in device-mapper and LVM2 that can affect grub's functionality
  2009-09-09 12:01   ` Peter Rajnoha
@ 2009-10-12 12:19     ` Felix Zielcke
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Zielcke @ 2009-10-12 12:19 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: Peter Rajnoha

CCing you cause I'm not sure if you're still subscribed.

Am Mittwoch, den 09.09.2009, 14:01 +0200 schrieb Peter Rajnoha:
> 
> OK, I'll try to talk with Kay again and discuss all the problems that
> this "udev law" brings in real-life situations for dm devices and
> everything using it.
> 
> I just needed your opinion, too, thanks! So maybe we have one more
> argument against such layout for udev guys... 

Did you had any luck?
We just got a bug report now from the Debian lvm2 maintainer who wants
to remove his change he made for us and make the LVM devices the
upstream way.


-- 
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-12 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 10:01 Changes in device-mapper and LVM2 that can affect grub's functionality Peter Rajnoha
2009-09-09 10:26 ` Felix Zielcke
2009-09-09 12:01   ` Peter Rajnoha
2009-10-12 12:19     ` Felix Zielcke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.