valgonzalez
Posts: 3
Joined: Thu Feb 05, 2015 12:52 am

Raspberry pi +: Don't mount lvm logical volumes at boot

Sun Feb 22, 2015 1:49 am

Hello,

I have a rpi b+ with some lvm volumes configured. OS Raspbian. At boot time, the system cannot mount the logical volumes. It don't recognise the volume group. When i verify the lvm status (sudo lvscan), i see that all logical volumes are not activated. After that, I change the lvm status with vgcange -ay, then i get the logical volumes activated again. After that i can boot the system and mount the logical volumes. The problem is if i reboot the system, i get the logical volumes inactive again. Can you help me with this issue?

davidearl
Posts: 2
Joined: Sun Mar 09, 2014 12:22 pm

Re: Raspberry pi +: Don't mount lvm logical volumes at boot

Thu Feb 26, 2015 3:52 pm

I've just been trying to do the same thing and found the same problem. Googling suggests this is common on many different Linuxes. I've adopted a workround suggested in one post I found[1] to do
/sbin/vgscan
/sbin/vgchange -a y
in /etc/init.d/checkfs.sh, that is at the point where it would normally do fsck's on boot if required before mounting, it activates the volume groups. This seems to work for me. I did the following near the end of the file, though I wasn't completely confident about whether it should be before or after the do_start (i.e. before or after starting fsck) as most of the time it won't actually do a check so won't make any difference - the poster suggested before:
...
case "$1" in
start|"")
/sbin/vgscan
/sbin/vgchange -a y
do_start
;;
...

[1] https://bugs.launchpad.net/ubuntu/+sour ... ug/147216/ and see comment 2 (maney)

ubergeek72
Posts: 12
Joined: Tue Aug 28, 2012 2:58 am

Re: Raspberry pi +: Don't mount lvm logical volumes at boot

Sun Mar 22, 2015 9:09 pm

Apparently it's a bug in Debian. https://bugs.debian.org/cgi-bin/bugrepo ... bug=711147. The workaround is to edit /etc/init.d/lvm2:

Code: Select all

do_start()
{
	modprobe dm-mod 2>/dev/null || :
	/bin/sleep 5 2>/dev/null || : ### Add this line
	/sbin/vgscan --ignorelockingfailure >/dev/null || :
	/sbin/vgchange -aly --ignorelockingfailure >/dev/null || return 2
}
-JRS

valgonzalez
Posts: 3
Joined: Thu Feb 05, 2015 12:52 am

Re: Raspberry pi +: Don't mount lvm logical volumes at boot

Sun Mar 29, 2015 8:12 am

Hello guys,

Thank you for the help. Unfortunately, no one of the both procedure work for me. I tried both, but without success results. Do you have any new idea to deal with this problem?

Waiting for your comments.

Return to “Raspberry Pi OS”