ntfstruncate binary for Debian (resetting NTFS bad clusters counter)
1st March 2010
There is an excellent step-by-step instruction on resetting the bad clusters counter of an NTFS partition with linux-ntfs tools. I’ve checked – it works as expected:
- Back up important data from partition just in case
- Find out size of ‘$Bad’ attribute in $Badclus using ntfsinfo -i 8 partition (partition is for example /dev/sda1). It will be the “Allocated size†value in the “Dumping attribute $DATA (0
x80)†(there will be two 0x80 attributes. Only one has an “Allocated size†line). Let us write down (remember) this size as ntfs_size.- Use ntfstruncate partition 8 0
x80 ‘$Bad’ 0 to set $Bad’s attribute length to zero.- Use ntfstruncate partition 8 0
x80 ‘$Bad’ ntfs_size to set $Bad’s attribute length back to proper value ntfs_size which was recorded in step 2.- Boot into Windows and run chkdsk -f diskname. It will find errors and should fix them.
However, Debian’s ntfsprogs package does not have the ntfstruncate binary.
Here’s how you can easily build one yourself (you may need a few extra packages with build tools for that):
Read the rest of this entry »
Posted in *nix, how-to, Software | 3 Comments »
