Make system robust against unexpected power loss

filesystemsups

Are there any common or standard ways to make a system more robust against unexpected power loss (I.e., without proper shutdown)? I was using a UPS but the battery is dying and I haven't had a chance to replace it yet.

During the last power loss (when I turned off the UPS to remove it), one of my file systems got thoroughly butchered. It's an ext3 filesystem that was corrupted, and most of my current filesystems are ext3. Are there filesystems that will be more resilient?

Are there any other actions I can take to make the system safer in this regard?

Best Answer

I came across this page on the ArchLinux wiki, titled: What is the most error resistant filesystem?. There are a couple of suggestions in this thread:

data=journal

Use ext3 with the data=journal mount option. You can also make it the default with this command:

tune2fs -o journal_data /dev/your_partition

excerpt from tune2fs man page

journal_data
              When  the  filesystem  is mounted with journalling enabled,
              all data (not just metadata) is committed into the journal 
              prior to being written into the main filesystem.

ext3 vs. ext4 disadvantages