[linux-lvm] restoring LV after VG has been "reduced"
peter.petrakis at gmail.com
Wed Oct 7 19:11:11 UTC 2009
I'm running LVM through it's paces on Centos 5.3 for the purposes of writing
management code. One of the challenges I'm trying to address is a striped
volume, where the PV that backs it goes away, and later returns but not
before we run 'vgreduce --removemissing --force VolData' to able to work with
the volume group in the meantime.
So I have all the UUIDs of everything that matters stashed away and a dump
of dmsetup table before I insert the fault. After I make the VG consistent again
I add the same disk back into the system, recognize it's meta-data signature
as something I've worked with before and 'vgextend' it back into the
Now I presume that LVM would have enough information in the on disk meta
data to re-assemble the logical volumes but I was wrong. Even after vgscan,
the one striped volume failed to show up. So I resorted to using dmsetup
dmsetup create VolData-striped_lv --table "0 8388608 striped 2 128
8:51 384 8:3 4063616"
dmsetup load VolData-striped_lv --table "0 8388608 striped 2 128 8:51
384 8:3 4063616"
The second dmsetup command may have been unnecessary but I was discouraged from
the results where the LVM tools failed to notice the device but I
clearly see it in /dev/mapper.
[root at node1 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
data_vol VolData -wi-ao 1.94G
testlv VolData -wi-a- 1.00G
rootfs VolSys -wi-ao 9.75G
swapfs VolSys -wi-ao 1.94G
I'm using the LVs as backing stores for DRBD, so if I didn't have to
resync the entire volume
that would be great e.g. recreate the LV from scratch with the same name.
So I guess my questions are.
1) Can I use LVM tools to bring this volume back into service and how?
2) Why can't the LVM tools see what I've done using the dmsetup incantations
3) In addition, is there a "better way" to bring back a striped LV if say I had
to install a new blank disk and the volume group had been "reduced" in
P.S. requisite version information
More information about the linux-lvm