• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lvdisplay error: “Failed to create directory /var/lock/lvm. File-based locking initilisation failed.”

by admin

The Problem

lvdisplay command prints the below error on a CentOS/RHEL 6 system:

# lvdisplay
Failed to create directory /var/lock/lvm
File-based locking initilisation failed.

The Solution

The above error is due to the /var file system is mounted as read only. To resolve the issue, follow the steps outlined below:

1. Edit and modify /etc/lvm/lvm.conf as below:

locking_dir = "/var/lock/lvm"

to

locking_dir = "/tmp/lock/lvm"

2. Run the lvm commands by defining temporary locking directory:

# lvdisplay --config 'global { locking_dir = "/tmp" } '
# pvdisplay --config 'global { locking_dir = "/tmp" } '
# vgdisplay --config 'global { locking_dir = "/tmp" } ' 

Making Changes Permanent

Mount the /var filesystem with rw option or if the filesystem is read-only due to filesystem corruption, run fsck against the unmounted /var partition to fix it, but ensure you have a valid backup before running fsck.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. How to Extend the Last Existing Filesystem Partition with Parted
  2. Mac Terminal vi[m] Editor Commands
  3. date Command Examples in Linux
  4. The System Activity Reporter (sar) Command in Linux
  5. lsof: command not found
  6. groupmod Command Examples in Linux
  7. ledctl: command not found
  8. Configure VSFTPD Chroot Environment in CentOS and RHEL
  9. laptop-detect Command Examples in Linux
  10. Linux OS Service ‘vncserver’

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright