Cannot mount qcow2 image

Andy Huang

Renowned Member
Jan 1, 2013
32
1
73
I've been fighting with this for almost 12 hours now, and the server is still not accessible. Much of the time is lost from dd'ing from the backup disk to a .raw image (even with bs=16M, I was only getting 32MB/s on a 150G device), as well as converting the said .raw image to a compressed qcow2 image (since disk space is kind of a concern on my small setup).

The conversion process up to this point have been:
  1. rsync -aAXv /* /mnt/sdb1 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} # Uncreatively named mount point. It is an ext3 fs, I did not write directly to device.
  2. Installed Proxmox 2.2 with: linux ext4 maxroot=32 swapsize=32
  3. Created new KVM VM with correct kernel for the original Debian Squeeze (l26), qcow2 disk, no media, and shutdown the system
  4. Created my raw image: dd if=/dev/sdb bs=16M of = /var/lib/vz/images/100/olddisk.raw
  5. Converted my raw image to qcow2: qcow-img convert -c -O qcow2 /var/lib/vz/images/100/olddisk.raw /var/lib/vz/images/100/olddisk.qcow2
  6. Moved old vm-100-disk-1.qcow2 to vm-100-disk-1.qcow2.bak, and mved olddisk.qcow2 to vm-100-disk-1.qcow2
  7. Can't boot system -- 1/2 hr later, still 100% cpu and nothing works

I think it may have been because I didn't setup the networking properly in the old machine, and would like to get in to correct this, but is unable to figure out how to mount this qcow2 image. I've read I'd need to use modprobe nbd max_part=63, and then qemu-nbd to create a device to mount it, but I get this error when I do modprobe nbd (with or even without the max_part part):
Code:
[/COLOR]FATAL: Error inserting nbd (/lib/modules/2.6.32-16-pve/kernel/drivers/block/nbd.ko): Invalid module format

Code:
root@shana-host:/var/lib/vz/images/100# lsmod  | grep nbdroot@shana-host:/var/lib/vz/images/100# modprobe nbd
FATAL: Error inserting nbd (/lib/modules/2.6.32-16-pve/kernel/drivers/block/nbd.ko): Invalid module format
root@shana-host:/var/lib/vz/images/100# lsmod  | grep nbd
root@shana-host:/var/lib/vz/images/100#

Is there anything else I can do to mount the qcow2 image? Am I missing something obvious in the conversion process that should be done differently?
 
Sorry! User stupidity! Been up all night and totally blanked out.

I realized my system was using 2.2-24 instead of the latest, so I did an apt-get update && apt-get upgrade between copying disk to raw, and raw to qcow2, but forgot to reboot the system. So all the kernel modules were in a broken state. Rebooting the system after I get some more coffee fixed that problem. Now I'm at a different problem, which I'll try to figure out first before confusing anyone here with more user stupidity :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!