LVM2 ./WHATS_NEW lib/format1/format1.c test/t- ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mbroz at sourceware.org 2010-09-22 13:45:23
Modified files:
. : WHATS_NEW lib/format1 : format1.c test : t-vgcfgbackup-usage.sh
Log message:
Fix handling of partial VG for lvm1 format metadata
If some lvm1 device is missing, lvm fails on all operations # vgcfgbackup -f bck -P vg_test
Partial mode. Incomplete volume groups will be activated read-only. 3 PV(s) found for VG vg_test: expected 4
PV segment VG free_count mismatch: 152599 != 228909
PV segment VG extent_count mismatch: 152600 != 228910 Internal error: PV segments corrupted in vg_test. Volume group "vg_test" not found
Allow loading of lvm1 partial VG by allocating "new" missing PV, which covers lost space. Also this fake mising PV inform code that it is partial VG.
https://bugzilla.redhat.com/show_bug.cgi?id=501390
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1732&r2=1.1733
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.121&r2=1.122
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgcfgbackup-usage.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.74 - ===================================== + Fix partial mode operations for lvm1 metadata format. Track recursive filter iteration to avoid refreshing while in use. (2.02.56) Revert to old glibc vsnprintf behaviour in emit_to_buffer() to catch overflow. Allocate buffer for metadata tags dynamically to remove 4k limit.
lib/format1/format1.c +49 -2
82 lines not on this page · raw message
test/t-vgcfgbackup-usage.sh +9 -0
@@ -40,3 +40,12 @@ pvcreate -ff -y --norestorefile -u $pv1_uuid $dev1 pvcreate -ff -y --norestorefile -u $pv2_uuid $dev2 vgcfgrestore -f "$(pwd)/backup.$$1" $vg +vgremove -ff $vg + +# vgcfgbackup correctly stores metadata LVM1 with missing PVs +pvcreate -M1 $devs +vgcreate -M1 -c n $vg $devs +lvcreate -l1 -n $lv1 $vg $dev1 +pvremove -ff -y $dev2 +not lvcreate -l1 -n $lv1 $vg $dev3 +vgcfgbackup -f "$(pwd)/backup.$$" $vg