Recipe for creating hard drive corruption

Hard drive corruption always occurs during a power failure (e.g. crank scenario or dead battery and stopping the alternator, large capacitors not available) while physically writing into a file or a directory, as opposed to writing to the driver cache or the drive cache.

Hard drive block corruption is a generic problem for drives that don't offer an atomic sector update guarantee. HDDs that do offer atomic sector update capabilities either leave the original data unchanged or completely write the new block content. With HDDs that don't offer this capability, half a block could be written and interrupted by an emergency head unload, which then becomes unreadable because the ECC doesn't match. It could affect any block and make it appear to be a bad I/O error. Our QNX 4 disk filesystem makes no guarantee in the presence of physical I/O errors of this type.

Various types of hard drive corruption could occur, depending on the scenario:

Corruption Effects
File corruption Loss of data in the file, or the inability to open the file. If this happens to data or configuration files, then some systems might not be able to restart themselves.
Directory corruption Loss of files
Root block corruption Inability to mount the disk partition or boot from it.
.inode corruption Loss of files, or loss of long filenames.
.bitmap corruption Inability to grow or delete files