FS#42287 - [qemu] Connecting to NBD and mounting silently fails

Attached to Project: Arch Linux
Opened by A. Sarkar (asarkar) - Tuesday, 07 October 2014, 14:36 GMT
Last edited by Tobias Powalowski (tpowa) - Sunday, 04 September 2016, 05:37 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I load the nbd driver at boot. The relevant bit of mod_probe.conf:

options nbd max_part=63

I try to mount a qcow2 image (Win 7 guest, NTFS) like so:

sudo qemu-nbd -c /dev/nbd0 .vm/win7.vm
sudo mount /dev/nbd0p2 /mnt/win

Mount does not return an error, exits with code 0, but does not actually mount the filesystem.

qemu 2.1.2-1
linux 3.16.3-1
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Sunday, 04 September 2016, 05:37 GMT
Reason for closing:  Fixed
Comment by Dave Reisner (falconindy) - Tuesday, 07 October 2014, 23:00 GMT
Works for me.

> Mount does not return an error, exits with code 0, but does not actually mount the filesystem.
What does the mount syscall return?
Comment by A. Sarkar (asarkar) - Tuesday, 07 October 2014, 23:16 GMT
It returns 0. I've attached strace output.
Comment by Dave Reisner (falconindy) - Tuesday, 07 October 2014, 23:24 GMT
So then the mount was successful. Why do you say it isn't mounted? Does /proc/self/mountinfo show the mount?
Comment by A. Sarkar (asarkar) - Tuesday, 07 October 2014, 23:31 GMT
/proc/self/mountinfo does not show it
Comment by Dave Reisner (falconindy) - Tuesday, 07 October 2014, 23:40 GMT
What is the filesystem type of .vm/win7.vm? I think the problem is that mount is trying to mount it as fuse.
Comment by A. Sarkar (asarkar) - Wednesday, 08 October 2014, 00:13 GMT
It is NTFS.

$ sudo fdisk -l /dev/nbd0

Disk /dev/nbd0: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe9c444fe

Device Boot Start End Sectors Size Id Type
/dev/nbd0p1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
/dev/nbd0p2 206848 83881983 83675136 39.9G 7 HPFS/NTFS/exFAT
Comment by A. Sarkar (asarkar) - Friday, 26 December 2014, 18:05 GMT
Debug output from ntfs-3g below:

~ $ sudo ntfs-3g -o debug,no_detach /dev/nbd0p2 /mnt/win
FUSE library version: 2.9.3
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
Version 2014.2.15 external FUSE 29
Mounted /dev/nbd0p2 (Read-Write, label "", NTFS 3.1)
Cmdline options: debug,no_detach
Mount options: allow_other,nonempty,relatime,fsname=/dev/nbd0p2,blkdev,blksize=4096
Ownership and permissions disabled, configuration type 7
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.23
flags=0x0003f7fb
max_readahead=0x00020000
INIT: 7.19
flags=0x00000051
max_readahead=0x00020000
max_write=0x00020000
max_background=0
congestion_threshold=0
unique: 1, success, outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 1550
getattr /
unique: 2, success, outsize: 120
unique: 3, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 1550
statfs /
unique: 3, success, outsize: 96
unique: 4, opcode: FORGET (2), nodeid: 1, insize: 48, pid: 0
FORGET 1/1
unique: 5, opcode: DESTROY (38), nodeid: 0, insize: 40, pid: 0
Unmounting /dev/nbd0p2 ()
unique: 5, success, outsize: 16
Comment by Tobias Powalowski (tpowa) - Saturday, 03 September 2016, 06:41 GMT
Is this still an issue?
Comment by A. Sarkar (asarkar) - Saturday, 03 September 2016, 12:10 GMT
I switched to Virtualbox, and host/guest shared folders solved the motivating problem for me.

Please close this ticket.

Loading...