My LVs in the only volume group I have are marked as "inactive" (vgscan) or "NOT available" (lvdisplay) respectively after machine restart.

vgchange -an makes them active / available, however needs to be called manually after every reboot.

My root filesystem or anything system/OS related is stored on MBR partitions, not involving LVM. Though it might be worth mentioning it's all -- OS related partitions and LVM-VG partition -- on the same physical device (/dev/sda).

This is a minimal Debian/buster system, freshly set up via debootstrap, very unlikely to involve config file changes applied manually. But potentially missing something due to not being installed via an ISO / disk image involving the installer.

Question: What's supposed to be the correct way of making LVs of certain and/or all VGs available at startup?

Answers I'm not satisfied with, yet being marked as accepted answers to quite a number of similar questions around here:

"Put vgchange -ay into /etc/rc.local (or wherever)."

This is mainly due to another system I maintain, also having its system/boot/OS related data on only MBR partitions (no LVM) involved, does boot with VGs/LVs being active (them, though, being on an externally attached USB drive). But also it feels like just mitigating the root cause of the issue.

Looking around I found:

  • /etc/init.d/lvm2 which looks like exactly doing the right thing: calling /sbin/lvm vgchange -aay --sysinit at boot. However the relevant part of the script never gets executed. Execution stops very early when sourcing /lib/lsb/init-functions. I assume this being a legacy SysV script which purposely gets ignored in favour of systemd service files.
  • /usr/share/initramfs-tools/scripts/local-top/lvm2 which gets executed during early boot as part of booting via initramfs. However here VG/LV activation only happens when the root filesystem is located on an LV, which in my case isn't the case, hence no activation here either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.