Skip to content

Instantly share code, notes, and snippets.

@dmpatel151282
Created August 20, 2016 04:43
Show Gist options
  • Save dmpatel151282/0f22d0171386d8adccc148a272217901 to your computer and use it in GitHub Desktop.
Save dmpatel151282/0f22d0171386d8adccc148a272217901 to your computer and use it in GitHub Desktop.
Mount :-
Install qemu-utils and enable ndb module
sudo apt-get install qemu-utils
sudo modprobe nbd
Connect the image to the first nbd device
sudo qemu-nbd -c /dev/nbd0 xyz.qcow2
Mount the image. For nbd0, see all the devices available (/dev/nbd0<some-number-or-string>) and try attaching to starting from the first one
sudo mount /dev/nbd0p1 /mnt/qcow1
sudo mount /dev/nbd0p2 /mnt/qcow2...
Unmount :-
Unmount it.
sudo umount /mnt
Disconnect the loopback device too
sudo qemu-nbd -d /dev/nbd0
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment