ExFAT

Resources

exFAT (Extended File Allocation Table), a Microsoft file system optimized for flash memory storage such as USB sticks, is available to Gentoo Linux systems through a FUSE module.

Note
The availability of the exFAT filesystem had long been poor, because of its proprietary, unpublished specification. The situation, however, may change, following the publication of the spec by Microsoft in 2019. In kernel 5.7, released in Jun 2020, Linux kernel itself implemented an exFAT driver.

Installation[edit | edit source]

Kernel[edit | edit source]

Kernel 5.7 and above[edit | edit source]

Enable exFAT support in the kernel:

KERNEL Enable support for CONFIG_EXFAT_FS
File systems  --->
   DOS/FAT/EXFAT/NT Filesystems  --->
      <*> exFAT filesystem support

FUSE system for earlier kernels[edit | edit source]

Make sure support for Filesystem in Userspace (FUSE) is enabled in the kernel:

KERNEL Enable support for CONFIG_FUSE_FS
File systems  --->
   <*> FUSE (Filesystem in Userspace) support

Emerge[edit | edit source]

Kernel 5.7 and above[edit | edit source]

Install the sys-fs/exfatprogs package:

root #emerge --ask sys-fs/exfatprogs

FUSE system for earlier kernels[edit | edit source]

Install the FUSE exfat package:

root #emerge --ask sys-fs/fuse-exfat

For filesystem creation and manipulation beyond that of the mount command it is necessary to install the sys-fs/exfat-utils package:

root #emerge --ask sys-fs/exfat-utils

Usage[edit | edit source]

Formatting[edit | edit source]

Kernel 5.7 and above[edit | edit source]

To create an exFAT file system, use mkfs.exfat:

user $mkfs.exfat
exfatprogs 1.0.4
Usage: mkfs.exfat
        -L | --volume-label=label                              Set volume label
        -c | --cluster-size=size(or suffixed by 'K' or 'M')    Specify cluster size
        -b | --boundary-align=size(or suffixed by 'K' or 'M')  Specify boundary alignment
        -f | --full-format                                     Full format
        -V | --version                                         Show version
        -v | --verbose                                         Print debug
        -h | --help                                            Show help

For instance, to create it on a removable device present at /dev/sde1 while assigning "Flash" as the file system label:

root #mkfs.exfat -L Flash /dev/sde1

FUSE system for earlier kernels[edit | edit source]

To create an exFAT file system, use mkfs.exfat (or the mkexfatfs command, which is synonymous):

user $mkfs.exfat
mkexfatfs 1.2.1
Usage: mkfs.exfat [-i volume-id] [-n label] [-p partition-first-sector] [-s sectors-per-cluster] [-V] <device>

For instance, to create it on a removable device present at /dev/sde1 while assigning "Flash" as the file system label:

root #mkfs.exfat -n Flash /dev/sde1

Mounting[edit | edit source]

Kernel 5.7 and above[edit | edit source]

With native support, standard mount commands work perfectly:

root #mount /dev/sde1 /mnt/flash

FUSE system for earlier kernels[edit | edit source]

The file system can then be mounted using the mount.exfat-fuse command:

root #mount.exfat-fuse
FUSE exfat 1.0.1
Usage: mount.exfat-fuse [-d] [-o options] [-v] <device> <dir>

For instance, to mount the file system created in the above example:

root #mount.exfat-fuse /dev/sde1 /mnt/flash

To unmount, simply use the umount command:

root #umount /mnt/flash

Integrity checking[edit | edit source]

To check the integrity of an exFAT filesystem, use fsck.exfat:

root #fsck.exfat /dev/sde1

Troubleshooting[edit | edit source]

Compatibility with macOS[edit | edit source]

To allow ExFAT formatted disks to be read by macOS, the disk must use a GUID partition table, and have the Microsoft basic data flag set.

See also[edit | edit source]

  • FAT — originally created for use with MS-DOS (and later pre-NT Microsoft Windows)
  • NTFS — a proprietary disk filesystem by Microsoft for Windows and Windows-based operating systems.
  • Ext4 — an open source disk filesystem and most recent version of the extended series of filesystems.
This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.