0

I have a folder under /mnt/ with drwxrwxrwx permissions and under root:root

I then mount a USB drive (exFAT) to this folder and it becomes drwxr-xr-x

The issue is that now I cannot scp to that folder via WinSCP since there is no permission for group to write to folder, and I am unable to scp as root user.

I am mounting the drive via fstab with the following:

/dev/sdb2       /mnt/USB    exfat   defaults,dmask=0000,umask=0000,rw       0       0

How do I either: 1) Give permission to group write or 2) Mount it as a non root user so that that user can write?

ive attempted chown and chmod to no avail. Chown even when run as root returns Operation not permitted

I am able to write to the mount as root user when in SSH (such as mkdir), so the mount is writable, but only by root.

1 Answer 1

3

ExFAT filesystems don't support Unix permissions. The Unix permissions are set at mount time.

The ownership/permissions of the mountpoint (/mnt/USB) has nothing to do with whatever gets mounted over it. It's just a placeholder in the file tree.

To fix it now, try:

sudo mount -o remount,umask=0,dmask=0,fmask=0,uid=$(id -u),gid=$(id -g) /dev/sdb2 /mnt/USB

Update your /etc/fstab entry to add the fmask=0 and uid= and gid= options. You'll have to hard-code your UID and GID, with the values from id -u;id -g.

3
  • Thank you, the manual mount worked and after adding fmask and uid and gid to fstab it worked as well. Can you explain what fmask does? also, even though I hardcoded a user, would root still be able to write to it? what about other users?
    – Duxa
    Commented May 25 at 3:54
  • Please click the checkmark to "accept" my answer, if it solved your problem, and might help others.
    – waltinator
    Commented May 25 at 15:19
  • Read man mount, search for "mask" (/mask). Read about umask=, dmask=, fmask=).
    – waltinator
    Commented May 28 at 2:16

You must log in to answer this question.

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