Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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?

And what is the max. limit of bad sectors to be repairable?

share|improve this question

3 Answers 3

up vote 12 down vote accepted

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.

share|improve this answer
Ok, I was also thinking the same. But do you have any idea about, what is the max. limit of bad blocks to be repairable? – Krunal Panchal Feb 25 '14 at 14:51
You're assuming bad blocks can be repaired which is incorrect. Bad blocks indicate physical damage and they are a symptom of a failing drive. Backup any data you care about right now. You may be able to run the disk longer but it should be assumed to be completely unreliable. – pzkpfw Feb 25 '14 at 14:53
@Krunal There's no hard number, as the total number of blocks on a drive is a function of drive capacity and allocation block size set when formatting. You might be able to come up with some calculation of the percentage of bad blocks based on this, but it's somewhat a moot point once you see the raw number jumping into double-digits. That's head crashes, media degradation or other hardware faults starting to kick in. – douggro Feb 25 '14 at 15:40
FYI I had a 14GB drive that was knocked in use and had a head crash that worked fine for many years once formatted to 10GB to avoid the bad area. It was never trusted for vital data though and only possible because we knew the cause and location of the damage. – JamesRyan Feb 25 '14 at 16:42
@MartinSchröder Not necessarily. Disks only reallocate sectors on write failure (Reallocated Sector Count); unreadable sectors accumulate in Uncorrectable Sector Count and will drop from there if write succeeds. – ivan_pozdeev Oct 30 at 14:59

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.

share|improve this answer
Actually, there's a really good article on drive recovery in Ubuntu here: – EXrider Feb 26 '14 at 1:48

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.