I need tool to read each sector(block) from HDD and write it back to same HDD. Disk is big and so it is not possible to use image creation tools (backup/restore).

Purpose of it - to avoid/resolve Silent Data Degradation (bit rot, decay of storage media,UNC sectors).

Single UNC sector (soft-bad error) could caused Read Instability and as result whole HDD disconnected from OS. I am personally experienced such issue and it disappears when I write zeroes to that UNC sector. Question is - how to solve this problem on regular bases.


2 Answers 2


You can do a "non-destructive read-write test" using "badblocks", which has exactly this effect. It transparently backups the data, tests the sectors and then writes it back:

badblocks -nsv /dev/sdx

  • 1
    Very useful. But need to set size of harddrive sector : badblocks -nsv -b (512|4096) /dev/sdx. Also if Silent Data Degradation happens to OS it will be reported as UNC sector. badblocks -n will not write to that sector!!! You will need to run on each found bad block something like dd if=/dev/zero of=/dev/sdX count=1 bs=(512|4096) skip=NNNNNN seek=NNNNNN` where bs is harddrive sector size and NNNNNN is address of specific UNC sector. It is important to use same sector size for badblocks and for dd!!!
    – Broomerr
    Sep 19, 2013 at 9:03
  • Also two useful commands to find which file was corrupted due that block: In Linux: ntfscluster -f -c 9369 sdd3.img 2>> /dev/null (radagast.ca/linux/…) In Windows nfi \Device\Harddisk0\DR0 28521816 (disktuna.com/finding-out-which-file-is-affected-by-a-bad-sector)
    – Broomerr
    Sep 23, 2017 at 17:33

There are several.

In order of thoroughness (which generally also indicates the time they will take to run) I recommend:

Run Seatools for DOS (not the Windows version; download the ISO), and choose the 'LONG Test'. This program is free.

Run HDD Regenerator. This program is not free ($99 US).

Run SpinRite (running the executable under Windows will extract an ISO that you can burn). Choose level 2 for your purpose or level 4 for thorough testing. This program is not free ($89 US) and is the only one that I know that can often recover data from damaged sectors; this may take a long time though. It comes with a money-back guarantee.

All three programs scan the hard disk at the physical level, and should be run from a bootable CD.

[BTW You're not mentioning your OS. I know SpinRite does not care about the OS (it works on a lower level), for the other two you'd have to check.]

  • I am specially not mention OS as you itself pointing that those programs need to be run from external media. Beside of that IF Silent Data Degradation (bit rot, decay of storage media,UNC sectors) happens you will not able to read that sector anyway due Error Correction Codes of hard-drive (ECC) - so knowledge of Filesystem will not help mostly. Same time knowledge of Filesystem could provide indication of what file is no more correct.
    – Broomerr
    Sep 19, 2013 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .