Red Hat Bugzilla – Bug 904667
lvm.conf should use /run/lock/lvm for locking_dir by default
Last modified: 2013-04-26 09:48:23 EDT
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: 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):
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)
/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.
/var should be empty at /var mount time. / should not be used for lvm locking.
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.
This is already fixed in f18 since lvm2-2.02.96-2.fc18. We can try to backport that for F17.
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.