4

I am trying to mount an exfat drive using fstab with read/write permission for both user and group. The line of etc/fstab for this drive is:

UUID=5E98-37EA /home/ftagliacarne/data/media exfat defaults,rw,uid=1000,gid=1001,umask=002 0 1

Using these option the drive gets mounted to the correct location to the correct user and group, however, the group does not have read-write access. i.e. the permission are set to:

drwxr-xr-x 7 ftagliacarne docker-media 262144 Sep 24 20:40 media

Is there any way of setting the group permission to also have read-write access?

Desired outcome:

drwxrwxr-x 7 ftagliacarne docker-media 262144 Sep 24 20:40 media

Some of the things I tried:

  • Setting umask to 002
  • Using chmod before/after mounting
  • Using chmod recursively on the parent directory

Appreciate any help you can give me.

Update 1:

I also tried changing the fstab file to the following:

UUID=5E98-37EA /home/ftagliacarne/data/media exfat defaults,uid=1000,gid=1001,dmask=0002,fmask=0113 0 1

Alas, it still does not work.

Update 2:

After having issues at boot due to the configurations above, I changed the /etc/fstab entry to the following:

UUID=5E98-37EA /home/ftagliacarne/data/media exfat defaults,uid=1000,gid=1001,fmask=0113,dmask=0002,nofail 0 0

And now it works. I suspect the issue was with the pass option being 1, as changing that to 0 seems to have fixed it. Thank you to everyone who helped!

5
  • Are you sure your gid is 1001? Check with Id -g
    – PonJar
    Commented Oct 9, 2022 at 10:00
  • chmod and chown will not work, period. Commented Oct 9, 2022 at 10:33
  • From the top of my head, i would suggest to use udisks2 and set permissions there accordingly : storaged.org/doc/udisks2-api/latest/mount_options.html You may need to enable on boot mounting in /etc/udisks2/udisks2.conf. I didn't verify this, though.
    – gerhard d.
    Commented Oct 10, 2022 at 13:29
  • Is user 1000 member of group 1001?
    – sudodus
    Commented Oct 10, 2022 at 15:46
  • @sudodus yes it is Commented Oct 11, 2022 at 8:43

2 Answers 2

5

chmod and chown will not work for mounted fat32, exfat and ntfs-3g, period.

What you're looking for is dmask=0002,fmask=0113.

4
  • Thanks for the answer, unfortunately, that also didn't work. Commented Oct 9, 2022 at 19:37
  • 1
    That absolutely should have worked. Please post the output of ls -la /home/ftagliacarne/data It works here on three different mount points. Commented Oct 12, 2022 at 18:42
  • 3
    For me this worked: rw,nofail,x-systemd.automount,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro. Make sure to set the appropriate user/group IDs (instead of 1000).
    – goetz
    Commented Feb 21, 2023 at 23:44
  • the answer from @goetz worked for me (all others did not)
    – tofutim
    Commented Jan 9 at 16:31
1

I had a similar issue recently on debian trixie with Linux 6.7.12. Although here no matter what I had in the options line, the partition only showed up owned by root:root.

What ended up working was replacing 'exfat' with 'exfat-fuse' as the filesystem type in /etc/fstab. After this it properly respected the uid=1000 setting again, and my normal user could get permissions.

This isn't recommended, mind you.

If you want to mount an exfat partition to hold a Steam library, for instance, this refused to work for me, claiming variously that the SteamLibrary wasn't writable (when it was) or that permissions could not be set (to be fair, they couldn't). Attempting to work around this by bind-mounting steamapps/compatdata and steamapps/shadercache over the exfat-fuse drive also failed, although reportedly has worked for others (for whom the kernel driver works).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .