Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a disk image that I made with KVM. The partition layout inside the disk image is as follows.

[root@centreon01 2tb-external]# fdisk -lu vdisk1.img

Device Boot           Start         End      Blocks   Id  System
vdisk1.img1   *          63      208844      104391   83  Linux
vdisk1.img2          208845  1249278659   624534907+  8e  Linux LVM

Partition 2 has different physical/logical endings:

 phys=(1023, 254, 63) logical=(77763, 254, 63)

I understand how to mount the LVM partition but how would I access the LVM volume within that once I mount it? Would I then mount the volume that's mounted within?

Thanks everyone!

share|improve this question

this is a job for libguestfs

share|improve this answer
No it isn't. There is no KVM container; this is a raw disk image. – Ignacio Vazquez-Abrams Jul 21 '10 at 11:36
if you just read the home page of libguestfs you read this: "libguestfs can access nearly any type of filesystem including: all known types of Linux filesystem (ext2/3/4, XFS, btrfs etc), any Windows filesystem (VFAT and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and GPT disk partitions, raw disks, qcow2, CD and DVD ISOs, SD cards, and dozens more. libguestfs doesn't need root permissions." So yes, it supports raw disks. – natxo asenjo Jul 21 '10 at 12:40

Found another post with more information.

use kpartx -av diskimage.

Then do vgchange -a y VolGroupName

Thanks for the edit!

share|improve this answer
Can we have more details on what it actually does? – Weboide Jul 21 '10 at 0:55
Follow this procedure:… – Pier Jul 21 '10 at 11:45
Would it be possible to run this as a regular user (not root) for security issues? – ascobol Nov 9 '10 at 14:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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