Skip to content

Mount command ntfs disk

mounting a NTFS/FAT32 USB disk

permissions of NTFS/FAT32 filesystems:
while you can’t control permissions of individual files or directories,
you can specify permission which will be used when mounting the drive using dmaskfmask and umask options:
- uid set the owner user of all files
- gid set the owner group of all files
- dmask controls permissions for directories
- fmask controls permissions for files
- umask controls the bitmask of the permissions that are not present (defaults to the umask of current process)

==directories in Unix needs the execute permission to open their content !==
so you need to use dmask with w => o and fmask without x => 1
numbering is the opposite of the permissions numbering !

The permissions and the corresponding mask numbers:
- rwx = mask number 0
- rw- = mask number 1 (not very useful for directories)
- r-x = mask number 2
- r-- = mask number 3
- -wx = mask number 4 (special case: an approximation of a “write-only directory”)
- -w- = mask number 5 (not very useful for directories)
- --x = mask number 6 (for directories: access by known filenames only)
- --- = mask number 7 (no access)

These can be put into /etc/fstab  for auto mounting
or added to the  mount command as -o arguments:

mount -o uid=1000,gid=1000,dmask=027,fmask=137 /dev/sdXY /mnt/xyz
or
mount -o uid=1000,gid=1000,dmask=007,fmask=117 /dev/sdXY /mnt/xyz