2

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!

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
VisBits
  • 101
  • 1
  • 4

2 Answers2

4

this is a job for libguestfs

natxo asenjo
  • 5,641
  • 2
  • 25
  • 27
  • No it isn't. There is no KVM container; this is a raw disk image. – Ignacio Vazquez-Abrams Jul 21 '10 at 11:36
  • 3
    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
3

Found another post with more information.

use kpartx -av diskimage.

Then do vgchange -a y VolGroupName

Thanks for the edit!

VisBits
  • 101
  • 1
  • 4