1825793 Members
2894 Online
109687 Solutions
New Discussion

lvm_lock file

 
Mike Duffy
Frequent Advisor

lvm_lock file

Morning,

I am having a problem when my L class HPUX11.0 server is rebooted. When the server (single node cluster) reboots it pause for 20 minutes with the following wtitten to the server guard logfile as it attempts to mount SG disks;

Cannot lock "/etc/lvmconf//lvm_lock" still trying ..............

After 20 minutes;

Volume group "vgopc" has been suc
cessfully changed.


And the disks are mounted and the system starts.

Does anyone have any ideas?

Thank you
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: lvm_lock file

Hi Mike:

Make sure that you are not trying to activiate all your volume groups in /etc/lvmrc. In a MC/ServiceGuard environment, this is done for shared Volume groups in the package control scripts and in the "custom" list in /etc/lvmrc for non-shared groups.

The lvm_lock file is designed to prevent concurrent LVM operations.

Regards!

...JRF...
John Palmer
Honored Contributor

Re: lvm_lock file

Hi Mike,

Is this a normal reboot or after a crash?

It sounds as though Serviceguard is trying to vgsync more than one volume group - does your package have more than one?

Also check your package control script as there are various options in there for modifying vgsync behaviour.

Regards,
John

Re: lvm_lock file

The lvm_lock file is used to prevent two processes accessing LVM data in /etc/lvmtab at the same time... are you sure you don't have stale extents somewhere that are being re-synced by LVM?

This is what I would try:

1. Set MCSG to not start following a reboot by changing the flag in /etc/rc.config.d/cmcluster.

2. Reboot.

3. Take a look at all the standard (non MCSG) volume groups & LVs to ensure they're OK and all synced.

4. Manually activate the MCSG volume groups & check these are OK too.

5. If you are happy that *all* volume groups are ok, and synced then deactivate the MCSG VGs and then delete the lvm_lock file.

6. Set the flag back in the /etc/rc.config.d/cmcluster file.

7. Reboot


HTH

Duncan


HTH

I am an HPE Employee
Accept or Kudo
T G Manikandan
Honored Contributor

Re: lvm_lock file

Hello,
//*
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.
*//