#769702 lvm2: Initscripts cause non bootable system with btrfs root spanned onto lvm

Package:
lvm2
Source:
lvm2
Description:
Linux Logical Volume Manager
Submitter:
Roger Gammans
Date:
2014-11-15 23:42:05 UTC
Severity:
important
#769702#5
Date:
2014-11-15 16:37:16 UTC
From:
To:
Dear Maintainer,

When using a btfrs for the root if without the first device being on
lvm, but with other devices used in the file system whichi are on lvm
then the initscript decicded not to make the vg availble .
Since in thise case all the devices which make up the root filesystem
are not availabel it cannot be mounted rendering the system unbootable.

I have looked at the existing bugs filed against ths package such
as  #566965 , an it looks like failure to make VG available is
common in a number of disparate circumstances.

Can I suggest a cmdline argument is added (tested for) to force
this to occurs so it can be easily fixed / forced by the user.

Having to manually edit you initrd scripts for a specicifc filesystem
layout is mor complicated than (IMHO) it should be. Adding a
simpl way of forcing this allow the complicated setups to work
with minimal impact on the simpler ones.

This patch is an example of what I suggest.
--- /usr/share/initramfs-tools/scripts/local-top/lvm2	2009-08-17 18:28:09.000000000 +0100
+++ lvm2	2014-11-15 16:21:22.646647766 +0000
@@ -60,7 +60,11 @@

 modprobe -q dm-mod

#769702#10
Date:
2014-11-15 18:13:51 UTC
From:
To:
Control: severity -1 important
Control: tags -1 moreinfo

No, it breaks only itself.

Please describe your setup.  Either the device is on lvm or it is not.
We don't support setups where multiple different devices for root are
enabled.

Bastian

#769702#19
Date:
2014-11-15 23:18:59 UTC
From:
To:
It renders the root filing system unmountable, admitted given a specific
maybe rare configuration. I'd say that makes that specific system (ie
host/ debian instance) unusable.
Root is btrfs.

btrfs fi show is:-
# btrfs fi show
failed to read /dev/sr0
Label: none  uuid: e830647d-84e0-447c-aae7-c63b6b4d1603
        Total devices 2 FS bytes used 132.12GB
        devid    2 size 125.00GB used 98.00GB path /dev/dm-0
        devid    1 size 83.00GB used 69.03GB path /dev/sda1

Btrfs Btrfs v0.19

Boot via grub, kernel cmdline is:- "root=UUID=e830647d-84e0-447c-aae7-c63b6b4d1603 ro quiet "
# pvs
File descriptor 3 (pipe:[10067]) leaked on pvs invocation. Parent PID 3852: -bash
lvd  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda3  vg01 lvm2 a--  165.89g 40.89g
# lvs
File descriptor 3 (pipe:[10067]) leaked on lvs invocation. Parent PID 3852: -bash
  LV   VG   Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  root vg01 -wi-ao-- 125.00g



Is there any other information you need ?

That's true for device but not a filesystem. A filesystem can span
multiple devices.

Do you mean a root fs which spans devices, or something else  , and is
"we" debian as a whole, or specifically debian-lvm - I'm not sure what
exactly is not supported , and what user-documentation I would have read
to find out.

I probably won't have used lvm given I had BTRFS, but out of force of
habit  I started by setting up LVM and and got myself mentally tied into
that route. But if this is not supported then something perhaps
btfrs-tools should have emitted a warning, when I tried to add a device
to the root fs.  In hindsight I should have just added sda3 to the root
partition, but it's done now.

I still think the patch (or something similar) I attached creates
minimal problems an solves other issues. Otherwise those of us in this
situation (and similar ) need to manually patch initscripts, which I
would worry about be overwritten by an upgrade . Where as the patch
allows specifying a extra parameter at boot time - to use alternate
behaviour also asked for on other tickets.. This patch just makes thing
less fragile - which is surely a good thing - I can understand you not
wanting to probe for my setup it is an odd one.  But there is a
difference between fully supporting and deliberately making things
difficult.