2

Sadly sometimes a sector of data on a hard disk may get corrupted, which in this context should mean that the data which was written to it (the 512 or 4096 bytes) cannot be reliably read back.

Normally I get a message, informing me about the bad sector, and maybe I tell myself "ok the data was not so important anyway", and everything is fine.

But how should I get the data (even though corrupted) in case I really, really, really want the data and assume that the unreadable sector is not so badly corrupted as that the data is unusably destroyed?

I think that hdparm or smartclt may be tools, which could issue a command to the hard disk telling it: "give me the content of the sector, no matter if error checks worked out or not!"

What is that command?

UPDATE

I looked into man hdparm and tells this only

--read-sector
Reads from the specified sector number, and dumps the contents in hex to standard output. The sector number must be given (base10) after this option. hdparm will issue a low-level read (completely bypassing the usual block layer read/write mechanisms) for the specified sector. This can be used to definitively check whether a given sector is bad (media error) or not (doing so through the usual mechanisms can sometimes give false positives).

which I am not sure is really a version of telling the hard disk to give the data.

A possible answer to the question would also to point out that the respective protocols (e.g. (S/P)ATA, SCSI etc.) do not even allow for a forced command.

UPDATE

I think there are def. use casese in which the bigger sectors on hdd 4096 Byte do not outright become useless simply because there has been some corruption. If the data stored for instance was already packed for corruption tolerance, i.e some ECC has been mixed into the data, it would be great to the the (from the hdd firmware) incorrect / corrupted data back, as it was still "correctable" or for me.

I see no point that the hdd should better then the user decide to not return the data as is on demand. (It is fine to flag the corruption and prevent normal read, but disabling any read is limiting)

Well maybe there is yet a way!

  • 1
    Unfortunately, without controlling/rewriting the drive firmware, I suspect that this is impossible. Not sure though, so comment, not answer. – Celada Sep 8 '15 at 12:17
  • 2
    If you really, really, really want to retain data, use back-ups :) – zagrimsan Sep 8 '15 at 12:25
  • @zagrimsan true, and understandable. Yet a unreadable sector could have also corrupted partly (it is possible). And being aware to data corruption the stored data in the sector could be tolarant to some corruption (i.e has itself another layer of error correction codes to protect it), in which case I would really really really like the data, because it is still correctable, and I might not want to bring in the hammer and resort to restoring from backup yet – humanityANDpeace Sep 8 '15 at 12:32
  • backups, raid with battery backed cache, ecc ram...redundancy...or hope some disk recovery utility could help – gwillie Sep 8 '15 at 12:32
  • @gwillie. My "really really really wanting it" originates not because of being laze with backup and redundancy, but because I want to be better using the redundancy or data information (if yet any) inside of a unreadable sector, which yet might have some data. So in some sence the funny, ironic and suggesting comments do not fit completely, because I already am aware of data loss, and not simply ignorant. – humanityANDpeace Sep 8 '15 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.