Err Message
# mount /dev/mapper/nbd0p2 /mnt
mount: unknown filesystem type 'LVM2_member'
Mount a raw image (with LVM)
If your partitions are managed with LVM, use losetup and kpartx as in the previous example
to expose the partitions to the host.
# losetup -f /dev/loop0 # losetup /dev/loop0 rhel62.img # kpartx -av /dev/loop0 |
Next, you need to use the vgscan command to identify the LVM volume groups and then
vgchange to expose the volumes as devices: # vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_rhel62x8664" using metadata type lvm2
# vgchange -ay
2 logical volume(s) in volume group "vg_rhel62x8664" now active
# mount /dev/vg_rhel62x8664/lv_root /mnt
Clean up when you're done:
# umount /mnt # vgchange -an vg_rhel62x8664 # kpartx -d /dev/loop0 # losetup -d /dev/loop0 |
Mount a qcow2 image (with LVM)
If the image partitions are managed with LVM, after you use qemu-nbd and partprobe,
you must use vgscan and vgchange -ay in order to expose the LVM partitions as devices
that can be mounted:
# modprobe nbd max_part=16 # qemu-nbd -c /dev/nbd0 image.qcow2 # partprobe /dev/nbd0# vgscan Reading all physical volumes. This may take a while... Found volume group "vg_rhel62x8664" using metadata type lvm2 # vgchange -ay 2 logical volume(s) in volume group "vg_rhel62x8664" now active # mount /dev/vg_rhel62x8664/lv_root /mnt |
When you're done, clean up:
# umount /mnt # vgchange -an vg_rhel62x8664 # qemu-nbd -d /dev/nbd0 |