1

I need to read and write to an usb ntfs pendrive through www-data group (that has uid 33) so I have added

UUID=34A0456D004536A0 /home/mypath ntfs-3g rw,defaults,uid=1000,gid=33,dmode=770,fmode=660,dmask=007,fmask=117,auto 0 0 

the disk is mounted but with generic permissions applied to all USB drivers ignoring everything I placed in fstab but mount path that is correct.

I have also used sudo ntfsusermap to generate a mapping file to place in .NTFS-3G folder in the drive.

What could be the reason? How can solve this problem?

6
  • I don't see all the mount options in my mount.ntfs(8) manual. Can you add to your question a link to an online resource that describes all the options you are using? Thanks Commented Oct 20, 2023 at 10:50
  • @xhienne You can check them using man mount command in terminal Commented Oct 20, 2023 at 12:06
  • Some are not there either Commented Oct 20, 2023 at 12:35
  • 1
    I think fstab only works for USB drives in the way you intend if they are plugged at boot time. Is that your case? Maybe udev rules is an alternative solution. Commented Oct 20, 2023 at 16:45
  • Please show the output of the commands mount /home/mypath and mount | grep /home/mypath. Though it does sound like something other than fstab is mounting your device. Commented Oct 20, 2023 at 17:57

2 Answers 2

1

Edit udisk2 mount options with:

sudo nano /etc/udisks2/mount_options.conf

and add

[defaults] ntfs_defaults=uid=$UID,gid=$GID,windows_names ntfs_allow=uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,windows_names,compression,nocompression,big_writes 

if still doesn't work:

sudo nano /etc/udev/rules.d/90-usb-disks.rules 

and add this

ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs-3g" 
1
  • After adding mount_options.conf now works Commented Oct 22, 2023 at 15:42
1

According to man mount.ntfs-3g, there are no fmode or dmode options. And under man mount the dmode option exists, but it is for udf ("Universal Disk Format" filesystem) only.

Also - do not use a comma to end the fs_mntops field in /etc/fstab.

3
  • in another installation I used them and they work correctly on NTFS with ntfs-3g Commented Oct 21, 2023 at 6:12
  • 1
    @Andrea: I don't know what to tell you w/o more info; this is what the system manuals say. Commented Oct 21, 2023 at 21:42
  • @AndreaF What version of ntfs-3g are you using? Searching the ntfs-3g repository for the term fmode yields no results at all, in contrast to searching for fmask. You can also check the file ntfs-3g/src/ntfs-3g_common.c, which lists all the options. Commented Feb 5, 2024 at 12:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.