1

I have used Buildroot to create a system that runs in RAM on my ARMv5 Kirkwood SoC -based NAS-box. I use BusyBox as my init system, and /dev management is done using devtmpfs only. I've selected LVM2 & device mapper -target package, with standard install instead of only dmsetup. I configured the Linux kernel to have multiple devices driver support with device mapper support. System boots up without any problems, but logical volumes are inactive. If I execute vgchange -ay they are activated and can be mounted.

My question is, what is the proper way of automatically activating volumes during boot? Is there some configuration option for that? Or do I really need to execute vgchange -ay at some point during boot (e.g. /etc/inittab)? Some sources seem to suggest that VGs/LVs are usually automatically activated on boot, but I'm unsure if they are just referring to implementations of initialization process on popular distributions.

  • As far as I know the initrd creation script on most popular distributions does the VG activation when there is an LVM root device. – Didi Kohen Apr 8 '15 at 15:27
1

Yes, something has to run the LVM utility (as you say, vgchange -a y or similar) at some point. There is no magic that makes the kernel figure that one out by itself.

In Initramfs this is usually done by the /init script (directly or indirectly). Some systems also scan for VG/LV whenever udev gets told of a new disk, but with devtmpfs you don't have that option either.

So yes sure, just make an init script for LVM and have your init system execute it somehow.

  • Ok... At first that seemed like unnecessarily complicated, but now when I look at it again, I guess it's just as simple as is practical. Thanks for your answer! – montiainen Apr 8 '15 at 15:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.