Skip to content

Instantly share code, notes, and snippets.

@scottopell
Last active February 7, 2026 21:16
Show Gist options
  • Select an option

  • Save scottopell/595717f0f77ef670f75498bd01f8cab1 to your computer and use it in GitHub Desktop.

Select an option

Save scottopell/595717f0f77ef670f75498bd01f8cab1 to your computer and use it in GitHub Desktop.
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

If Disk Utility is unable to repair, consider trying this:

  1. In Disk Utility, ensure that the drive is not mounted, eject it if it is mounted.
  2. Use diskutil list to find the right drive id.
  3. You want the id under the IDENTIFIER column, it should look like disk1s1
  4. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  5. -d is debug so you'll see all your files output as they're processed.
  6. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
  7. Open Disk Utility and you should be able to repair here successfully.

See the apple man page below for details on the fsck_exfat utility.

Sources/Extra Reading: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/fsck_exfat.8.html https://craigsmith.id.au/2014/07/06/repairing-a-corrupted-mac-osx-exfat-partition/ https://discussions.apple.com/thread/4154638?tstart=0

@markste-in
Copy link

I have tried your suggestions @scottopell but it has not worked for me. What should I do next?

$ sudo fsck_exfat /dev/disk2s2
Password:
** Checking volume.
** Checking main boot region.
fsck_exfat: Could not read boot region
** The volume  could not be verified completely.
$ sudo fsck_exfat -d disk2s2
Password:
Opening /dev/rdisk2s2
** Checking volume.
** Checking main boot region.
fsck_exfat: Could not read boot region
** The volume  could not be verified completely.

I got the same error and struggled quite a bit with it. I almost gave up but the solution is not that hard. You actually 'just' need to overwrite the the dirty flag (at least in my case). I wrote a little script here

https://github.com/markste-in/exfat-repair

@layerstech
Copy link

image image

Running First Aid on “layers” (disk4s1)

Checking file system and repairing if necessary and if possible.
Volume is already unmounted.
Performing fsck_exfat -y -x /dev/rdisk4s1
Checking volume.
Checking main boot region.
The volume could not be verified completely.
File system check exit code is 1.
Restoring the original state found as unmounted.
File system verify or repair failed. : (-69845)

Operation failed…

Pls help to solve this error, as not able to find SSD in fider......

@kkang386
Copy link

kkang386 commented Mar 26, 2025

Thanks for @cocotyty's post in 2022.
This saved my exfat drive from an inadvertent ejection:
brew install gdisk
sudo gdisk /dev/diskxyz
w

@el-j
Copy link

el-j commented Nov 17, 2025

thank all i needed! crazy how long diskutils lag like frozen to find the 2tb exfat... but finally 🚀

@SathwikNadella
Copy link

SathwikNadella commented Feb 7, 2026

I have an external ssd that was on APFS, got corrupted and got turned into exFAT read-only with some readable data. Any format doesnt work neither on windows nor on mac.
Even in the above steps, the fsck_exfat command asks for repair? I type yes, and it errors out with error 16 shown below:
image

Also when I do "sudo ps -ax | grep disk6", it shows a randomly changing pid that I cant kill since it keeps changing, probably this running command itself but nothing else is actually holding the disk.
image

@el-j
Copy link

el-j commented Feb 7, 2026

I have an external ssd that was on APFS, got corrupted and got turned into exFAT read-only with some readable data. Any format doesnt work neither on windows nor on mac. Even in the above steps, the fsck_exfat command asks for repair? I type yes, and it errors out with error 16 shown below: image

Sounds Like the device is busy. Have U thrown it out from finder before doing the fsck? Otherwise it might be blocked by this mount. Make sure it's not mounted to do the fsck

@SathwikNadella
Copy link

Sounds Like the device is busy. Have U thrown it out from finder before doing the fsck? Otherwise it might be blocked by this mount. Make sure it's not mounted to do the fsck

Yeah it's not mounted. It's not able to mount actually

image

@el-j
Copy link

el-j commented Feb 7, 2026

Sounds Like the device is busy. Have U thrown it out from finder before doing the fsck? Otherwise it might be blocked by this mount. Make sure it's not mounted to do the fsck

Yeah it's not mounted. It's not able to mount actually

image

I am not sure but I think if U see it there it's some kind of mounted by the os. u have to really unmount it. When this worked for me the disk was not shown any where in any Mac Ui. Then just started 💯 the steps in command line get it to work for me . Best luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment