Debian Bug report logs - #566965
lvm2 initscript breaks most "advanced" setups (e.g.

version graph

Package: lvm2; Maintainer for lvm2 is Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>; Source for lvm2 is src:lvm2.

Reported by: martin f krafft <madduck@debian.org>

Date: Tue, 26 Jan 2010 07:45:01 UTC

Severity: normal

Found in version lvm2/2.02.54-1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Tue, 26 Jan 2010 07:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin f krafft <madduck@debian.org>:
New Bug report received and forwarded. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Tue, 26 Jan 2010 07:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: martin f krafft <madduck@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: No way to boot using UUIDs
Date: Tue, 26 Jan 2010 20:37:49 +1300
[Message part 1 (text/plain, inline)]
Package: lvm2
Version: 2.02.54-1
Severity: normal

The lvm2 initramfs scripts insist on the root= argument to the
kernel following certain patterns. Specifically, if the device is
not (fe[0-9]*|/dev/root|/dev/mapper/*) then the script will exit
without running vgchange. This makes it impossible to specify the
root device using either the UUID=* or /dev/disk/by-uuid/* notation.

Unless there are good reasons why not, I would suggest to just run
vgchange -ay unconditionally. lvm already (unfortunately) comes with
quite a bit of wizardry in terms of autodetection and trying to do
the right thing and adding shell script logic around it just seems
like creating more trouble.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-trunk-686 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lvm2 depends on:
ii  dmsetup                      2:1.02.39-1 The Linux Kernel Device Mapper use
ii  libc6                        2.10.2-5    Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1           2:1.02.39-1 The Linux Kernel Device Mapper use
ii  libreadline5                 5.2-7       GNU readline and history libraries
ii  lsb-base                     3.2-23      Linux Standard Base 3.2 init scrip

lvm2 recommends no packages.

lvm2 suggests no packages.

-- no debconf information

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Added indication that 566965 affects mdadm Request was from martin f. krafft <madduck@debian.org> to control@bugs.debian.org. (Wed, 27 Jan 2010 01:21:10 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Thu, 24 Jun 2010 12:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <christoph.anton.mitterer@physik.uni-muenchen.de>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Thu, 24 Jun 2010 12:27:03 GMT) Full text and rfc822 format available.

Message #12 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <christoph.anton.mitterer@physik.uni-muenchen.de>
To: 566965@bugs.debian.org
Subject: can we close this?
Date: Thu, 24 Jun 2010 14:23:06 +0200
Hi Pierre.

Is the last problem you're reported still an issue?
AFAIK, there is not even a "libdevmapper1.02" init script anymore.

Can we close it?


Cheers,
Chris.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Thu, 24 Jun 2010 13:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <christoph.anton.mitterer@physik.uni-muenchen.de>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Thu, 24 Jun 2010 13:24:05 GMT) Full text and rfc822 format available.

Message #17 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <christoph.anton.mitterer@physik.uni-muenchen.de>
To: 565676@bugs.debian.org, 566965@bugs.debian.org
Subject: merging?
Date: Thu, 24 Jun 2010 15:21:08 +0200
[Message part 1 (text/plain, inline)]
Hi Martin.

Are those issues the same (which I guess)? Can I merge them?

Why does it affect mdadm?



Cheers,
Chris.
[smime.p7s (application/x-pkcs7-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sat, 26 Jun 2010 16:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo@scientia.net>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sat, 26 Jun 2010 16:54:03 GMT) Full text and rfc822 format available.

Message #22 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo@scientia.net>
To: 566965@bugs.debian.org
Subject: wrong message to the wrong bug-#
Date: Sat, 26 Jun 2010 18:51:23 +0200
Sorry,.. message #12
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566965#12) here,..
went to the wrong bug-id

Cheers,
Chris.





Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sat, 26 Jun 2010 17:12:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo@scientia.net>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sat, 26 Jun 2010 17:12:04 GMT) Full text and rfc822 format available.

Message #27 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo@scientia.net>
To: 566965@bugs.debian.org
Subject: Re: No way to boot using UUIDs
Date: Sat, 26 Jun 2010 19:08:19 +0200
Hi.

Regarding the bug itself.

It seems that the initramfs-script simply misuses the root= kernel
parameter.

AFAIK, the device specified at root= is simply the "finalised" device
where the root-filesystem itself is found.
So e.g. /dev/sda1 if it's directly on it,.. or /dev/vg00/lv00 if it's
directly on lv00,...


I think lvm2 should do the following (at least regarding
initramfs-images):
- The hook script should check, whether the root-fs as specified in
fstab is directly or indirectly on an LV (guess it's quite complex to
really find that out).
If so,.. it includes /sbin/lvm

- The boot script, should first check if /sbin/lvm is there,... and if
so, unconditionally to lvm vgchange -an


I guess the init-script should still scan, as further devices may have
appeared.


Cheers,
Chris.





Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sun, 26 Sep 2010 13:09:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo@scientia.net>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sun, 26 Sep 2010 13:09:04 GMT) Full text and rfc822 format available.

Message #32 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo@scientia.net>
To: 565676@bugs.debian.org, 566965@bugs.debian.org
Cc: control@bugs.debian.org, martin f krafft <madduck@debian.org>, cheako911@yahoo.com
Subject: merging them
Date: Sun, 26 Sep 2010 15:06:03 +0200
[Message part 1 (text/plain, inline)]
merge 565676 566965
stop

Hi.

It seems those two bugs are identical. Please unmerge if you thing
they're not.

May I suggest to continue discussion at #566965.


Cheers,
Chris.
[smime.p7s (application/x-pkcs7-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sun, 26 Sep 2010 13:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo@scientia.net>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sun, 26 Sep 2010 13:54:03 GMT) Full text and rfc822 format available.

Message #37 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo@scientia.net>
To: 566965@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: lvm2 initscript breaks most "advanced" setups (e.g. stacked block devices) or booting via UUID/LABEL
Date: Sun, 26 Sep 2010 15:50:25 +0200
[Message part 1 (text/plain, inline)]
retitle 566965 lvm2 initscript breaks most "advanced" setups (e.g.
stacked block devices) or booting via UUID/LABEL
severity 566965 important
stop

Hi.

I've changed the title and increased the severity as this breaks so many
setups.


Bastian, could you please _strongly_ reconsider to correct the initramfs
boot-script.

1) The current implementation seems to expect $ROOT (which is the root=
kernel command line parameter) to be the final LVM logical volume.

This is AFAIU a misconception of it. As $ROOT is the final device
containting the root-filesystem.

This must not necessarily be an LV, just imagine setups like:
physical disk -> MD -> LV -> dm-crypt/LUKS -> ext4-root-fs


2) As it expects some rather fixed device pathnames.
This in addition breaks using things like UUID/LABEL, even if there are
no stacked block devices.


I've also seen several other classes of setups which are broken by this.



IMHO it would be fully ok, to just let the lvm2 initramfs script scan
for any VGs and activate _all_ of them.
- This should have no worse performance as lvm will have to scan all PVs
anyway.
- It should do no harm to activate VGs/LVs that are not yet required
(just to mount the root-fs).


I'd also say that it's nearly impossible to make a script which
automatically detects only those VGs/LVs that are required for the
root-filesystem, especially when you consider multiple stacked
blockdevices (see also
http://wiki.debian.org/AdvancedStartupShutdownWithMultilayeredBlockDevices)


My suggestion for now would be a strongly simplified lvm2 script as
attached.

Would be nice if this could find it's way in unstable soon :)


Cheers,
Chris.
[lvm2 (application/x-shellscript, attachment)]
[smime.p7s (application/x-pkcs7-signature, attachment)]

Changed Bug title to 'lvm2 initscript breaks most "advanced" setups (e.g.' from 'No way to boot using UUIDs' Request was from Christoph Anton Mitterer <calestyo@scientia.net> to control@bugs.debian.org. (Sun, 26 Sep 2010 13:54:05 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from Christoph Anton Mitterer <calestyo@scientia.net> to control@bugs.debian.org. (Sun, 26 Sep 2010 13:54:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sun, 26 Sep 2010 15:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sun, 26 Sep 2010 15:39:03 GMT) Full text and rfc822 format available.

Message #46 received at 566965@bugs.debian.org (full text, mbox):

From: Bastian Blank <waldi@debian.org>
To: Christoph Anton Mitterer <calestyo@scientia.net>, 566965@bugs.debian.org
Subject: Re: Bug#566965: lvm2 initscript breaks most "advanced" setups (e.g. stacked block devices) or booting via UUID/LABEL
Date: Sun, 26 Sep 2010 17:34:57 +0200
severity 566965 normal
thanks

On Sun, Sep 26, 2010 at 03:50:25PM +0200, Christoph Anton Mitterer wrote:
> I've changed the title and increased the severity as this breaks so many
> setups.

Please explain.

> Bastian, could you please _strongly_ reconsider to correct the initramfs
> boot-script.

There is no correct one. Please be more specific.

> This is AFAIU a misconception of it. As $ROOT is the final device
> containting the root-filesystem.
> This must not necessarily be an LV, just imagine setups like:
> physical disk -> MD -> LV -> dm-crypt/LUKS -> ext4-root-fs

You need more information in this case. Please provide patches to supply
all the necessary information to the initramfs. However you are not
allowed to enable everything it gets the hand on.

> 2) As it expects some rather fixed device pathnames.
> This in addition breaks using things like UUID/LABEL, even if there are
> no stacked block devices.

The device name is already unique. More then UUID or LABEL, lvm support
snapshots.

Bastian

-- 
Earth -- mother of the most beautiful women in the universe.
		-- Apollo, "Who Mourns for Adonais?" stardate 3468.1




Severity set to 'normal' from 'important' Request was from Bastian Blank <waldi@debian.org> to control@bugs.debian.org. (Sun, 26 Sep 2010 15:39:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#566965; Package lvm2. (Sun, 26 Sep 2010 16:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo@scientia.net>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. (Sun, 26 Sep 2010 16:03:03 GMT) Full text and rfc822 format available.

Message #53 received at 566965@bugs.debian.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo@scientia.net>
To: Bastian Blank <waldi@debian.org>
Cc: 566965@bugs.debian.org
Subject: Re: Bug#566965: lvm2 initscript breaks most "advanced" setups (e.g. stacked block devices) or booting via UUID/LABEL
Date: Sun, 26 Sep 2010 17:59:19 +0200
[Message part 1 (text/plain, inline)]
I think reducing the severity is inappropriate, as this clearly breaks
several configurations from booting.


On Sun, 2010-09-26 at 17:34 +0200, Bastian Blank wrote:
> > I've changed the title and increased the severity as this breaks so many
> > setups.
> Please explain.
See what I've written in my previous email, all setups where lvm is used
with stacked block layers.


> > Bastian, could you please _strongly_ reconsider to correct the initramfs
> > boot-script.
> There is no correct one. Please be more specific.
Maybe, but simply scanning for VGs and making them _all_ available is
what guarantees the best results.
That's also how the whole idea behind the scanning/make-available system
of LVM is.


> > This is AFAIU a misconception of it. As $ROOT is the final device
> > containting the root-filesystem.
> > This must not necessarily be an LV, just imagine setups like:
> > physical disk -> MD -> LV -> dm-crypt/LUKS -> ext4-root-fs
> You need more information in this case. Please provide patches to supply
> all the necessary information to the initramfs. However you are not
> allowed to enable everything it gets the hand on.
Why not? As I've said it does not harm, not even performance wise.

I mean I think only stuff should be included in initramfs images, if
necessary (to keep them small), but that's a totally different thing and
not done by many packages (including lvm2, which simply always adds
stuff to the initramfs regardless of whether the root fs or resume
devices are on LVM or not.


I doubt that it's a good idea at the moment to provide patches that find
out which LV and VG are used for the root-fs and resume devices.
This is (see the wiki link I've mentioned before) very complicated, and
I think it would be better to provide once a overall solution, which is
not only for lvm but also for all the other kinds of block layers.

I mean it's rather complex to find out which VG/LV are actually
required, they don't have to be directly below the root-fs. Therefore
it's not just possible to get this via some simple /etc/fstab grep-ing.


Again, I also prefer to do only the least necessary things in the
initrd, but as I've laid out on that wiki page, that's far too
complicated at the moment, especially as long as all other maintainers
(cryptsetup, mdadm, multiplath, etc. etc.) don't participate.

So for now, simply making all VGs/LVs available (of course not yet
mounting them or so) seems the best solution to me.

Anyway, using $ROOT in lvm2 seems to be definitely wrong. Even with some
heuristic that finds out which VG/LVs are needed for root-fs/resume
devices, this would then need to go into some config-file in the inird
(as e.g. cryptsetup does it).


> > 2) As it expects some rather fixed device pathnames.
> > This in addition breaks using things like UUID/LABEL, even if there are
> > no stacked block devices.
> 
> The device name is already unique. More then UUID or LABEL, lvm support
> snapshots.
What do you mean? Of course it's unique, but people nevertheless might
want to use UUID/LABE instead of the dm device name.


Another some harm of the current way seems to be, that lvm2 initramfs
scripts get troubles when e.g. lvm is not used at all (but installed)
and the root-fs uses a LABEL of the style "foo-bar", which is totally
legal.




Best wishes,
Chris.

btw: It seems that 2.02.74 of lvm2 is out,...
There are many many improvements since the current debian version, which
would cure quite a few problems.
Can you perhaps make any forecasts on when we'll see this (at least in
experimental)? :-)
[smime.p7s (application/x-pkcs7-signature, attachment)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 10:44:00 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.