Skip to content

Instantly share code, notes, and snippets.

@foorenxiang
Forked from scottopell/fix_exfat_drive.md
Last active April 16, 2025 01:58
Show Gist options
  • Select an option

  • Save foorenxiang/996060a41c42b5fe738190f3ba4890de to your computer and use it in GitHub Desktop.

Select an option

Save foorenxiang/996060a41c42b5fe738190f3ba4890de 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.

Disk Utility is unable to repair this at first, but the fix is this:

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

I'm getting an error saying- "Can't open /dev/rdisk2s2: Resource Busy". What do I do?

I was stuck with "Resource Busy" too, but a comment on the Source link (on craigsmith.id.au) describes how to find and kill the process locking the resource which worked for me.

ps -ax | grep disk2 (but your disk)
13699 ?? 11:52.83 /System/Library/Filesystems/hfs.fs/Contents/Resources/./fsck_hfs -y /dev/disk2s2

sudo kill 13699

Once the offending process is killed, I got an OS prompt about an error mounting the drive (something along the lines of it being mounted in read only mode, don't remember the wording). After that the drive mounted in Finder and Disk Utility and I was able to run "First Aid" using "Disk Utility"

@joshjohanning
Copy link

I had to use sudo kill -9 13699 to actually kill my process.

The -9 option sends the SIGKILL signal which forces the process to terminate immediately.

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