Bug 904667 - lvm.conf should use /run/lock/lvm for locking_dir by default
Summary: lvm.conf should use /run/lock/lvm for locking_dir by default
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: 17
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Rajnoha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-26 23:30 UTC by Scott Shambarger
Modified: 2013-04-26 13:48 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-04-26 13:48:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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