Bug 21017 - qemu-nbd failes to mount a qcow2 image
Summary: qemu-nbd failes to mount a qcow2 image
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-03 10:18 CEST by Stig-Ørjan Smelror
Modified: 2017-06-08 20:53 CEST (History)
2 users (show)

See Also:
Source RPM: qemu-img-2.8.1.1-3.mga6.x86_64
CVE:
Status comment:


Attachments
CLI output of qemu-nbd (1.54 KB, text/plain)
2017-06-03 21:17 CEST, Ulrich Beckmann
Details
CLI output of qemu-nbd (more detailed) (3.23 KB, text/plain)
2017-06-04 17:03 CEST, Ulrich Beckmann
Details

Description Stig-Ørjan Smelror 2017-06-03 10:18:25 CEST
Hi.

I'm trying to mount a qcow2 image to extract a file, but get this message.

# qemu-nbd --connect=/dev/nbd0 /share/linux/cauldron-sda.img
/home/iurt/rpmbuild/BUILD/qemu-2.8.0/nbd/client.c:nbd_init():L645: Failed to set NBD socket
/home/iurt/rpmbuild/BUILD/qemu-2.8.0/nbd/server.c:nbd_receive_request():L710: read failed

# lsmod | grep nbd
nbd                    32768  4

# ll /dev/nbd*
brw-rw---- 1 root disk 43,  0 Jun  3 09:59 /dev/nbd0
brw-rw---- 1 root disk 43,  1 Jun  3 10:01 /dev/nbd1
brw-rw---- 1 root disk 43, 10 Jun  3 09:39 /dev/nbd10
brw-rw---- 1 root disk 43, 11 Jun  3 09:39 /dev/nbd11
brw-rw---- 1 root disk 43, 12 Jun  3 09:39 /dev/nbd12
brw-rw---- 1 root disk 43, 13 Jun  3 09:39 /dev/nbd13
brw-rw---- 1 root disk 43, 14 Jun  3 09:39 /dev/nbd14
brw-rw---- 1 root disk 43, 15 Jun  3 09:39 /dev/nbd15
brw-rw---- 1 root disk 43,  2 Jun  3 09:39 /dev/nbd2
brw-rw---- 1 root disk 43,  3 Jun  3 09:39 /dev/nbd3
brw-rw---- 1 root disk 43,  4 Jun  3 09:39 /dev/nbd4
brw-rw---- 1 root disk 43,  5 Jun  3 09:39 /dev/nbd5
brw-rw---- 1 root disk 43,  6 Jun  3 09:39 /dev/nbd6
brw-rw---- 1 root disk 43,  7 Jun  3 09:39 /dev/nbd7
brw-rw---- 1 root disk 43,  8 Jun  3 09:39 /dev/nbd8
brw-rw---- 1 root disk 43,  9 Jun  3 09:39 /dev/nbd9
Marja Van Waes 2017-06-03 20:02:38 CEST

Assignee: bugsquad => thierry.vignaud
CC: (none) => marja11

Comment 1 Ulrich Beckmann 2017-06-03 21:17:54 CEST
Created attachment 9389 [details]
CLI output of qemu-nbd

Here the command qemu-ndb --connect works, though I cannot mount the partitions.

Error message is
# mount /dev/nbd0p1 /mnt/
mount: special device /dev/nbd0p1 does not exist

Host is Mageia 6 Cauldron, Client Image is a working instance of Mageia 6 Cauldron, too.

CC: (none) => bequimao.de

Comment 2 Thierry Vignaud 2017-06-04 03:51:57 CEST
Works for me as in other distros.
eg:

modprobe nbd max_part=63
cd /var/lib/libvirt/images/
qemu-nbd -c /dev/nbd0 mageia-DVD.qcow2 
mkdir /mnt/image
mount /dev/nbd0 /mnt/image
ls /mnt/image

qemu-nbd -c /dev/nbd1  mageia-GL.qcow2
mount /dev/nbd1p1 /mnt/image
ls /mnt/image/
Comment 3 Stig-Ørjan Smelror 2017-06-04 08:24:13 CEST
(In reply to Thierry Vignaud from comment #2)
> Works for me as in other distros.
> eg:
> 
> modprobe nbd max_part=63
> cd /var/lib/libvirt/images/
> qemu-nbd -c /dev/nbd0 mageia-DVD.qcow2 
> mkdir /mnt/image
> mount /dev/nbd0 /mnt/image
> ls /mnt/image
> 
> qemu-nbd -c /dev/nbd1  mageia-GL.qcow2
> mount /dev/nbd1p1 /mnt/image
> ls /mnt/image/

Thanks Thierry.

I don't know what I did wrong, but removing nbd and adding it with your suggestion made it work as expected.

Had to disconnect before rmmod.
# qemu-nbd --disconnect /dev/nbd0
/dev/nbd0 disconnected

Cheers,
Stig
Comment 4 Ulrich Beckmann 2017-06-04 17:03:37 CEST
Created attachment 9392 [details]
CLI output of qemu-nbd (more detailed)

I still can't mount the partition here. I wonder why the partitions are not included under /dev/nbd*, though everything else seems ok.

It works on the same multiboot system (UEFI, GPT) with openSUSE Leap 42.2.

Attachment 9389 is obsolete: 0 => 1

Ulrich Beckmann 2017-06-07 16:45:42 CEST

Source RPM: qemu-img-2.8.0-5.mga6 => qemu-img-2.8.1.1-3.mga6.x86_64

Comment 5 Ulrich Beckmann 2017-06-08 20:53:54 CEST
Version qemu-img-2.8.1.1-4.mga6.x86_64 now tested with sucess.

Setting status to resolved, fixed.

Thanks,
Ulrich

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.