Difference between revisions of "Mount a qcow2 disk image"

From DevOps Notebook
(Created page with "<pre> # modprobe nbd max_part=8 # qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2 # fdisk /dev/nbd0 -l # mount /dev/nbd0p1 /mnt/somepoint/ # umount /...")
 
Line 1: Line 1:
<pre>
+
<syntaxhighlight lang="python">
 
# modprobe nbd max_part=8  
 
# modprobe nbd max_part=8  
 
# qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
 
# qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
Line 7: Line 7:
 
# qemu-nbd --disconnect /dev/nbd0
 
# qemu-nbd --disconnect /dev/nbd0
 
# rmmod nbd
 
# rmmod nbd
</pre>
+
</syntaxhighlight>

Revision as of 14:31, 12 July 2021

# modprobe nbd max_part=8 
# qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
# fdisk /dev/nbd0 -l 
# mount /dev/nbd0p1 /mnt/somepoint/
# umount /mnt/somepoint/
# qemu-nbd --disconnect /dev/nbd0
# rmmod nbd