qemu-nbd - QEMU Disk Network Block Device Server failing with Debian 10.2
Works perfect with Debian 9.12. Does not work any longer with Debian 10.2. Any suggestion of what I might be doing wrong?
modprobe nbd qemu-nbd --connect /dev/nbd0 -f qcow2 /tmp/image.qcow2 # ----- qemu-nbd -d /dev/nbd0 modprobe -r nbd
At the end it gives the following error message:
modprobe: FATAL: Module nbd is in use.
It works how it should in Debian 9.12. (Opens and closed the connection properly without leaving open connections).
In memory there are two processes open: [kworker/u9:0-knbd0-recv] and [knbd0-recv]
These two processes should be closed when executing
qemu-nbd -d /dev/nbd0
There is no
qemu-nbd process running.
The nbd device is still seen in /proc/partitions.
113.620404] nbd0: p1 p2 < p5 > [ 117.767674] EXT4-fs (dm-10): mounted filesystem with ordered data mode. Opts: (null) [ 156.688684] block nbd0: NBD_DISCONNECT [ 156.688696] block nbd0: Disconnected due to user request. [ 156.688697] block nbd0: shutting down sockets [ 163.869378] blk_update_request: I/O error, dev nbd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
This is what I see in the Debian 9.12 server with the same qcow2 image file:
[181586.110052] block nbd0: NBD_DISCONNECT [181586.110063] block nbd0: shutting down sockets [181617.936407] nbd0: p1 p2 < p5 > [181748.735336] EXT4-fs (dm-14): 6 orphan inodes deleted [181748.735337] EXT4-fs (dm-14): recovery complete [181748.755426] EXT4-fs (dm-14): mounted filesystem with ordered data mode. Opts: (null) [181772.254622] block nbd0: NBD_DISCONNECT
Make sure you execute
vgchange -a n nbdvg before disconnecting.