exfat-ntfs
Installation
SKILL.md
Identity
- exFAT: Kernel-native since 5.4 (module
exfat). Userspace tools:exfatprogs(preferred, replacesexfat-fuse). No daemon. - NTFS (ntfs-3g): FUSE-based read-write driver. Slow but battle-tested. Install:
ntfs-3g. - NTFS (NTFS3): Kernel-native read-write driver since 5.15. Significantly faster than ntfs-3g. Mount with
-t ntfs3. - No daemon: Both are mount-time configured — no background service to manage.
- Distro install:
- Debian/Ubuntu:
apt install exfatprogs ntfs-3g - RHEL/Fedora:
dnf install exfatprogs ntfs-3g - Arch:
pacman -S exfatprogs ntfs-3g
- Debian/Ubuntu:
Key Operations
| Operation | Command |
|---|---|
| Detect filesystem type | blkid /dev/sdX1 or file -s /dev/sdX1 |
| List partitions and sizes | lsblk -f (shows fs type, label, UUID) |
| List all disks with partition table | sudo fdisk -l |
| Mount exFAT | sudo mount -t exfat /dev/sdX1 /mnt/usb |
| Mount exFAT with user permissions | sudo mount -t exfat -o uid=1000,gid=1000,umask=022 /dev/sdX1 /mnt/usb |
| Mount NTFS (ntfs-3g) | sudo mount -t ntfs-3g /dev/sdX1 /mnt/usb |
| Mount NTFS (kernel NTFS3, Linux 5.15+) | sudo mount -t ntfs3 /dev/sdX1 /mnt/usb |
| Mount NTFS with user permissions | sudo mount -t ntfs3 -o uid=1000,gid=1000,umask=022 /dev/sdX1 /mnt/usb |
| Format as exFAT | sudo mkfs.exfat -n "LABEL" /dev/sdX1 |
| Format as NTFS | sudo mkntfs -f -L "LABEL" /dev/sdX1 (fast format, skip zeroing) |
| Check and repair exFAT | sudo fsck.exfat /dev/sdX1 (unmounted) |
| Check and repair NTFS | sudo ntfsfix /dev/sdX1 (clears dirty bit; run unmounted) |
| Set fstab entry for auto-mount | See references/mount-options.md |
| Unmount safely | udisksctl unmount -b /dev/sdX1 (desktop) or sudo umount /mnt/usb |
| Check drive health | sudo smartctl -a /dev/sdX |
| Adjust permissions at mount time | Add uid=, gid=, umask= to mount options |
| Add udev rule for auto-mount | See references/mount-options.md |
Expected State
- Drive mounted read-write at target mountpoint.
- Files accessible to the target user without
sudo(requiresuid/gidmount options — exFAT and NTFS have no per-file permission bits beyond what the mount supplies). lsblk -fshows the correct fstype and mountpoint.
Health Checks
lsblk -f /dev/sdX1→ showsexfatorntfsunder FSTYPE and a non-empty MOUNTPOINTmount | grep /dev/sdX1→ confirms mount options (checkuid,gid,rw)touch /mnt/usb/testfile && rm /mnt/usb/testfile→ confirms read-write access as the target user
Common Failures
| Symptom | Likely cause | Check/Fix |
|---|---|---|
NTFS mounts read-only, read-only filesystem errors |
Windows fast startup left the volume dirty (hibernation file present) | Boot Windows fully and shut down (not restart, not hibernate); or sudo ntfsfix /dev/sdX1 to clear dirty bit as a workaround |
Permission denied accessing files |
Missing uid/gid mount options — files owned by root |
Remount with -o uid=$(id -u),gid=$(id -g),umask=022 |
wrong fs type, bad option, bad superblock |
Missing kernel module or userspace package | `lsmod |
modprobe: FATAL: Module exfat not found |
Kernel < 5.4 or module not built | Install exfat-fuse as fallback or upgrade kernel |
| Slow write speed on NTFS | ntfs-3g is FUSE-based (userspace overhead) | Use kernel NTFS3 driver: mount -t ntfs3 (requires Linux 5.15+) |
| NTFS metadata corruption after unclean unmount | Journal not replayed properly | sudo ntfsfix /dev/sdX1; then remount |
Drive won't unmount: target is busy |
A process has an open file or the shell is inside the mountpoint | lsof +D /mnt/usb to find the process; cd out of the mountpoint; then unmount |
| exFAT volume not recognized on macOS/Windows after Linux format | Created without a partition table, or mkfs.exfat targeting the disk not a partition | Format /dev/sdX1 (a partition), not /dev/sdX (the disk) |
Pain Points
- Windows fast startup (hibernate-on-shutdown) leaves the NTFS volume in a dirty state. Linux mounts it read-only. The only clean fix is to boot Windows, disable fast startup (
Control Panel → Power Options → Choose what the power buttons do → Turn off fast startup), and then shut down normally.ntfsfixclears the dirty bit but does not safely replay the Windows journal. - ntfs-3g is FUSE-based: All I/O crosses the userspace/kernel boundary. For frequent or large transfers, use the kernel NTFS3 driver (
-t ntfs3) on Linux 5.15+. Performance is dramatically better. - exFAT has no Unix permissions: Every file appears owned by the
uid/gidspecified at mount time with theumaskapplied uniformly. You cannotchmodindividual files. Plan the mount options upfront. - FAT32 4 GB file limit: If someone asks why a large file copy fails to a FAT32 drive, the filesystem does not support files larger than 4 GB. Use exFAT (no practical file size limit) or NTFS instead.
- Always sync before removing:
sync && udisksctl unmount -b /dev/sdX1before unplugging. Pulling a drive with dirty buffers causes corruption. On desktop systems,udisksctlis safer than rawumountbecause it also powers down the drive after unmounting.
References
See references/ for:
mount-options.md— mount options table, fstab examples, udev rules, udisksctl vs mountdocs.md— upstream documentation and wiki links
Related skills
More from l3digital-net/claude-code-plugins
qt-architecture
>
40design-draft
>
14qt-bindings
>
13qt test patterns
>
11qt-resources
>
11python-design-patterns
Python design patterns — KISS, SoC, SRP, composition over inheritance, dependency injection. MUST consult when refactoring Python classes, choosing between inheritance and composition, implementing dependency injection, extracting abstractions, or restructuring Python modules.
7