How to mount an exFAT drive on Linux

Last updated on January 31, 2021 by Dan Nanni

Question: I am trying to mount a USB flash drive which is formatted in exFAT on my Linux machine. But the mount command fails with the following error. How can I fix this error and mount the exFAT drive?
mount: /mnt: unknown filesystem type 'exfat'.

exFAT is a proprietary filesystem developed by Microsoft, which has been primarily used in Windows and many existing SD cards or USB drives. Compared to FAT32, exFAT offers many improvements in terms of file size limit (significant higher than FAT32's 4GB limit), maximum disk size, maximum number of files, disk allocation performance, timestamp granularity, file name length, etc. Because of these enhancements and good compatibility with Windows and MacOS, exFAT has been used as a default filesystem for many existing high-capacity SD cards (e.g., SDXC) or USB flash drives.

On Linux, the support for exFAT has been available with a userspace implementation of exFAT filesystem, called fuse-exfat. The Linux kernel has incorporated native support for exFAT starting from version 5.4.

If you cannot mount an exFAT drive on your Linux system, this means that your kernel is lower than 5.4, and also that you do not have fuse-exfat installed.

In order to mount an exFAT drive on Linux with kernel lower than 5.4, you should install fuse-exfat on your Linux system as follows.

Install fuse-exfat on Linux

Install fuse-exfat on Ubuntu, Debian or Linux Mint

On Debian-based distributions, fuse-exfat is available as a package named exfat-fuse. Thus install exfat-fuse along with a set of exFAT utilities (exfat-utils):

$ sudo apt install exfat-fuse exfat-utils

Install fuse-exfat on CentOS 7

On CentOS 7, enable Nux Dextop and EPEL repositories, and then run:

$ sudo yum install fuse-exfat exfat-utils

Install fuse-exfat on CentOS 8

On CentOS 8, enable EPEL repository, and then use yum command:

$ sudo yum install fuse-exfat exfat-utils

Install fuse-exfat on Fedora

On Fedora, first enable rpmfusion-free repository, and then use the default package manager:

$ sudo dnf install fuse-exfat exfat-utils

Mount an exFAT Drive on Linux

After fuse-exfat is installed, you can go ahead and mount an exFAT drive using mount command. Here the exFAT drive is mapped to /dev/sda1, and the drive is mounted to /mnt.

$ sudo mount -t exfat /dev/sda1 /mnt

Now verify that the mount is successful using mount and df commands:

$ mount | grep sda
/dev/sda1 on /mnt type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
$ df -T | grep sda
/dev/sda1      fuseblk   62482048      2432  62479616   1% /mnt

Mount an exFAT Drive as Non-root User

In the above, an exFAT drive is mounted as the root, which means only the root has read/write access to the drive. If you want to mount it as a regular unprivileged user, you can specify your uid and gid at the time you mount the drive as follows.

First, identify your uid and gid with:

$ id
uid=1001(alice) gid=1001(alice) groups=1001(alice),130(libvirt)

Then specify uid and gid with mount command:

$ sudo mount -o rw,users,uid=1001,gid=1001,dmask=007,fmask=117 /dev/sda1 /mnt

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean