0

the disks in my xenserver are dying. I could rescue some of the lvm volumes with ddrescue. Now I setup a new xenserer and I wonder how to restore from the rescued images. Anyone has experience with this?

Thanks a lot in advance, grassu

Vinícius Ferrão
  • 5,400
  • 10
  • 52
  • 91
grassu
  • 1
  • 1
  • Not so much. I don't no how to proceed. Unfortunately I cannot read the partition table inside the image with the gnu parted tool (it tells unrecognised disk label). So I cannot just mount the partion. – grassu Jul 20 '14 at 09:36
  • I created a backup of VG-Metadata with vgcfgbackup. Now I could restore the volumegroup with vgcfgrestore. But how to restore the lvm data into the new vg? Just with dd command? – grassu Jul 20 '14 at 09:56

1 Answers1

0

You can use the vgexport and vgimport commands

Since you're dealing with LVM volumes, it's probably best to follow one of the many guides available for migrating LVM based storage to new volumes; I've found this particular site to be very useful: http://tldp.org/HOWTO/LVM-HOWTO/recipemovevgtonewsys.html

Andrew
  • 484
  • 2
  • 9
  • Thanks for the hint. Unfortunately I cannot use the lvm commands vgexport/vimport because of disc failures. I only could ddrescue some logical volumes from the the volumegroup. Now I don't know how to import the images in a new volumegroup. Any ideas? – grassu Jul 21 '14 at 16:11
  • They *should* just be block devices, in which case, you can try use dd to stream the data to a new block device. Are you able to access the volumes in any way currently? – Andrew Jul 21 '14 at 20:12
  • So I can create a new lvm with same size as my rescue image on the new server and make a dd if=resuce.img of=/dev/VG_rescue/rescue? What about the lvm metadata? Will this work out of the box? The failing disk is still accessible (in parts). But exporting the vg is failing. – grassu Jul 21 '14 at 20:21
  • My understanding is that it should work - also make sure you set a reasonable block size - http://superuser.com/questions/234199/good-block-size-for-disk-cloning-with-diskdump-dd, else the operation could take some time. Not sure about the metadata - I don't think that will be an issue, since you're moving the volume to a newly created volume group; I don't think the metadata in this new volume group will be overwritten, for example. The operation is non-destructive to the source image/block device, so you won't lose any further data - just make sure the target device is the exact right one :) – Andrew Jul 22 '14 at 12:26
  • will try and report – grassu Jul 22 '14 at 13:01