1832595 Members
2965 Online
110043 Solutions
New Discussion

Re: lvm_lock

 
ashish nanjiani
Frequent Advisor

lvm_lock

Hi Guys

I need to know is there an forcefull way to release the lvm_lock. I have tried to kill all the lvm processes on the system , but still it complains about "cannot locl "/etc/lvmconf/lvm_lock"
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: lvm_lock

If all "suspecting" processes that locks it up have been killed and you still have the lvm_lock file around, I would recommend rebooting the server rather than "forcefully" removing the lock file which could potentially corrupt your LVM structure (/etc/lvmtab, etc, etc).
ashish nanjiani
Frequent Advisor

Re: lvm_lock

Rebooting is not possible as its an production box
Helen French
Honored Contributor

Re: lvm_lock

Hi Ashish:

For TKB # KBRC00002639:

PROBLEM
Cannot lock /etc/lvmconf//lvm_lock still trying.
The error appears everytime some lvm command are issued.
What is the cause and how to clear the error.
RESOLUTION
When the lvm commands run and need to access the lvmtab file there need to be a mechanism so that they do not update/access the file when it is being updated/accessed by other lvm commands. This is the purpose of the lvm_lock file. If you get the message 'Cannot lock "/etc/lvmconf//lvm_lock" still trying ... this indicates the system has attempted to lock the lvm_lock file 5 times using lockf() and failed since another command already has it locked. Every 10 attempts the command sleeps for 1 second before trying again. So, this message indicates another lvm command is running and has the lvm_lock file locked.

By deleting the lvm_lock file you could have one lvm command update or access the lvmtab file while another command is already doing this. This could cause the system to behave incorrectly or even corrupt the lvmtab file or worst case cause it to be lost completely.

Sometimes it might be necessary to delete the lvm_lock file to release the lvmtab file for lvm commands. If the process holding the lvm_lock can be killed gracefully it should remove the lock. A reboot may be needed afterward to free the lvmtab file. Afterward the lvm command should work fine.

#### end quote

I think a safe and better way is to reboot the system. Apply the latest LVM cumulative patches too.

HTH,
Shiju
Life is a promise, fulfill it!
hpuxrox
Respected Contributor

Re: lvm_lock

Chan is correct, If this is a production system I would not force the remove of the lvm_lock file. Reboot would be much wiser and safer.

Thanks,

Yates
ashish nanjiani
Frequent Advisor

Re: lvm_lock

that's pretty bad, I have to wait till midnight to schedule a reboot.But, i guess this is the only solution possible!!
S.K. Chan
Honored Contributor

Re: lvm_lock

If you must remove it, then make sure make a copy of all these ..
1) /etc/lvmtab
2) Everything under /etc/lvmconf
3) /etc/lvmpvg (if it exist)

just in case.. at your convenient make sure you schedule for a reboot anyway.
You did not hear this from me :)