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.
data=journal
will provide safer result thandata=ordered
+nodelalloc
. Do you have one? – Jérôme Pouiller Dec 13 '16 at 14:45fd=open("file.new"); write(fd, data); close(fd); rename("file.new", "file");
(also mentioned in man ext4(5) BTW) and leave theauto_da_alloc
option enabled, thendata=ordered
(even w/ofsync()
) should be equivalent and no less safe thandata=journal
, right? – Machta Feb 28 '21 at 11:04