NBD activation
# Installation of Qemu tools
sudo apt-get -y install qemu-utils
# NBD activation
sudo modprobe nbd max_part=8
# Connect the image as a nbd disc
sudo qemu-nbd --connect=/dev/nbd0 <image.qcow2>
To check the partitions available on the disk use the following command: sudo fdisk -l /dev/nbd0
Use an LVM type volume
# Refresh volumes
sudo pvscan
sudo vgscan
sudo lvscan
# Activate a new found volume
sudo vgchange -ay
# Mount the partition in /mnt
sudo mount /dev/mapper/<lvm-partition> /mnt
# List and display files on the mounted partition
ls /mnt
Deactivate the volume
# Unmount the LVM partition
sudo umount /mnt
# Unmount volume
sudo vgchange -an <lv-volume>
# Disconnect NBD Image
sudo qemu-nbd -d /dev/nbd0