Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My system is Gentoo Linux based booting off an LVM based root partition.

The system successfully boots through the initrd. It starts the init of the main kernel, but then fails when trying to check the root drive (/etc/init.d/checkroot).

The error reported is that the root drive (/dev/vg/lv) is unavailable for fsck.whichever.

[Note: I have figured out one solution to this problem, and am posting this to help others. If you know a better approach I'd love to hear about it!]

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

The issue could be that the LVM locking scheme is not allowing the volume group to be activated.

If lvm.conf has:

/etc/lvm/lvm.conf

locking_type = 1
:
locking_dir = "/var/lock/lvm"

Then the locking directory must be writeable for the volume group to be activated. This is a problem at the checkroot stage as the root file system is only read only at this point.

It is possible to set the locking_type to 0, but that carries data loss risks.

Several of the lvm commands accept the --ignorelockingfailure option, which allows the lock to be temporarily sidestepped. This is used in the initrd start scripts.

To get checkroot to work, I added two lines before it actually got started.

&& ! is_net_fs / && ! is_union_fs / ; then

+  lvm vgchange -ayl --ignorelockingfailure
+  lvm vgmknodes --ignorelockingfailure

   if touch -c / >& /dev/null ; then
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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