Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers 3

up vote 11 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 at 14:51
6  
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. –  bigbadonk420 Feb 25 at 14:53
    
@Krunal Bad blocks aren't repaired - they are mapped out of the allocation table and any available spares are mapped in. A few bad blocks - 5, plus or minus - is usually acceptable and can be remapped. My belief / experience is that once you break the 20 bad block point, your drive is on borrowed time. –  douggro Feb 25 at 15:28
    
sorry for using wrong word, but I mean by repair is to ignore the bad sectors. I found by searching that it is possible to ignore the bad sectors. But I don't find any specific limit of number of repairable bad sectors on HDD. –  Krunal Panchal Feb 25 at 15:31
1  
@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 at 15:40
show 4 more comments

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: help.ubuntu.com/community/DataRecovery –  EXrider Feb 26 at 1:48
add comment

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
add comment

Your Answer

 
discard

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.