I have two volume groups on my server, from which I carve out 20-40G LVMs that I use for xen images: xen1_images and xen3_images.

I need to remove the xen3_images volume group, and I'd like to copy all the lvms from xen3_images to xen1_images (there is sufficient disk space).

I know I can do it one at a time by creating a logical volume on xen1_images, then

dd if=/dev/xen3_images/<lvname> of=/dev/xen1_images/<lvname>

but was wondering if there was another way of doing this in one step rather than piecemeal. There are about 20 lvms to move. Something akin to the way rsync works between directories would be perfect, but rsync does not work on lvms

  1. Merge the two volume groups: vgmerge xen1_images xen3_images
  2. Move all logical volumes off the physical volumes you want to reclaim: pvmove /dev/sdz42; pvmove /dev/sdz43; …
  3. Remove the PVs to reclaim from the VG: vgreduce xen1_images /dev/sdz42 /dev/sdz43 …
  4. (optional) Destroy the reclaimed PVs: pvremove /dev/sdz42 /dev/sdz43 …

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.