[linux-lvm] shrink VG and PV

Stuart D. Gathman stuart at bmsi.com
Mon May 17 21:30:23 UTC 2010


Captain Hindsight here with more advice!  :-)

On Mon, 17 May 2010, Malahal Naineni wrote:

> 	Q: /dev/md1: too many metadata areas for pvresize
> 
> 	That's meant to be saying you chose to place a second copy of
> 	the metadata at the end of the device and if you want to
> 	increase the size of the data area you have to shift that
> 	metadata first and there is no code that does that.

Having 1 metadata erase per PV generally provides sufficient redundancy
under the assumption that PVs are atomic - you lose an entire PV, or
you don't lose it at all.  A 2nd metadata area is only useful when trying
to recover data from a partially destroyed PV - and it is the only PV
in the VG.  

A better solution to that scenario is to regularly backup /etc/lvm (or whatever
dir your distro puts metadata backups in) to someplace outside the single PV
VG.  For instance, I favor keeping an /etc/lvm backup on /boot (which is of
necessity a non-LVM filesystem until grub has robust LVM support).  I've
thought about making /etc/lvm a symlink to /boot/lvm, but haven't studied the
idea for unintended consequences.

If you have regular system backups, then you can get a copy of /etc/lvm from
one of those, and won't need the 2nd metadata area.

Conclusion: always use only one metadata area per PV (but on multiple PVs
when available).

-- 
	      Stuart D. Gathman <stuart at 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.




More information about the linux-lvm mailing list