With hardware RAID, a battery can be used to protect this cache. This often solves the problem. When the power fails, the controller can finish writing the cache when the power is back. This solution can still fail, though: the battery may have worn out, the power may have been off for too long, the disks could be moved to another controller, the controller itself could fail. Certain systems can do periodic battery checks, but these use the battery itself, and leave it in a state where it is not fully charged.