I'll answer the title question nothing more.1
First, do note that, if the sector is truly bad, unmarking it won't make it readable. So your cloning software is likely to choke on reading it instead.
In NTFS, a cluster is marked as bad by assigning it to a special stream, $BadClus:$Bad
, a sparse file.
What you need is to
- edit its runlist to remove the corresponding allocated block(s)
- mark the corresponding cluster(s) as free in
$Bitmap
.
To unmark all bad blocks, there's
ntfsfix -b -d
(-b
=clear bad block list,-d
=clear/don't set "dirty" flag) (another method withntfstruncate
does exactly the same2).- It might introduce minor inconsistencies into metadata (in my case, a few indices apparently became unsorted), I'm not sure why, so either run
chkdsk -f
by hand or omit-d
to trigger it at Windows startup if / in case you get FS errors.
- It might introduce minor inconsistencies into metadata (in my case, a few indices apparently became unsorted), I'm not sure why, so either run
To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box23. NTFS Bad Sectors Resolution: The $BadClus metafile - Katy's code describes the way - basically, it's editing the runlist and bitmap by hand.
1 Only because handling bad sectors + NTFS + cloning is too broad a topic. I'll gladly answer ones directly related to the matter at hand.
2 checked the source code of ntfsfix
v2015.3.14
.
3 for the insistent ones, these can't do it: ntfscat
(can't read unreadable sectors),ntfscp
(can't write to offset), ntfstruncate
,ntfsfallocate
,dd
(can't open $BadClus:$Bad
for writing)