KVM qcow2 mount

apmuthu

Renowned Member
Feb 26, 2009
868
11
83
Chennai - India & Singapore
github.com
Just tested out the QEMU for a KVM WINXP guest OS. Need to get Network drivers for e1000 into the KVM. How do we mount the qcow2 disk in /var/lib/vz/images/mydisk.qcow2 ?

Tried the following after stopping the guest OS:-
cd /var/lib/vz/images/
mkdir /dev/nbd0
modprobe nbd max_part=8
qemu-nbd mydisk.qcow2
nbd-client localhost 1024 /dev/nbd0
qemu-nbd --connect=/dev/nbd0 mydisk.qcow2
fdisk /dev/nbd0
mount /dev/nbd0 /mnt
mount /dev/nbd0p1 /mnt

All in vain.

The modprobe nbd max_part=8 gives:
FATAL: Error inserting nbd (/lib/modules/2.6.24-7-pve/kernel/drivers/block/nbd.ko): Unknown symbol in module, or unknown parameter (see dmesg)

The mount /dev/nbd0 /mnt gives
mount: /dev/nbd0 is not a block device
 
The commands for conversion used were:
Code:
# For VID = 101
cd /var/lib/vz/images/101
 
# To export out to VMDK, uncomment below
# qemu-img convert -O vmdk vm-101-disk.qcow2 vm-101-disk.vmdk
 
# To import from VMDK, uncomment below
# qemu-img convert -O qcow2 vm-101-disk.vmdk vm-101-disk.qcow2
 
After shutting down the windows KVM in ProxMox v1.3, the modprobe nbd still does not work:
# modprobe nbd

FATAL: Error inserting nbd (/lib/modules/2.6.24-7-pve/kernel/drivers/block/nbd.ko): Unknown symbol in module, or unknown parameter (see dmesg)
A view of the last line in dmesg that came up after this was execute is:
nbd: Unknown parameter `max_part'
 
The module does not get loaded at all as seen from:
# lsmod

Module Size Used by
kvm_intel 60136 2
kvm 205584 1 kvm_intel
vzethdev 23552 0
vznetdev 32904 6
simfs 14064 3
vzrst 158248 0
vzcpt 131256 0
tun 23168 4 vzrst,vzcpt
vzdquota 60016 3 [permanent]
vzmon 58008 7 vzethdev,vznetdev,vzrst,vzcpt
vzdev 12808 4 vzethdev,vznetdev,vzdquota,vzmon
xt_tcpudp 12160 0
xt_length 10752 0
ipt_ttl 10624 0
xt_tcpmss 11008 0
xt_TCPMSS 13440 0
iptable_mangle 13824 3
iptable_filter 13568 3
xt_multiport 12160 0
xt_limit 11904 0
ipt_tos 10368 0
ipt_REJECT 13824 0
ip_tables 33384 2 iptable_mangle,iptable_filter
x_tables 34056 10 xt_tcpudp,xt_length,ipt_ttl,xt_tcpmss,xt_TCPMSS,xt_multiport,xt_limit,ipt_tos,ipt_REJECT,ip_tables
ipv6 350848 39 vzrst,vzcpt,vzmon
bridge 75304 0
floppy 78056 0
parport_pc 48168 0
parport 53388 1 parport_pc
r8169 45316 0
pcspkr 12160 0
evdev 22912 0
thermal 26912 0
button 18080 0
processor 49096 5 thermal
scsi_wait_scan 9984 0
virtio_blk 16264 0
virtio 14336 1 virtio_blk
dm_mod 80248 7
usbhid 43616 0
hid 53312 1 usbhid
usb_storage 92608 0
libusual 30816 1 usb_storage
sd_mod 41088 3
sr_mod 27812 0
ide_disk 26624 0
ide_generic 9728 0 [permanent]
ide_cd 43552 0
cdrom 49064 2 sr_mod,ide_cd
ide_core 147608 3 ide_disk,ide_generic,ide_cd
shpchp 46236 0
pci_hotplug 43056 1 shpchp
uhci_hcd 38176 0
ehci_hcd 50188 0
usbcore 180784 6 usbhid,usb_storage,libusual,uhci_hcd,ehci_hcd
ahci 40964 2
pata_jmicron 15744 0
pata_acpi 17152 0
ata_generic 17156 0
libata 189616 4 ahci,pata_jmicron,pata_acpi,ata_generic
scsi_mod 188984 5 scsi_wait_scan,usb_storage,sd_mod,sr_mod,libata
isofs 47784 0
msdos 19840 0
fat 68912 1 msdos
The above is the same before and after the modprobe nbd command which still yields:-
# modprobe nbd

FATAL: Error inserting nbd (/lib/modules/2.6.24-7-pve/kernel/drivers/block/nbd.ko): Unknown symbol in module, or unknown parameter (see dmesg)
 
I know this is an slightly outdated topic, but this is relevant (in Proxmox 1.4):

modprobe nbd will work fine until you install nbd-client. The configuration automatically creates a file /etc/modprobe.d/nbd-client with as content:

Code:
options max_part=15

This will cause an error on a subsequent modprobe:

Code:
FATAL: Error inserting nbd (/lib/modules/2.6.24-8-pve/kernel/drivers/block/nbd.ko): Unknown symbol in module, or unknown parameter (see dmesg)

And shows up in dmesg or tail /var/log/syslog as:

Code:
Nov 24 23:33:02 servername nbd_client[10201]: Can not open NBD: No such file or directory
Nov 24 23:33:12 servername kernel: nbd: Unknown parameter `max_part'

To fix this, either remove the "max_part=15" portion from the file /etc/modprobe.d/nbd-client, or remove the file entirely, and update your init image with update-initramfs -u.