I’ve been reading a few posts about this, but still haven’t gotten any traction. I’m convinced I’m dealing with my options getting overridden.
Context
I have an exfat mounted drive on a Raspberry Pi 4. I have two users, root
and dietpi
.
I want to mount the exfat drive so that the user dietpi
can read and write to all the files in the drive.
I’ve sudo apt install exfat-fuse
, and I have a line in my /etc/fstab
:
/dev/sda1 /home/dietpi/filerun/user-files/ auto fmask=0777,user,noauto 0 0
I understand that this lets me run mount /dev/sda
as a non root user (as dietpi
) which is great.
But then the permissions when I ls -l
that directory are as follows:
drwxr-xr-x 9 root root 131072 Mar 19 04:07 user-files
The file are there, root can read/write to them. But not dietpi - it can only read, as the permissions show. Note that before I mount, this is what ls -l
shows:
drwsrwxrwx 9 dietpi dietpi 4096 Mar 19 04:07 user-files
I understand that with exfat drives, it defaults to root when you mount a directory as exfat drives have no notion of permissions. I cannot chown
user-files to dietpi
, either after it’s mounted.
If I print mount, what’s interesting is that it shows fmask=0222,user=dietpi
. So the user is not root, which is good, but the fmask is not what I expected it to be. Is it getting overridden?
$ mount
…
/dev/sdal on /home/dietpi/filerun/user-files type exfat (rw, nosuid, nodev, noexec, relatime, fmask=0022, dmask=0022, jocharset=utf 8, errors=remount-ro, user=dietpi)