在Ubuntu 14.04中禁用日志记录?

我安装了Xubuntu(有时运行Cinnamon,但我岔开话题了),想要禁用日志记录以使文件碎片化对ext4系统分区的清除更加有效(非系统/应用数据存储在NTFS分区上)。如何实现这一目标?
1个回答

无论你做什么,在操作文件系统之前,请先备份! 在使用之前,请查阅手册(man tune2fs)! 此操作仅适用于ext文件系统! 要禁用日志记录,可以使用以下命令(其中XN指向你的分区字母和数字):
tune2fs -O ^has_journal /dev/sdXN

从man页面中:

tune2fs - adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems

Option: -O [^]feature[,...]

Set or clear the indicated filesystem features (options) in the filesystem. More than one filesystem feature can be cleared or set by separating features with commas. Filesystem features prefixed with a caret character ('^') will be cleared in the filesystem's superblock; filesystem features without a prefix character or prefixed with a plus character ('+') will be added to the filesystem.

...

has_journal

Use a journal to ensure filesystem consistency even across unclean shutdowns. Setting the filesystem feature is equivalent to using the -j option.

你可能还需要...
选项:-f
即使面临错误,也强制完成tune2fs操作。当从具有外部日志(或损坏以至于看起来具有外部日志)的文件系统中删除has_journal文件系统特性时,此选项非常有用,但该外部日志不可用。
警告:在未首先回放外部日志的情况下从未正确卸载的文件系统中删除外部日志可能导致严重的数据丢失和文件系统损坏。
文件系统需要被卸载或者处于只读模式。从grub提示符下:选择“高级选项” -> “恢复模式” -> “切换到root shell提示符” 或者使用Live DVD。

1只有在文件系统未挂载或以只读方式挂载时,才能清除 has_journal 特性。我需要启动活动光盘才能执行这个操作吗? - Utnubu
不,你也可以在 grub 提示符下完成,但这是最简单的方法。 - Rinzwind