Recently I detected more than 3500 bad sectors on my Samsung 160 Gb HDD. Is it possible to repair or ignore this amount of bad sectors using Ubuntu 12.04?
What is the maximum number of bad sectors a disk can have and still be repairable?
Recently I detected more than 3500 bad sectors on my Samsung 160 Gb HDD. Is it possible to repair or ignore this amount of bad sectors using Ubuntu 12.04?
What is the maximum number of bad sectors a disk can have and still be repairable?
Make a backup of your data NOW and source a replacement disk. 3500 bad blocks is excessive and no block mapping is going to result in a stable working disk for very long. That many bad blocks is a sign of impending hardware failure.
You can use recovery tools like ddrescue to dump out an image file of the entire drive, there are options to keep a log of bad blocks and the tool will first recover all readable data, you can also prioritize different parts of the drive. Other tools like basic file copy, or classic dd will error out on the 1st bad block encountered, or they will repeatedly re-attempt to access those bad blocks that are encountered. You can then go back using the logfile as input and re-attempt each unreadable sector, often times you will be able to recover more than half of the bad sectors.
This at least gives you the ability to partially reconstruct files on otherwise unreadable file systems or un-bootable operating systems. You can then use other forensic tools against your disk image file. For example, to search through raw filesystem data for JPEG images.
Beware of the syntax of input and output devices, I know there used to be one variant of ddrescue out there that had BACKWARDS input and output syntax when compared to classic dd. This caused some users to inadvertently copy their target drive over the source data they were trying to recover! There are no warnings about overwriting existing data.
If bad sectors is located in one or few disk areas - check by sector address, then you can exclude them by creating custom partition layout.
Actually for testing purposes i built such system - sliced hard disk in several parts, and every partition checked for readability. I had several 1Tb disks, so it was worth doing. If damaged disk partitions are joined in RAID, then system is generally safe for non mission critical purposes. System now is up 1,5 years without any further problems.
Try remapping damaged sectors using this script: https://techoverflow.net/blog/2015/01/07/fixing-bad-blocks-on-hdds-using-fixhdd.py/