Skip to content

Instantly share code, notes, and snippets.

@scottopell
Last active May 18, 2025 18:52
Show Gist options
  • Save scottopell/595717f0f77ef670f75498bd01f8cab1 to your computer and use it in GitHub Desktop.
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

@TechGenius12
Copy link

Hey yall, from the far future! It would help if you added this to the OG posting.

If you're unable to kill the process via sudo command in terminal, open "Activity Monitor", search up "fsck_exfat" , and force quit the process.

The debugging process will work after you insert the "sudo fsck_exfat -d

@ellielo
Copy link

ellielo commented Sep 2, 2024

This issue sounds familiar to me. It’s happened to me a couple of times where my external hard drive access denied and each time, the solution ended up being different. It can be super frustrating! I recently found this blog https://www.handyrecovery.com/external-hard-drive-access-denied/ which covers all sorts of fixes and tips

@Vito89
Copy link

Vito89 commented Nov 16, 2024

Thank's a lot! It has works for me at earlier than 15.0 Sequoia version MacBooks. I have tried few laptops and after that got success at Rethina iMac Monterey version.

@theharshpat
Copy link

sudo fsck_exfat -d . eg sudo fsck_exfat -d disk1s3

This worked, thanks a lot. I had to answer "YES" a few times to allow it to fix issues. Keep an eye on the output!

@ellielo
Copy link

ellielo commented Nov 24, 2024

Great thread! Thanks to everyone for the input—I’ve learned a lot from this discussion. I just wanted to add my two cents and recommend this article about the external hard drive access denied issue that I found on the blog: https://blog.7datarecovery.com/external-hard-drive-access-denied/. It provides some solid solutions and troubleshooting steps for this specific problem. If you're having trouble accessing your external drive, this guide might be just what you need. The instructions are clear, and it covers different methods to regain access. Hopefully, it’ll be helpful for anyone experiencing the same issue

@phuongnd08
Copy link

Life saver! A note is that you should eject the disk in Disk Utilities so that fsck_exfat is able to repair the disk.

@Bougakov
Copy link

yes | sudo fsck_exfat -d <id from above> would save you from watching the check to run for eternity. A yes command answers y to every prompt. Since fsck_exfat is your last hope you don't have other options so why bother examining its decisions?

@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

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