The default journal mode for Ext4 is data=ordered, which, per the documentation, means that All data are forced directly out to the main file system prior to its  metadata being committed to the journal.However, there is also the data=journal option, which means that All data are committed into the journal prior to being written into  the main file system.  Enabling this mode will disable delayed  allocation and O_DIRECT support.My understanding of this is that the data=journal mode will journal all data as well as metadata, which, on the face of it, appears to mean that this is the safest option in terms of data integrity and reliability, though maybe not so much for performance.Should I go with this option if reliability is of the utmost concern, but performance much less so? Are there any caveats to using this option?For background, the system in question is on a UPS and write caching is disabled on the drives.
Is data=journal safer for Ext4 as opposed to data=ordered?
ext4
Yes, data=journal is the safest way of writing data to disk. Since all data and metadata are written to the journal before being written to disk, you can always replay interrupted I/O jobs in the case of a crash. It also disables the delayed allocation feature, which may lead to data loss.The 3 modes are presented in order of safeness in the manual:data=journaldata=ordereddata=writebackThere's also another option which may interest you:commit=nrsec    (*) Ext4 can be told to sync all its data and metadata                    every 'nrsec' seconds. The default value is 5 seconds.The only known caveat is that it can become terribly slow. You can reduce the performance impact by disabling the access time update with the noatime option.