3

I have a drive with bad blocks. The filesystem is aware of them, and I read that you can feed e2fsck with a badblocks repport to inform the file system that there are some bad blocks. (I think the option -c in fsck is doing the same thing.)

If I format the partition and get rid of the file system, so is all information about bad blocks lost? Need I inform the new file system about bad blocks? Or will the SMART system do so for me?

Thanks!

cat
  • 1,712
Jitsumi
  • 71

1 Answers1

2

From the vastcough amount of research I've come across in the last five minutes, for instance this and this (from SU.SE), it would appear that device-wide metadata about bad blocks is stored in the Master Boot Record or GUID Partition Table (the disk's partition table that starts at address 00000000: 0x00).

It seems unlikely it would be stored in the partition's filesystem's table of contents. Anyways, the information will only go away if you write the disk a new partition table, which will irreversably destroy all data on the entire disk.


If you're using a disk that has bad blocks for anything remotely mission-ciritical (or even your own data), that disk is bound to fail irreparably in the near future, and it's cheaper and easier and safer to buy a new disk.

cat
  • 1,712
  • 1
    Thanks

    The size of the MBR is only 512 bytes, and I checked the structure, i don't think there is space reserved for this purpose.

    – Jitsumi Jan 09 '16 at 16:58
  • Well, there's nowhere else on the disk for them to be stored. It's possible Linux (perhaps mount, fsck or udev and the kernel) has a list of them somewhere for its own use, but that list is incidental. – cat Jan 09 '16 at 16:59
  • 1
    From what I read (for example this: http://superuser.com/questions/600075/are-hard-disks-bad-sectors-filesystem-dependent), I think bad blocks are both stored in the file system and in the microcode (managed by SMART?) of the hard drive. So I guess if I format the hard drive, the new file system will not be aware of the bad blocks, but it's ok because SMART will not let the OS access them. However I did not find formal information about this, only people discutting about it on forums. – Jitsumi Jan 09 '16 at 17:03
  • Also, I think the microcode of a hard drive can handle only a limited number of bad sectors, what happen after? Is the file system wil lbe able to manage them? I guess if you reach this point, better to change of hard drive as soon as possible.

    And yes, I agree, when you start to have bad blocks, better to change of hard drive as soon as possible.

    – Jitsumi Jan 09 '16 at 17:04