How to mount QEMU's qcow2 partitions:

using the "network block device" (nbd) driver and the qemu-nbd tool

step 1:load the module
$ modprobe nbd max_part=8

step 2: > make the image available as block device
$ qemu-nbd --connect=/dev/nbd0 /hdd-fil.qcow2

step 3: list the available partitions by using command:
$ fdisk -l /dev/nbd0

step 4: mount the partion
$ mount /dev/nbd0p1 /tmp/mymountpoint/
>> if this step fails with the warning: mount: special device /dev/nbd0p1 does not exist
>> run the command: partx -a /dev/nbd0
>> and repeat step 4!

step 5: disconnect partion + block device
$ umount /dev/nbd0p1
$ qemu-nbd --disconnect /dev/nbd0

computer2know :: thank you for your visit :: have a nice day :: © 2024