How to fix permission for auto mounting exFAT partition?

What is exFAT? Why use an exFAT partition/drive?

exFAT is a file system format. When we format our disk, there is an option where we can choose what file system format to use. If you format a disk on Windows, you can typically choose from FAT32, NTFS, exFAT…etc. The file system format is important because it has impact to the performance of the disk, and, it also has impact to on what operating system (Windows, Mac, Linux, …) you can use the disk. For example, NTFS is nice on Windows and Linux, but on Mac you can only read from it.

Among all formats, exFAT is the one that is newer (with better performance), and also can work with all modern major operating systems.

The permission problem when auto-mounting exFAT on Linux, and how to fix it.

If you are a Linux user and you have an external disk, you know that you need to mount the disk in order to use it. People often use auto mounting if they constantly have the disk attached to the computer. The way to add a disk to auto-mounting is by writing a line like this in the /etc/fstab.

UUID=1234-5678 /mnt/mydisk exfat defaults 0 0

Here the UUID refers to the UUID of the external disk. /mnt/mydisk is the mount point. If you are not familiar with /etc/fstab, please take a look at tutorials like this one.

The problem with exfat is that it doesn’t support permissions like ext4 or NTFS, what you will find is no matter how you try to do chown or chmod after mounting, it always belongs to root and cannot be written to by other users. This causes permission problems whenever someone wants to write to it without sudo.

The solution to this is to make sure the permission is open to everyone at the time of mounting. So, we need to set the umask to 0000. This is equivalent to do “chmod 777” on all files in this mount. So the above line in /etc/fstab should become:

UUID=1234-5678 /mnt/mydisk exfat defaults,umask=0000 0 0

Leave a ReplyCancel reply