#1051049 lvm2: fails to boot on mirrored+snapshoted roofs

Package:
lvm2
Source:
lvm2
Description:
Linux Logical Volume Manager
Submitter:
Yoann Congal
Date:
2023-09-04 13:54:05 UTC
Severity:
normal
#1051049#5
Date:
2023-09-01 15:57:04 UTC
From:
To:
Dear Maintainer,

* What led up to the situation?

My system has a mirrored rootfs LV. When snapshoting and merging this
snapshot, the system refuses to boot.

* What exactly did you do (or not do) that was effective (or ineffective)?

My rootfs is vg1/root (mirrored using raid1)

To simulate a snapshot, I do:
  lvcreate -s -n root-snap -L 100MB /dev/vg1/root

Simulation of modification :
  dd if=/dev/urandom of=/test bs=1M count=40

Merging snapshot :
  lvconvert --merge vg1/root-snap

Since rootfs is mounted, the following message is displayed:
  Delaying merge since origin is open.
  Merging of snapshot vg1/root-snap will occur on next activation of vg1/root.

  reboot

   * What was the outcome of this action?

Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
.../...
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/mapper/vg1-root does not exist.  Dropping to a shell!


BusyBox v1.35.0 (Debian 1:1.35.0-4+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

Notice that que root LV is not activated :

(initramfs) lvm lvs
  LV      VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root    vg1     Owi---r---   3.71g
   * What outcome did you expect instead?
root LV is activated during boot and while system boots.

#1051049#10
Date:
2023-09-04 13:52:22 UTC
From:
To:
Hi,

The patch proposed in #1018730 [1] also resolves this bug.

Maybe something about merging LV being seen as incomplete by LVM and, thus, needs the "degraded" flag?

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018730#26