Skip to content


Read the files from a Xen virtual disk img

Yesterday I had to read the data from a Xen virtual disk img.
First I checked the partitions on the img file with:

#fdisk -l /storage/virtualMachines/templates/my.img

Second I run kpartx

#kpartx -a /storage/virtualMachines/templates/my.img


#ls -l /dev/mapper/
brwxr-xr-x 1 root root 253, 2 2010-06-29 22:16 loop0p1
brwxr-xr-x 1 root root 253, 3 2010-06-29 22:16 loop0p2

I mounted the first block device:

mount -o rw /dev/mapper/loop0p1 /mnt/

and found that it contains the /boot partition.
I umounted the first device, and mounted the second block device:

mount -o rw /dev/mapper/loop0p2 /mnt/

but I found that this is just a LVM2 volume.
I scan my system for LVM volumes and identify in the output the volume group name that has my Fedora volume:

vgscan

I activated my volume:

vgchange -ay vg_sender

Found the logical volume that has my Fedora root filesystem:

lvs

and mounted it:

mount /dev/vg_sender/lv_root /mnt/

Posted in Uncategorized.

Tagged with , , , , , , , , , , , , , , , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



Optimized by SEO Ultimate