You are not logged in.

#1 2021-01-13 12:33:51

0liver
Member
Registered: 2014-05-20
Posts: 37

fuse: mount failed: Permission denied _mounting ntfs partition image

$ls -l
total 106816236
-rw-r--r-- 1 gd users 30737940480 Jul 27  2013 scsi_u100.img
-rw-r--r-- 1 gd users 78641869824 Jul 26  2013 scsi_u160.img

these are (dd) image copies of NTFS partitions. I have several copies of them. I tried
different copies on different arch linux laptops.

so a disk error when reading the image file can be excluded.

these same img files mounted without problems under ubuntu before I switched to arch linux.

$uname -a
Linux L3800 5.10.4-arch2-1 #1 SMP PREEMPT Fri, 01 Jan 2021 05:29:53 +0000 x86_64 GNU/Linux

ntfs-3g is installed.

when I click 'open with [mate] disk image mounter' I get this error: https://photos.app.goo.gl/2LRL7HdRRtrabejKA (I tried twice so got loop8 (for screen shot) in addition to loop7)

$dmesg

/dev/loop7: Can't open blockdev

$sudo blkid
...
/dev/loop7: LABEL="scsi-u160" BLOCK_SIZE="512" UUID="6CA85AB6A85A7E90" TYPE="ntfs"
...

$lsblk
...
loop7               7:7    0  73.2G  1 loop 
...

what puzzles me is that fdisk and parted show completely different info for one and the same partition image file. The output of fdisk is definitely wrong:

$ sudo fdisk -l scsi_u160.img
Disk scsi_u160.img: 73.24 GiB, 78641869824 bytes, 153597402 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: 0x69205244

Device         Boot      Start        End    Sectors   Size Id Type
scsi_u160.img1       218129509 1920119918 1701990410 811.6G 72 unknown
scsi_u160.img2       729050177 1273024900  543974724 259.4G 74 unknown
scsi_u160.img3       168653938  168653938          0     0B 65 Novell Netware 386
scsi_u160.img4      2692939776 2692991410      51635  25.2M  0 Empty

Partition table entries are not in disk order.


$sudo parted scsi_u160.img print
Model:  (file)
Disk /run/media/gd/7c496c3a-0a43-40cc-9639-ea46c5e5ff8f/bck/pc-network-p4-disks/scsi_u160.img: 78.6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
1      0.00B  78.6GB  78.6GB  ntfs


$sudo mkdir /mnt/img160
$ sudo mount /dev/loop7 /mnt/img160/
fuse: mount failed: Permission denied

$sudo mount -t ntfs-3g /dev/loop7 /mnt/img160/
fuse: mount failed: Permission denied

$sudo mount -t ntfs-3g /dev/loop7 /mnt/img160/  -o uid=0,gid=0,noatime,umask=000,locale=en_US.utf8
fuse: mount failed: Permission denied

I unistalled ntsf-3g and installed ntfs-3g-fuse from AUR, but was still not able to mount the ntfs image though that reports a slightly different error.

p.s.: I tried to open a DOS disk image with '[mate] disk image mounter' and it works perfectly

Last edited by 0liver (2021-01-13 14:47:20)

Offline

#2 2021-01-13 15:01:17

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: fuse: mount failed: Permission denied _mounting ntfs partition image

For as far I know (I could be wrong) you first need to find out the bloch-side and what the offset is with fdisk -l <path to image>.
The offset will be calculated as block-size*startpoint

So for example with .img1 the startpoint is 218129509
The block-size is 512

makes:

512*218129509=111682308608

Then it should work with

sudo mount -t auto -o loop,offset=111682308608 scsi_u160.img /your/mountpoint

or

sudo mount -t auto -o loop,offset=$((512*218129509)) scsi_u160.img /your/mountpoint

Last edited by Archlin (2021-01-13 15:06:28)

Offline

#3 2021-01-13 16:00:15

0liver
Member
Registered: 2014-05-20
Posts: 37

Re: fuse: mount failed: Permission denied _mounting ntfs partition image

It is not a complete disk image; it is an image of an NTFS partition - as stated in thread title.
so I don't need any offset.
the output of fdisk is completely wrong. the output of parted is correct. (identical behaviour on arch linux and ubuntu)

I just tried to mount the same image file on my wife's ubuntu laptop and it worked after having set the .img file's ownership (on arch linux the permission was set correctly too.):

$ sudo mkdir /mnt/img160
$ sudo mount -o loop /media/eva/...<path removed>.../scsi_u160.img /mnt/img160
$ ls /mnt/img160/
...
[looks ok]
...

$mount
...
/media/eva/...<path removed>.../scsi_u160.img on /mnt/img160 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
...
$sudo blkid
...
/dev/loop22: LABEL="scsi-u160" UUID="6CA85AB6A85A7E90" TYPE="ntfs"
...

maybe I need to tell arch linux's mount to use blksize=4096?

Last edited by 0liver (2021-01-13 16:12:57)

Offline

Board footer

Powered by FluxBB