[blfs-dev] LVM2 bootscript

Bruce Dubbs bruce.dubbs at gmail.com
Tue Feb 14 16:08:18 PST 2012

Qrux wrote:
> On Feb 13, 2012, at 7:07 PM, Bruce Dubbs wrote:
>> Qrux wrote:
>>> LVM2 should have a bootscript and a link in /etc/rc.d/rcS.d; if
>>> that hasn't been done yet, feel free to include the one I use
>>> (which I've kept in the LFS/BLFS template).
>> Thanks for that.
> Happy to help.
>>> The meat of it is doing:
>>> vgscan --mknodes vgchange -a y
>>> to create the DM entries and then to make each of the discovered 
>>> volumes "available".
>> Are you sure that's needed?  I was doing some experimentation with
>> a non-rootfs lvm scan and it seemed to be persistent.
> The vgscan is probably not strictly necessary; I think the kernel is
> able to see any DM devices now on startup (I forget if I set this in
> my kconfig).
> Empirically, the vgchange is necessary; otherwise, the physical
> volume and volume groups are seen, but the logical volumes are set to
> "LV Status: Unavailable".
> At least that was the case for me; if it's being auto-detected for
> you, could you send me your kernel config?  Obviously that's
> preferable...

I validated your comments.  I also need to run 'vgchange -a y'

What do you think of adding a line to the start of the start code of 

if [ -x /usr/sbin/vgchange ]; then
   /usr/sbin/vgchange -a y >/dev/null

I think it needs to go in checkfs so the scripts have a chance to run 
fsck on the logical volume.  This is basically what you have in the lvm2 
script, but without all the overhead of another script.

We could also put in some bootscript log messages, but I'm not sure 
that's necessary.

   -- Bruce

More information about the blfs-dev mailing list