This is kind of a strange situation, but basically, I need to somehow mount some xen guest images (which were made from LVMs) and look into their directory structure. kpartx can do this...

That's easy; except for the fact that my restore area is NOT the same server in which these LVM images were created from, meaning I don't have access to the system which had the physical disks. All I have is a backup of the entire system SEE EDIT (a image which I've extracted into a directory structure). So basically I have another root filesystem under /restore, which I can chroot to.

I'm not sure what I'm trying to do is even possible. Anyone have any idea about this at all?

TL;DR: trying to mount xen images that are logical volumes, except NOT on the server (or disks) the original LVMs configuration was done. I have the /etc/lvm/backup/etc files, but I'm really at a loss here on how I can use this...

Bonus: the disks in which the original LVM configuration were created was in a software RAID.

** It wasn't an "image", but a filesystem backup, so I'm SOL w/o the disks themselves...

  • Tell me that the VG at least has a different name... – Ignacio Vazquez-Abrams May 12 '11 at 20:55
  • Yes, the names are different. – user81307 May 12 '11 at 21:04
  • What kind of image? Do you still have it, or only the useless extracted directory structure? – Turbo J May 14 '11 at 3:21

If you in fact only have a filesystem dump from the old (and I assume broken?) Xen dom0 root you won't be able to recover your logical volumes. They aren't part of the dom0 filesystem but act as something very much like partitions/block devices, as you probably know.

Note that if you had a way to get your actual logical volumes to the new server (by inserting a member of the RAID 1 array, for example) you should be able to use them by running pvscan, vgscan and lvscan.


What kind of software raid? md? In this case, if you've taken the image off your mdX device, it would be transparent anyway - nothing to worry about.

If you have the image in a file, you might use "losetup" to set up a loop block device and then use the typical "vgscan" / "vgchange", "pvscan", "lvscan" sequence to bring the volume group, the physical and the logical volumes online.

  • I phrased my original post wrong (see edit; long day). I will need to take to take an image of the disks (software raid dev). So you are correct, if I had the image. – user81307 May 12 '11 at 21:52
  • Hmm, so you have a copy of the root filesystem mounted as /restore, I understand that. But how do you think you will be able to access your logical volumes if they would not have been part of the file-based copy in the first place? They would have appeared as block device nodes in /dev/<vgname>/<lvname> in the original root filesystem, but typically you would have excluded those from a backup copy done with tar or rsync. – the-wabbit May 13 '11 at 23:54

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.