Safe File System for Power Failure?

Solution 1:

Not really. There are several things you can do to mitigate risk, though.

  • Use a journaled filesystem (ext3, reiserfs, zfs, ntfs, etc.)
  • Make sure you're using a battery-backed raid card
  • Use a UPS, dang nabbit. If you're that worried about your data, it's worth the money. Oh, and also, make sure to set up and test the UPS's auto-shutdown feature on your server.

Solution 2:

As has already been answered, a journaled file system is the nearest, although it cannot be guaranteed. It's just like a journaled database system. There are moments, brief though they may be where the data is still in a transaction but has not yet been fully written to the journal. The damage in such a case might be extremely minimal but if that happens to be the one really critical bit you're still up the proverbial creek.

Reality: Despite the best efforts of some really great developers we still suffer file system corruption from power drops.

Solution 3:

ZFS is definently what you are looking for.

There are many ways it prevents data corruption. The most significative example is it only commits data that has been fully written to disk. This should prevent most, if not all, data corruption.

Another way it does this is checksumming, it checks that the data written to disk is correct. This will help in case of power failure when only part of the data gets written to disk.

Also, battery backed RAID cards are really a no-brainer...