Bug 161874

Summary: lvm suffers from "chicken-and-egg" problem in a startup
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: lvm2Assignee: Alasdair Kergon <agk>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: agk, dwysocha, mbroz, mwc
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: old Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-10 17:48:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2005-06-27 23:46:03 UTC
Description of problem:

When booting a system where /var is mounted from a separate file system,
which you may want to do if your / is mounted read-only as one of many
possibilities, you will see:

/var/lock/lvm: mkdir failed: Read-only file system

The problem is that at this moment /var indeed is yet read-only but lvm
does not care.  Well, /var could be located conceivably on some LVM volume.

Interestingly enough this message is not showing up with lvm2-2.01.12-1.0
from the current rawhide but this does not say anything that /var/lock/lvm
will be created and I do not know if existing volume groups would be
found if such indeed would exist.  All of this despite that
'--ignorelockingfailure' flag was given.

Removing lvm2, even if it not really used and despite of
"if [ -x /sbin/lvm.static ]; then ..." in rc.sysconfing, is not really an
option. 'yum remove lvm2' comes back with a proposition to basically
remove the whole system. :-)  The only possible hack would be to
rename /sbin/lvm.static which would have to be traced through every update.

Version-Release number of selected component (if applicable):
lvm2-2.01.08-2.1

How reproducible:
always

Steps to Reproduce:

The easiest way to reproduce the condition is to do

mount -o ro -t tmpfs none /var/lock
/sbin/lvm.static vgchange -a y --ignorelockingfailure
umount /var/lock

On FC4 this responds with "/var/lock/lvm: mkdir failed: Read-only file system".

I guess that the easiest thing would be to "2>/dev/null" in a corresponding
place of rc.sysinit but I have no idea if this is really a correct course of
action.

Comment 1 Michael Carney 2005-10-05 04:31:45 UTC
Having /var be a separate partition is by no means a rare configuration. 

Comment 2 Alasdair Kergon 2007-01-10 17:48:46 UTC
The error message should be suppressed nowadays.  (Please reopen if there are
still problems.)