Recovering LVM from disk image
For a RAID NAS box, when the NAS box dies, the data on the drives are still intact. They can be retrieved in the following steps:
- dd disks containing LVM to hard drive; # create images of hard drives
- losetup /dev/loopx disks.img; # make images appear as loop devices on OS
- partx -v -add /dev/loopx; # make partitions on the loopback devices available to OS
- vgscan, vgimport -a; # to import Virtual Groups
- vgdisplay; # showing imported VG names
- vgchange -a y vgname; # to activate VG
- fsck /dev/mapper/vgname; # to check file system of VG
- fuseext2 -o ro -o sync_read /dev/mapper/vgname /mounting_point; # to mount the VG
- rsync -av –progress /mounting_point/ /destination/
Then you will get everything at your destination, and then you can safely remove the images.