0

I have a question regarding 'umask.' I have an extra disk on my Linux system, and I want it to mount during startup with the same permissions as '/home.' For example, my '/home' has these permissions:

d rwx r-x r-x  < Directories
- rw- rw- r--  < Files

I want any directories or files created on this extra disk to maintain these permissions. My '/etc/fstab' looks like this:

UUID=BABABABABABA /path/to/mount ntfs umask=0022,uid=1000,gid=1000 0 2

And my permissions for both directories and files are currently:

rwx r-x r-x

Any suggestions or corrections are appreciated!

  • (1) There’s no umask setting that will give you group-writable files but not group-writable directories. (2) You generally have to go out of your way to get files with executable permission (see facl ignoring the "x" permission but only on files).  Are you actually getting files protected rwxr-xr-x?  If so, how are you creating them? – G-Man Says 'Reinstate Monica' Mar 11 '24 at 20:54
  • Instead of umask=0022 try dmask=0022,fmask=0113. Does this help? – Kamil Maciorowski Mar 11 '24 at 21:03
  • @KamilMaciorowski You got it, that's exactly what I wanted. The other question you linked also answers my query. Thank you so much! – Josué Suptitz Mar 12 '24 at 02:00
  • Note that dmask=0022,fmask=0113 only works if the filesystem type is some FAT variant, or some other type of filesystem that does not support POSIX-style file permissions natively (e.g. ntfs). It's a workaround for missing POSIX permissions support that happens to have a side effect that is suitable to this purpose, not an universal feature of all filesystem types. – telcoM Mar 12 '24 at 06:15

0 Answers0