Continue using a partially corrupt hard drive by stripping out the bad sectors

bad-sectorshard drivepartitioningsata

I have a hard disk which started failing. I tested the hard disk using the in-build hardware diagnostic tool which the Dell laptop shipped with and it told me it has bad sectors. So, I understand that these are sections that cannot retain memory. I am curious if I could avoid these sectors by creating volumes around them and continue using the hard disk to pull in a few more years? I removed the hard disk and connected it as an external and am currently running a program 'badblocks' via my mac laptop to determine the number of badblocks. Would it be feasible for me to strip out the bad sections and use the good ones alone?

I intend to re-install Windows 10 into this 500gb hard drive for my Dell laptop. So I'm thinking I could use badblocks to determine which range of sectors are "bad"–say, for example, if the first 100GB are good and there are bad blocks between the 100021570765 byte to the 166702617940 byte, then could I just use the Windows partitioning tool during install to create a 100GB partition, then a 70 GB partition (which contains the bad blocks) and then a 3rd partition with the remaining space. And then format only partition 1 and 3 into volumes so that the unallocated space encapsulates all the bad blocks?

Best Answer

Technically yes. Similar methods have been in use for 50 years, and this is actually in part the purpose of the 'badblocks' tool (its output can be directly embedded when formatting a partition using ext2/ext4). Even Windows itself keeps track of bad sectors – if chkdsk finds any, it assigns them to a hidden file named "$BadClus" so that they never get reused for any other file.

However, modern HDDs have enough hidden "spare" space that they'll automatically remap bad sectors elsewhere before the OS. This happens as soon as you write to a sector that's been marked bad – its logical address remains the same, but physically it now goes to a spare area. (SMART will show you a counter of remapped sectors.)

So in practice you won't need to do this until the number of bad sectors rises to the point that there's no more space to remap them to. And when you reach that point of no remap, then the disk has already become so bad that using it as your main system disk would be unnecessarily risky.