Do hard disks use on-the-fly error checking?

turantual

New Member
It seems to me, with all the gazzilions of bits being read and written, that errors should creep in now and then. So, I was wondering if hard disks (or SSDs' for that matter) use any kind of on-the-fly read/write error checking? You know, a process where the system double checks that each bit written or read is actually who it claims to be. For example, itunes has a "use error correction when importing cds" option in the preferences. I can imagine a computer disk constantly doing this sort of thing. Otherwise, couldn't a single bit flipped the wrong way in, say, a system file cause havoc?
 

TrainTrackHack

VIP Member
For storage, pretty much all hard drives from the last decade (most likely more) have built-in error detection and correction (usually a combination of plain old CRC an Reed-Solomon) built into the disk itself. I would be very surprised if SSDs didn't do something similar. In addition, some filesystems (e.g. btrfs, ZFS) do on-the fly integrity checking and can silently correct any read errors if a backup copy is available (when using raid1, for example).
 

JaredDM

Active Member
HDD's don't use Reed-Solomon. That's only used in RAID 6 arrays. They use ECC which is basically just a checksum hash of 8 bytes at the end of a 512 byte sector.

It's built right into the function of the drive, and you can't even read or access these ECC bytes. The drive does it all with no reporting to the computer unless it's unable to correctly read the sector and returns an ECC uncorrectable error.
 

TrainTrackHack

VIP Member
You can't have an Error-Correcting Code with just a checksum, those are only good for detecting errors. ECC need to be able to correct corruption (that's why they are called what they are called), and for that Reed-Solomon is probably the best method around. Hard drives definitely use Reed-Solomon or something very similar.
 

JaredDM

Active Member
You are right, they use both error correcting and checksum. I'm not sure it's exactly Reed-Solomon, the manufacturers don't provide any detailed on the specifics of the math involved. It's all under the hood, and can't be controlled or even viewed by the user.
 

newbie3000

New Member
There's probably some proprietary programs designed to cope with hardware peculiarities on each hard disk drive brands and models :)
 
Top