1

So the idea I had is that I want to create a partition with only or at least all the damaged sectors on a HDD (if only damaged sectors are not possible, then a few normal ones are ok as well) and the main partition would be the undamaged sectors.

Is such a thing possible to do? I can't imagine why not.

Grumpy ol' Bear
  • 6,271
  • 12
  • 58
  • 78
  • 2
    If your bad blocks are randomly distributed, then this would be really hard. In my experience, once I have bad blocks, the bad block count tends to grow fairly quickly. If you have bad blocks this is your last chance to replace that drive before you lose data. PS - yes, it is remotely possible, just unlikely to yield you a stable storage device. – James T Snell Dec 22 '14 at 16:34
  • possible duplicate of [Partition around bad drive sectors?](http://superuser.com/questions/555491/partition-around-bad-drive-sectors) which leads to [Hard Drive Bad Sector marking utility](http://superuser.com/questions/47410/hard-drive-bad-sector-marking-utility) – Ƭᴇcʜιᴇ007 Dec 22 '14 at 16:42

3 Answers3

8

This is a terrible idea. Don't do it. Bad blocks means the drive is dying quickly. Get your data out now.

If you have bad blocks near the start of the drive, you're probably screwed as that's where partition tables must live, etc.

If you seriously want to do this, perhaps due to masochism, then you first need to figure out where you have a large section of good blocks.

You can use fdisk to manually declare exactly where your partitions begin and end. Gparted is a nice tool as well, though doesn't give you the same granularity.

Suffice to say, don't do this.

James T Snell
  • 5,892
  • 1
  • 22
  • 33
  • I know, I'm aware. It's just for experimenting purposes. I've never done it, and now that I have a damaged HDD I'd like to test it out. That HDD would be "stress-tested" until it goes completely kaput. I'm just curious, is all. – Grumpy ol' Bear Dec 22 '14 at 16:42
  • If you want to stress it, you don't need a file system at all.. I'd just ream on it with DD. Note DD is an industrial tool you can easily use for unwitting demolition. Suppose your bad drive was mapped as /dev/xvda then I'd stress it with: dd if=/dev/zero of=/dev/xvda – James T Snell Dec 22 '14 at 16:44
  • @DonSalva Yes, it can be done, but you will probably end up with a dozen or more awkwardly sized partitions. – cybernard Dec 22 '14 at 18:46
2

If this is modern drive it has some reserved sectors, where bad sectors are redirected once they appear. If You see "bad" sectors probably reserved area is already exhausted (can't guarantee it - never use HHDs with damaged sectors - too much risk).

On Linux badblocks command can help to mark these sectors on the filesystem (on ext2, maybe ext3 ant ext4).

Anyway, I think current IDE/SATA/USB HDDs are too clever - failing block I/O means not an error returned, but device reset, I/O retry and so on.

kestasx
  • 358
  • 1
  • 7
1

There are a lot of strange things will happens If you try to do so

Don't try To do that or do it if you have unimportant data or files that you don't care about

If you insist you can use MHDD program at hiern's boot 15.2 CD/DVD , this program used to discover where is your bad sectors exactly , then you can use fdisk command to isolate or make a partition far from that bad sectors .

 Note 

    When damaged sectors start to appear that mean the rest of the hard
    will be alike [with exceptions some times] , so don't make that
itvsai
  • 41
  • 3