Bug 904667 - lvm.conf should use /run/lock/lvm for locking_dir by default
lvm.conf should use /run/lock/lvm for locking_dir by default
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
All Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Rajnoha
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-01-26 18:30 EST by Scott Shambarger
Modified: 2013-04-26 09:48 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-04-26 09:48:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Scott Shambarger 2013-01-26 18:30:45 EST
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):

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 10:50:02 EST
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 09:48:23 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.