Android文件系统日记功能

ext3有3个日记选项:journal,ordered和writeback.根据维基百科entry,这些范围从最小风险到最危险的崩溃恢复.出于某种原因,Android的Linux版本仅支持后两个选项,默认为回写. (我正在经营Froyo)

有没有办法添加对日记模式的支持?我想在/ data分区上执行此操作,这是ext3,也是大多数文件写入的地方.我的设备没有电池,所以当有人断电时,我需要确保它是防撞的.

如果有人感兴趣,Linux选项在kernel / fs / ext3 / Kconfig中定义.具体选项是EXT3_DEFAULTS_TO_ORDERED.

最佳答案
解决方案是将以下内容添加到kernel / fs / ext3 / Kconfig,并使用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's 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,but has the best preformance

endchoice

相关文章

文件查找(find) 1 find 简单的说,就是实时查找指定的内容或条件。特点:最新、最快、最准确。 用法:...
非交互式添加分区 方法一 添加/deb/sdb 下的分区,其实位置为1到1000M,第二个分区位置为1001至3000M,...
编译安装httpd 1 去官网下载源码包 为避免非法软件,一定要去官网下载http://www.apache.org httpd-2.4...
gdisk用法 gdisk - InteractiveGUIDpartitiontable (GPT) manipulator GPTfdisk (akagdisk) isatext-mo...
1 一定用快捷键 这里简单的说下几个常用的快捷按键。 1.1 移动光标快捷键 Crtl + a 光标回到命令行...
bash shell中测试命令 test命令提供了if-than语句中测试不同条件的途径。如果test命令中列出的条件成立...