1833777 Members
2071 Online
110063 Solutions
New Discussion

pv_lock&lvm_lock

 
SOLVED
Go to solution
bchinnat
Frequent Advisor

pv_lock&lvm_lock

Hi,

Could you tell me what is the exact use of the pv_lock and lvm_lock under the directory /etc/lvmconf....

Thanks in advance......
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: pv_lock&lvm_lock

Shalom,

My RHEL 5.3 box does not have /etc/lvmconf directory.

It has /etc/lvm

This tells me you are probably not using RHEL 5.x

But the fact I'm trying to guess is a problem.

http://linux.die.net/man/5/lvm.conf

All I can give you is a man page.

If I knew your distribution I could help a lot more.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: pv_lock&lvm_lock

HI:

I suspect that you are looking at a HP-UX system and not a Linux one.

The '/etc/lvmconf/lvm_lock' file is used when one-only access is needed to access or update the '/etc/lvmtab'.

The 'etc/lvmconf/pv_lock' file is used by the 'pvcreate' command.

Regards!

...JRF...
bchinnat
Frequent Advisor

Re: pv_lock&lvm_lock

Hi JRF,

You are correct, I am looking for HPUX only..

Still I am not clear, what purpose it is used for.... Could you please explain more, it would be more helpful....


Thanks,
Bala.
Steven E. Protter
Exalted Contributor

Re: pv_lock&lvm_lock

I totally missed that this was an HP-UX thread. Having found it in Linux.

I will request a transfer for you.

See this document:
http://docs.hp.com/en/B3936-90135/B3936-90135.pdf

These are high availability Service Guard related lock files. The link explains better than I can.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: pv_lock&lvm_lock

These files are NOT related to ServiceGuard: they are present even if ServiceGuard is not installed.

I could not find any documentation for these, but the name obviously indicates they are lock files.

By examining the possible lockfile-related error messages (with "strings /sbin/pvcreate | more"), I think the use of these files is as follows:

/etc/lvmconf/lvm_lock is the basic lock file for LVM configuration. All the tools that make changes to LVM configuration will first check if this file is already open; if it is, another LVM modification operation is in process and the tool will wait for its completion before proceeding any further.
If the file is not open, the tool will open it in exclusive mode while it makes changes. This makes sure only one LVM configuration modification can be executed at a time.

In other words, the lvm_lock file acts as a binary semaphore for protecting the write access to LVM configuration:
http://en.wikipedia.org/wiki/Semaphore_(programming)

/etc/lvmconf/pv_lock is used when creating new PVIDs (i.e. when running pvcreate). Like lvm_lock, it acts as a semaphore for PV creation, but it also stores the last used PVID value. This is used to ensure the system will never create two PVs with the same PVID.

PVID is used to identify alternate paths to the same physical disk when importing VGs.

If two physical disks were to have identical PVID, they could be detected as alternate paths to one PV... and then a path failover would lead to data corruption, as the new "path" would actually be a different disk, with different data. This would be a very bad situation: it might even cause a system crash if it happens with a volume that contains a swap partition or file.

MK
MK