Android File System Logs

ext3 has 3 logging options: log, ordered, and callback. According to the wikipedia entry , they range from the least risky to the most risky to recover from failures. For some reason, the Android version of Linux only supports the last two options and is used by default for writeback. (I run Froyo)

Is there any way to add log mode support? I would like to do this on the / data section, which is ext3, and also where most of the files go. My device does not have a battery, so I need to make sure that it is damaged when someone turns off the power.

In case anyone is interested, Linux parameters are defined in the kernel / fs / ext3 / Kconfig file. Specific option: EXT3_DEFAULTS_TO_ORDERED.

+6
source share
1 answer

The solution was to add the following to kernel / fs / ext3 / Kconfig and rebuild the kernel using EXT3_DEFAULTS_TO_JOURNAL.

choice prompt "EXT3 default journal mode" default EXT3_DEFAULTS_TO_ORDERED help The journal mode options for ext3 have different tradeoffs between when data is guaranteed to be on disk and performance. The use of "data=writeback" can cause unwritten data to appear in files after an system crash or power failure, which can be a security issue. However, "data=ordered" mode can also result in major performance problems, including seconds-long delays before an fsync() call returns. "data=journal" is the safest option but possibly the the great perfromance burden. For details, see: http://ext4.wiki.kernel.org/index.php/Ext3_data_mode_tradeoffs If you have been historically happy with ext3 performance, data=ordered mode will be a safe choice. config EXT3_DEFAULTS_TO_JOURNAL bool "Default to 'data=journal' in ext3" depends on EXT3_FS help Both data and metadata are journaled. Should be safe against crashes, power failure, etc. config EXT3_DEFAULTS_TO_ORDERED bool "Default to 'data=ordered' in ext3" depends on EXT3_FS help Only metadata are journaled. Data is written first and then metadata is update. Mostly safe against crashes, power failures, etc., except if the anomally occurred while a file is being overwritten. Most of the time files are appended and not over written. config EXT3_DEFAULTS_TO_WRITEBACK bool "Default to 'data=writeback' in ext3" depends on EXT3_FS help Ext2 with a fast ckfs. Not always safe against crashes, power failure, etc., but has the best preformance endchoice 
+1
source

Source: https://habr.com/ru/post/897651/


All Articles