File-based locking initialisation failed – ArkIT

Problem: When we type command lvs. It though an error message “File-based locking initialisation failed“. If we type vgs command also the same error.

more detailed information when you type any command or do any activity related to the file system through an error message.

If you verify mount command FS is read-write, but it is write-protected

Solution

particular LV/VG is read-only then you can change the lv locking path using the below the command

# pvs --config 'global { locking_dir = "/tmp" } '

either edit /etc/lvm/lvm.conf file and look for the locking_dir parameter and change the locking path

 # Local non-LV directory that holds file-based locks while commands are
# in progress. A directory like /tmp that may get wiped on reboot is OK.
locking_dir = "/var/lock/lvm"

after changing the locking file path, if you still observe the error message then manually try below the command

# /sbin/lvm.static vgchange -a y --ignorelockingfailure

most of the cases if you file system is read-only then reboot the server and run fsck on the file-system to fix the inodes

Related Articles

Failed to abandon session scope solution

Hue Load balancer permission denied

17 Linux Interview questions and answers

Thanks for your wonderful Support and Encouragement

Ravi Kumar Ankam

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

Leave a Reply

Your email address will not be published. Required fields are marked *