Page 1 of 1

Mounting .vdi image exfat disk

PostPosted: Mar 3rd, '17, 18:24
by mla
I have a .vdi image which VirtualBox happily boots as WinXP. I also need o be able to access it from my Mageia 5 machine as a mounted disk (not while booted, I hasten to add!)-- read-only would do. Having read several explanations found on the Net as to how to go about it, I tried the below as root:
Code: Select all
# modprobe nbd
# qemu-nbd -c /dev/nbd0 WinXP.vdi
# fdisk -l /dev/nbd0

Disk /dev/nbd0: 7.6 GiB, 8167477248 bytes, 15952104 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: 0x23222321

Device      Boot Start      End  Sectors  Size Id Type
/dev/nbd0p1 *       63 15920414 15920352  7.6G  7 HPFS/NTFS/exFAT

# ls /dev/nbd*
/dev/nbd0   /dev/nbd11  /dev/nbd14  /dev/nbd3  /dev/nbd6  /dev/nbd9
/dev/nbd1   /dev/nbd12  /dev/nbd15  /dev/nbd4  /dev/nbd7
/dev/nbd10  /dev/nbd13  /dev/nbd2   /dev/nbd5  /dev/nbd8
# mount /dev/nbd0 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/nbd0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
# mount -t ntfs /dev/nbd0 /mnt
NTFS signature is missing.
Failed to mount '/dev/nbd0': Invalid argument
The device '/dev/nbd0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
# rpm -qa | grep exfat
fuse-exfat-1.1.0-3.mga5
exfat-utils-1.1.0-3.1.mga5
# mount -t exfat /dev/nbd0 /mnt
FUSE exfat 1.1.0
ERROR: exFAT file system is not found.
#


There is an obvious anomaly in that Net advice claims that the "qemu-nbd -c" command should have also produced at least one /dev/nbd0p* file and it did not.

What am I doing wrong? Any advice (other than "you shouldn't need to do it in the first place" :-)) gratefully received.

Re: Mounting .vdi image exfat disk

PostPosted: Mar 3rd, '17, 21:50
by doktor5000
mla wrote:
# fdisk -l /dev/nbd0
[...]
Device Boot Start End Sectors Size Id Type
/dev/nbd0p1 * 63 15920414 15920352 7.6G 7 HPFS/NTFS/exFAT


There is an obvious anomaly in that Net advice claims that the "qemu-nbd -c" command should have also produced at least one /dev/nbd0p* file and it did not.


See above, it did. Try to mount that instead of the whole disk.

Re: Mounting .vdi image exfat disk

PostPosted: Mar 3rd, '17, 22:25
by mla
Er... Look again at the result of "ls /dev/nbd*" which I included to preclude any misunderstandings. Yes, fdisk claims it to be there, but it isn't.

Re: Mounting .vdi image exfat disk

PostPosted: Mar 4th, '17, 15:56
by doktor5000
Did you try to mount /dev/nbd0p1 which is listed in the fdisk output, or did you only look at the ls output and assume it won't work?

Re: Mounting .vdi image exfat disk

PostPosted: Mar 4th, '17, 16:11
by mla
I tried, even though the according to all instructions how to do it the file should have been there:
Code: Select all
#  fdisk -l /dev/nbd0

Disk /dev/nbd0: 7.6 GiB, 8167477248 bytes, 15952104 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: 0x23222321

Device      Boot Start      End  Sectors  Size Id Type
/dev/nbd0p1 *       63 15920414 15920352  7.6G  7 HPFS/NTFS/exFAT

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