How to quickly force-clear the dirty bit on ExFAT filesystem
Solution 1
Basically since exFAT dirty bit is in dec offset 106 of the VBR, and it's a bit, not a byte. Luckily the flags which include byte 106(6a) are not included in the calculation of the VBR checksum. You just use a hex editor to zero that dirty bit. For more detailed info on the layout of the VBR and the lags, the internals are at https://www.sans.org/reading-room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system-33274#page=25
And there is also a blog at rshullic.wordpress.com
Solution 2
Easy solution for ExFat with:
“Chkdsk crash - Error 0x80071AC3 & 766f6c756d652e63 3f1”
In my case: a 4GB WD external hard drive running on Windows 7:
I have a WD external hard drive, which after a USB port disconnection failure was marked as dirty and let read but not write, and when I made a chkdsk in Windows 7, chkdsk crashed and disappeared. After being literally several days searching for information, I found a fairly simple solution that is to install a Windows Hotfix (KB2843376 for Windows 7 and Windows 8) that makes chkdsk not crash and can erase the dirty disk mark and work without problems.
You can find the hotfix here.
I hope it works for you as it did for me.
Solution 3
Somebody wrote a utility for MacOS to clear the bit (to build run make
):
https://github.com/zzh8829/exfat_clean
The repo was found via this post.
And there is also this MacOS-specific question: Disable automatic fsck_exfat on dirty volume mount in Mac OSX with the answer which doesn't seem to work on Mojave.
Related videos on Youtube
user898617
Updated on September 18, 2022Comments
-
user898617 almost 2 years
My ExFAT partition is about 1TB and it takes chkdsk about 10 hours to check and clear the dirty bit flag. There is never an error. It is caused by the drive being disconnected in an unsafe manner (it is being used in a VM and sometimes that gets closed in a manner that is causing this). But I need to have an alternative to the 10 hour wait. I'm going to migrate the data to NTFS as soon as I can to hopefully avoid this problem.
-
Michael Frank about 9 yearsAre you comfortable with a HEX editor?
-
user898617 about 9 yearsYes. But tell me which one to use.
-
Andrew Morton about 9 yearsManually Reset or Clear Dirty Bit in Windows without using CHKDSK and read the comments to find out how it might work for exFAT. Of course, before starting, you should assume that you will make the entire physical drive completely and utterly broken (not just the partition) so make appropriate backups first. It might be faster to copy the files from the partition in question to another drive, format the "dirty" partition, and then copy the files back.
-
user898617 about 9 years@AndrewMorton - unfortunately that article doesn't solve for ExFAT systems.
-
Andrew Morton about 9 years@user898617 Please read past the link in my comment.
-
user898617 about 9 yearsI've reformatted the drive. Backup and restore will probably take about 4 hours.
-
-
G-Man Says 'Reinstate Monica' about 5 yearsNote: As you might suspect from the name, the blog (rshullic.wordpress.com) mentioned in the above answer belongs to the author of the answer, Robert Shullich, as stated in his profile page. Warning: it has some slightly aggressive advertising.
-
user1874594 over 4 yearsCan someone in plain English tell me using a
hex
editor how do I go to this place106a
. I think I can manage the 106 but how do I get to 6a and make that zero I am on windows 7 so doing all that mac stuff isnt the nicest thing out there -
velkoon over 4 yearsWondering the same as above comment. What do I even File > Open in my Hex editor? I don't see a way to Hex edit a drive; it has to be a file, right? What file? And how would I pinpoint bit
106(6a)
? (or is106(6a)
a byte as the answer says?:"...and it's a bit, not a byte...include byte 106(6a) are not..."
So what is106(6a)
? A bit? or a byte? Is it the byte containing the correct bit? Or was calling it a "byte" a mistake?