Re: metadata copies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 10 Aug 2011, Milan Broz wrote:

On 08/10/2011 06:30 PM, Jewsco Pius Jacquez wrote:
If you have two metadata copies stored in one PV, how does the OS know which
one is the legitimate copy?

Only one metadata copy is always active.

There is sequence ID (see seqno = X in metadata backup).
If there are several PVs and more versions of metadata present, the one with
highest sequence ID is used and other PVs are automatically updated to this
version.

Every LVM operation which changes metadata also increases this sequence id.

What happens if there are 2 or more metadata copies with the same sequence ID, but different contents? Not just buggy/malicious code can cause this.
Imagine that a careless admin removes a PV, puts it on another system,
independently updates both systems for a while, then later adds the PV back to
the original system (and the seqnos match).

(Guesses - not authoritative information)

1) I believe the metadata includes a hash/checksum, so that an incomplete
copy of the metadata is easily detected.  (Another reason to have at
least 2 copies - in case of power loss during metadata update.)

2) I suspect there is no clever algorithm, and it probably uses the first
valid copy seen with the highest sequence. AIX had a "quorum" system where the majority of metadata copies had to agree - or operator intervention
was required to bring the VG online.

--
	      Stuart D. Gathman <stuart@bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux