In this Raspberry Pi exFAT guide, we will be showing you how you can enable support for the exFAT file system format on your Raspberry Pi.
For those who do not know, exFAT (Extended File Allocation Table) is a proprietary file system format developed by Microsoft, and is designed to be optimal for flash memory such as USB flash drives and SD cards.
Due to exFAT being patented by Microsoft it cannot become an official part of Linux despite a kernel implementation being released by Samsung. Due to this limitation, we must implement support for the exFAT file system another way.
This limitation is where the FUSE kernel implementation comes in handy. FUSE will allow us to implement support for the exFAT format without having to recompile the kernel.
There are many reasons why you might need to enable exFAT support on your Raspberry Pi. For example, you might need it for when you set up a Samba server with the Raspberry Pi. You may also need it for other projects such as running Owncloud or basically anything that may require removable media.
Below are all the pieces of equipment that I made use of for this Raspberry Pi exFAT tutorial.
Adding Support for exFAT
1. Before we get started with adding support for the exFAT file system to our Raspberry Pi, we must first ensure that our Raspberry Pi operating system is completely up to date and has the latest package list.
To update the Raspberry Pi and grab the package list we need to enter the following two commands into the terminal. You can do it by either using the terminal on the Pi itself or over SSH.
sudo apt-get update sudo apt-get upgrade
2. Now that we have updated the Raspberry Pi and have grabbed the latest package list we can now install the packages we need.
To enable support for the exFAT file system on the Raspberry Pi, we will need to utilize two particular packages.
The two packages that we will be installing to the Pi is fuse-exfat and exfat-utils. These two packages work together to allow the operating system to talk to hard drives that are in the exFAT format.
FUSE acts as a bridge between the kernel and userspace to allow developers to add support for additional file systems without having to release a customized kernel.
Additionally, thanks to FUSE being baked into the Raspbian kernel we are not required to install any special kernels to add support. This makes this Raspberry Pi exFat tutorial a lot easier.
Exfat-utils provides all the utilities that you need to be able to deal with the exFAT format, including the ability to format drives on your Linux devices.
To install these two essential packages, we need to enter the following two commands into the terminal.
sudo apt-get install exfat-fuse sudo apt-get install exfat-utils
Mounting an exFAT Drive Manually from Terminal
1. While Raspbian should automatically detect and mount your exFAT drives after installing the previous two packages, there may be a time where you have to mount it manually.
Mounting an exFAT drive can’t be done in the same way you would mount any other partition. Instead, you will be utilizing the “-t exfat” argument to tell the mount command to recognize the file system as exFAT.
To begin, we must first create a folder where we will mount our desired drives. For our tutorial, we will be just calling this folder exfat.
Create this new exfat folder by running the following command on the Raspberry Pi.
sudo mkdir /media/exfat
2. With the folder now created we need to mount a drive. In our example below, we have already found where our device is located, in our case, this is /dev/sdb1.
To mount the device to the folder we created in the previous step, we need to utilize the following command. We need to reference the SD Card location, the folder location and that we want to utilize exFAT.
sudo mount -t exfat /dev/sdb1 /media/exfat
3. You should now be able to interact with your device at the /media/exfat location.
Automatically Mounting an exFAT Drive
1. If you wish to have the drive automatically mounted at boot, then you need to edit the fstab file. Make sure you back up this file as mistakes may cause your Pi to fail when booting. You can find the fstab file at the following location.
sudo nano /etc/fstab
If you’re unsure of what to add then check out the tutorial on mounting a USB drive. Just make sure you specify exfat as the file system.
Below is an example of an exFAT fstab entry. You can find the UUID by using the sudo blkid command.
UUID=CA1C-06BC /media/exfat exfat defaults,auto,umask=000,users,rw 0 0
Formatting a Drive as exFAT
1. If you want to format your drive in the exFAT format, then you can do this by utilizing a piece of software that came in the “exfat-utils” package.
This piece of software is called mkfs.exfat, to use it you need to specify a drive location as we have shown in the command below.
Once this command has finished your drive will now be formatted exFAT. Keep in mind that formatting a drive will erase anything on it.
We hope by the end of this Raspberry Pi exFAT tutorial you should now be able to successfully utilize exFAT formatted filesystems on your Raspberry Pi. If you have any thoughts, feedback or anything else then be sure to head over to the forums.