1

I have a 1TB NTFS drive that I'm trying to mount using /etc/fstab at boot.

The entry in /etc/fstab looks like this:

UUID=0C6C7C9D6C7C82EE /mnt/ext1tb ntfs umask=707 0 2

The drive gets properly mounted to /mnt/ext1tb but executing stat -c %A /mnt/ext1tb/ yields in d---rwx---, which isn't 707, resulting in me not being able to write/read to/from it using my primary user account.

I've tried remounting the drive multiple times and using 777 as the umask with no success. Mounting the drive directly with mount /dev/sda1 /mnt/ext1tb -o umask=707 yields the same results.

Using latest arch linux with 4.17 kernel.

1
  • 1
    The d---rwx--- you report is precisely the effect of umask 0707. In effect the requested permissions are masked with the complement of the umask value (perms=reqperms&~umval).
    – AFH
    Commented Aug 22, 2018 at 14:14

1 Answer 1

3

umask does not directly specify the mode; it specifies the mask applied to the base mode, telling it which bits to clear (but not which ones to set).

Perhaps unintuitively, it is also inverted: a 0 bit means "don't change", but a 1 bit means "clear (mask out) this bit". So 0707 clears all user/world bits and 0777 clears everything.

What you want is either 0, 07, or 077 (depending on whether the files should be group- and world-readable).

1
  • Thanks! It didn't dawn on me that it's a mask. (despite it being in the name..)
    – Bogdan M.
    Commented Aug 22, 2018 at 14:14

You must log in to answer this question.

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