Skip to main content
added 93 characters in body
Source Link
ivan_pozdeev
  • 1.9k
  • 20
  • 35

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 with ntfstruncate 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.
  • 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)

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 with ntfstruncate does exactly the same).

    • 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box2. 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 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)

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 with ntfstruncate 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box3. 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)

added 182 characters in body
Source Link
ivan_pozdeev
  • 1.9k
  • 20
  • 35

I'll answer the title question asked and 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 with ntfstruncate does exactly the same).

    • 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box12. 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 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)

I'll answer the question asked and nothing more.

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 with ntfstruncate does exactly the same).

    • 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box1. NTFS Bad Sectors Resolution: The $BadClus metafile - Katy's code describes the way - basically, it's editing the runlist and bitmap by hand.

1for 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)

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 with ntfstruncate does exactly the same).

    • 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box2. 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 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)

Source Link
ivan_pozdeev
  • 1.9k
  • 20
  • 35

I'll answer the question asked and nothing more.

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 with ntfstruncate does exactly the same).

    • 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.
  • To clear a specific block is much more difficult since I didn't find any existing software that can do this out of the box1. NTFS Bad Sectors Resolution: The $BadClus metafile - Katy's code describes the way - basically, it's editing the runlist and bitmap by hand.

1for 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)