0

A friend of mine told me that Linux kernel raid (mdadm raid5/6) wasn't reliable, because he tried once to overwrite sectors on one of his physical volumes and it caused file corruption. I replied him that it was normal because the raid5 system was not intended to detect but only to correct error when an error had already been detected because of a disk read error.

However, I wondered how I could prove the concept or make a reliabity test by writing errors on the disk itself. Is there a way, with Linux, to write (or read) a sector in some kind of raw mode, which would allow to read or write manually the "CRC"⁽¹⁾ code, instead of letting the controller manage it all by itself ?

In the same logic, would there be a way to raw copy a disk on another, in order to try some recovery data processes on a copy instead of on the original, which happen with bad recovery softwares, to make disks unrecoverable.

I've seen that someone posed similar questions here or there, but it is quite old, wasn't very clear and got no satisfying answer. Obviously the goal is not to physically destroy the disk, but just to force write some invalid content on it which might be rewritten later with a similar method. And by the way, if the disk really CONTAINS an error, there is no chance that the sector will be relocated by normal operations, because it would need to be read correctly beforehand.

(1) : I put the quotes because I'm not sure if with recent disks error detection codes are still CRC based.

2
  • Bascially all storage media are accessed by sending SCSI commands over various other procols (SATA, USB, ...), and there's no way to control CRC or similar fields with those commands. In fact, modern drives will even silently substitute sectors with bad CRC that can't be corrected by mapping them to other sectors with good CRC on the next write. There might be vendor-specific extensions that allow you to more directly control all of that, but the vendors won't tell you.
    – dirkt
    Commented Aug 26, 2019 at 6:21
  • @dirkt : feared something like that... :-/ By the way, this is a valid answer to my question... why didn't you post this as an answer instead of a comment ?
    – Camion
    Commented Aug 26, 2019 at 22:21

1 Answer 1

1

Very short answer, but if this is acceptable:

Bascially all storage media are accessed by sending SCSI commands over various other procols (SATA, USB, ...), and there's no way to control CRC or similar fields with those commands. In fact, modern drives will even silently substitute sectors with bad CRC that can't be corrected by mapping them to other sectors with good CRC on the next write.

There might be vendor-specific extensions that allow you to more directly control all of that, but the vendors won't tell you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .