3

It seems to me that data=journal prevents file system inconsistency in the case of power failure. Using it with a dedicated journal device mitigates the performance penalty of writing the data twice. A power outage would still lose the data that is currently being written to the journal, but the file system on disk would always be consistent.

If that amount of loss is acceptable, is a RAID controller with battery backed cache really worthwhile?

Jeff Strunk
  • 2,127
  • 1
  • 24
  • 29
  • 1
    Write caching without battery backup is generally dangerous, as it will break journaling and other systems depending on the ordering of disk writes. No write cache means losing performance... – pehrs Jan 04 '11 at 00:18

2 Answers2

4

A battery backed cache does more than just keep your filesystem consistent in the event of a power-failure. The cache itself actually performs read caching, and to some extent write-caching (mostly just re-ordering the writes for better write performance). Having a cache on your RAID controller can be a significant speedup for performance. Having a persistent cache of some kind (be it battery-backed, or the newer flash-backed caches) just makes sure that uncommitted writes don't get lost when things go kablooie.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
2

I would recommend you using UPS. IMHO, this is wiser spending of money than buying a RAID controller (especially a good one, which is expensive). Linux' Software RAID uses the main computer CPU and RAM to implement RAID and these are cheaper today than dedicated devices, it can be easily upgraded (just upgrade your kernel) and it's more flexible than hardware implementation. On the other hand, you can think it adds main CPU load. I doubt you'll note any difference in your computer performance. The advantages of using UPS: the whole system is consistent. In case of power failure all you applications can shutdown gracefully. In case of "light blink" or even several minutes outage (depending on your UPS capacity) your system continues to run!

Ilia K.
  • 176
  • 2
  • One note: It doesn't matter a whole lot that your system continues to run for a few minutes if your router and modem aren't also battery backed (in large networks, this can get expensive) – Earlz Feb 20 '11 at 07:57
  • @Earlz: Any serious network-aware application should continue to behave correctly in the presence of network failures. Connectivity should not be a condition for consistency. Here I don't mean that UPS allows to continue to serve the remote clients, but that it allows for a graceful "local" shutdown, while network failures should be dealt with regardless of the power issues. BTW, OP mentions the battery for RAID controller alone - a much narrower scope. – Ilia K. Feb 23 '11 at 21:00