Bug 904667

Summary: lvm.conf should use /run/lock/lvm for locking_dir by default
Product: [Fedora] Fedora Reporter: Scott Shambarger <scott-fedora>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: agk, bmarzins, bmr, dwysocha, heinzm, jonathan, lvm-team, msnitzer, prajnoha, prockai, zkabelac
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-26 13:48:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Shambarger 2013-01-26 23:30:45 UTC
Description of problem:
The distributed lvm.conf ships with locking_dir set to /var/lock/lvm.  This is actually a symlink to /run/lock/lvm (via a /var/lock symlink). However, in the initramfs, lvm may attempt to use /var/lock/lvm on the rootfs ("/") before /var is mounted (which has the symlink).  This results in a warning from systemd:

systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway.

Also, (as in my case), the root fs may be a lvm managed mount. lvm.conf includes a comment saying the locking_dir should be a "Local non-LV directory" - which in this case isn't true.

Switching the config to /run/lock/lvm avoids both issues, and results in the same end result after boot (locks on /run)

Version-Release number of selected component (if applicable):
lvm2-2.02.95-6.fc17.x86_64

How reproducible:
For boots on lvm managed rootfs, and systems with /var mounts.

Steps to Reproduce:
1. Setup system with /var mount.
2. Boot system
3. Look for warnings in journalctl (or on status of var.mount unit)
  
Actual results:
/var not empty on /var mount (/var/lock/lvm exists).  Even if directories are removed, they are created again on next boot.  / also used for locking even if it is lvm managed.

Expected results:
/var should be empty at /var mount time.  / should not be used for lvm locking. 

Additional info:
Editing lvm.conf with locking_dir = "/run/lock/lvm" and recreating the initramfs fixes the problem (may need to empty /var directory on / mount to eliminate the systemd warning though).

/run/lock/lvm should really be the default config, and should work on all systems.

Comment 1 Peter Rajnoha 2013-01-28 15:50:02 UTC
This is already fixed in f18 since lvm2-2.02.96-2.fc18. We can try to backport that for F17.

Comment 2 Peter Rajnoha 2013-04-26 13:48:23 UTC
Fedora 17 is nearing its 'End of Life' in approx. two months from now, I don't expect any new updates for F17. This is fixed in F18 version of LVM2.