关闭EXT4日志功能:
[root@localhost ext4]# tune2fs -O ^has_journal /dev/sdd1
tune2fs 1.42 (29-Nov-2011)
[root@localhost ext4]# dumpe2fs /dev/sdd1 | grep ‘Filesystem features‘ | grep ‘has_journal‘
dumpe2fs 1.42 (29-Nov-2011)
开启EXT4日志功能:
[root@localhost ext4]# tune2fs -O has_journal /dev/sdd1
tune2fs 1.42 (29-Nov-2011)
Creating journal inode: done
[root@localhost ext4]# dumpe2fs /dev/sdd1 | grep ‘Filesystem features‘ | grep ‘has_journal‘
dumpe2fs 1.42 (29-Nov-2011)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
动态关闭和打开日志功能后可能需要对文件系统进行fsck检查,避免出错:
[root@localhost ext4]# fsck.ext4 -f /dev/sdd1
e2fsck 1.42 (29-Nov-2011)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdd1: 11/262144 files (0.0% non-contiguous), 18510/1048233 blocks
更多ext4特性的开启与关闭可以查看man手册:“man mkfs.ext4”的-O选项。
禁用ext4的日志功能后有少许的性能提升:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0390131ba84fd3f726f9e24fc4553828125700bb
原文:http://blog.51cto.com/461205160/2314401