How to repair hard disk corruption

Our disk filesystems make no guarantee in the presence of physical bad blocks (which is what the power failure results in). This type of IO errors isn't handled at the driver or filesystem level, but they could trigger a notification from the block driver (devb-*) to a user application that would attempt to repair the error (by writing to the bad block) or, in the worst case, reformat the disk. This would require a high-level application to monitor these errors and repair using application knowledge. The disk filesystems can't magically recover from any/all physical bad blocks.

The application layer should also determine whether the system was shut down correctly or not and take corrective measures as necessary. For example, it could start chkfsys, a useful recovery utility that checks the disk integrity:

# chkfsys -v -f -m /dev/hdxtxx

For more information, see its entry in the Utilities Reference.