#918681 lvm2: initramfs-tools hook scripts don't properly setup lvmraid system at boot

Package:
lvm2
Source:
lvm2
Description:
Linux Logical Volume Manager
Submitter:
Paul Wise
Date:
2023-03-19 06:12:03 UTC
Severity:
wishlist
#918681#5
Date:
2019-01-08 10:43:30 UTC
From:
To:
As a way to migrate away from a possibly failing disk in a single-disk
system without md RAID, I've moved the disk to another system, plugged
in a second disk and added that disk as a lvm raid1 mirror, converting
my system to lvmraid. Consequently I've noticed that on boot, one of
the disks is not attached to the LVs and so I have to refresh each LV
with `lvchange --refresh` and the system then syncs the LVs to the
additional drive. The sync process is quick due to the lvmraid write
bitmaps and low amount of disk writes during boot but it is annoying to
have to run the sync manually on every boot. In case it changes
anything, both of the PVs are on top of individual encrypted LUKS
volumes. I'm not sure how to change the initramfs scripts but maybe the
lvmraid(7) manual page or the RedHat LVM RAID guide will help:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/raid_volumes

#918681#10
Date:
2023-03-19 06:01:14 UTC
From:
To:
Hey Paul and LVM team:

I faced this issue and manage to write a initramfs-tool boot script to
fix this.

Put the enclosure script in `/etc/initramfs-tools/scripts/local-top` and
run `update-initramfs -k all -u`, the initramfs boot stage will run this
script and wait for the root device becoming `complete` status. If it
does not complete in 2 minutes, it will stop waiting and continue boot.

To write or debug the initramfs script, the `initramfs-tools(7)` would
be helpful.

As my realization, to fix this issue in lvm2 package, we should make
`/usr/share/initramfs-tools/scripts/local-top/lvm2` check the status of
the activated LV. Please tell me if I can help to merge my script into
the existing lvm2 initramfs script.

I am new to debian community. This is the first time I write a
initramfs-script, though I am already experienced in normal  shell script.

I also asked and answered this issue on stack-exchange community; it may
be helpful if you want to know more details:
tabopen
https://superuser.com/questions/1773241/raid-1-lv-partially-up-and-unable-to-repair-the-down-rimage-is-missing

May the source be with you

#918681#15
Date:
2023-03-19 06:08:41 UTC
From:
To:
Sorry, a bug in script about prereq

gold holk 於 2023/3/19 14:01 寫道:
-- 
linux user, amateur web developer, geomatics major.
blog: http://gholk.github.io