Ubuntu – How to fix exfat filesystem

dfexfatfuse

So we accidentally caused our server to go down without a clean shutdown and now df is reporting wrong stats for the external usb (exfat).

root@srv1:/backup/usbdisk# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb2       3.6T  2.8T  646G  82% /
...
/dev/sde1       7.3T  241M  7.3T   1% /backup/usbdisk

du says:

root@srv1:/backup/usbdisk# du -sh
2.6T    .

exfatfsck /dev/sde1 says:

exfatfsck 1.1.0
WARN: volume was not unmounted cleanly.
Checking file system on /dev/sde1.
File system version           1.0
Sector size                 512 bytes
Cluster size                128 KB
Volume size                7452 GB
Used space                  241 MB
Available space            7452 GB
ERROR: cluster 0x3f of file 'assets' is not allocated.
ERROR: cluster 0x40 of file 'mysql' is not allocated.
ERROR: cluster 0x41 of file 'public_assets' is not allocated.
Totally 3 directories and 0 files.
File system checking finished. ERRORS FOUND: 3.

so how do we fix this?

Best Answer

Since v1.3.0 (came out on 15 Sep 2018), exfatfsck should be able to repair some errors.