• 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. repquota Command Examples in Linux
  2. sftp Command Examples in Linux
  3. How to Configure an NFSv4-only Client using nfsconf in CentOS/RHEL 8
  4. pvck Command Examples in Linux
  5. TIME_WAIT queue troubles
  6. How to run ssh on multiple ports
  7. “You must wait longer to change your password” – error while changing password in CentOS/RHEL
  8. Windows Active Directory Account Shows Inconsistent UID/GID In Different Linux SSSD Clients (CentOS/RHEL)
  9. How to configure AD group in sudoers file to provide sudo access to users on Linux system
  10. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright