-2

Let me explain it better here... I have a 1 TB HDD with bad blocks, I know that it will degrade until stop, but I still want to keep using it. So, my question is: Is there any file system capable of partitioning this drive, in two 500GB for instance, mirroring data on partitions and automatically doing something like:

  1. Try to read data from disk.
  2. Found that there is one bad block on one partition.
  3. Replicate this data in risk (now just readable from one partition) to another block on the same partition (of bad block).
  4. Decrease total space on disk (by one block?) since you cannot mirror 500GB entirely anymore.

I am not an expert on infrastructure, I am a developer, so, maybe there's something very know like RAID os similar that can do that for me, but I really don't know. I tried RAID once, but when I got 1 failure, Windows automatically alerted me and the partitions never "synced" again.

Any solution on any operational system would be ok for me.

Thanks!

1 Answers1

5

This isn't really available because it's a terrible idea on modern hard drives (...modern being anything in the last 15 years, or so). It's really important to understand that the addresses used by the OS and file system to find data on disk actually don't directly correspond to literal physical addresses on disk but rather to an allocation table on the drive's controller. The drive itself is constantly performing error checking on the disk and, if necessary, quietly moving around blocks of data in response to bad reads and writes. Your idea of breaking up the disk into pieces to perform error correction is basically broken out the gate because there is no guarantee that the pieces themselves are going to be fully isolated from one another.

The other point is that if the drive has gotten to the point where it is actually failing badly enough to return an error code on an attempt to read/write then it's already much worse than you may realize - because, in reality, what you're seeing is an acknowledgement that the drive's firmware can't correct the error any longer. That said, if you're seeing info from SMART diagnostics telling you about incrementing numbers of correctable errors then you've got a preview that things are going south (i.e order the replacement drive). If the OS is getting errors, though? Things are already really, really bad and you should have already replaced it last week.

So a few suggestions:

  1. Take a look at some of the copy-on-write file systems (btrfs and ZFS, for example) that actually take measures to validate the state of on-disk data. This only makes sense in the context of multi-drive setups, though, as you need to give the file system at least a fighting chance of finding a clean copy of your data.

  2. 1TB disks are crazy cheap at this point and certainly wildly cheaper than the potential fallout of the unscheduled crash you're almost certain to hit. Seriously - what you're asking about is analogous to asking to find a way to keep driving on a tire that's bald and has a gigantic bulge on the side. We can't say precisely when it's going to end badly just that it will.

rnxrx
  • 8,143
  • 3
  • 22
  • 31
  • First, thanks for your answer! It seems that maybe I have chosen the wrong StackExchange for the post, sorry about that. The last time that I read a Tanenbaum's book was really more than 15 years ago. I did know about the drive's allocation table but did not about it's "self healing", I imagined that the filesystem was responsible for marking blocks as damaged. Disks are not that cheap here where I live (about 1/4 of a minimum wage), and I have about 6 w/ that problem at home, I was just looking for a sustainable solution for them, specially for temporary data. – Wagner Bertolini Junior Dec 20 '16 at 11:44
  • If you can, please comment this article when you could: https://stephane.lesimple.fr/blog/2011-03-22/how-to-securely-keep-a-hard-drive-with-bad-blocks-in-a-raid-array.html – Wagner Bertolini Junior Dec 30 '16 at 14:17