mount -o dio,rw /dev/sda6 /opt
作为根.
系统响应:
mount: wrong fs type,bad option,bad superblock on /dev/hda2
dmesg报道:
EXT4-fs (sda6): Unrecognized mount option "dio" or missing value.
我无法确定要设置哪个参数来启用直接I / O(即使可以为ext4安装直接I / O).除此之外,如果ext4不支持直接I / O,有人可以指出一个在Linux上使用的文件系统吗?
解决方法
Controls whether or not ext4 should use
the dio read locking. If the dioread_nolock option is specified ext4
will allocate uninitialized extent before buffer write and convert the
extent to initialized after IO completes.This approach allows ext4 code to avoid using inode mutex,which
improves scalability on high speed storages. However this does not
work with data journaling and dioread_nolock option will be ignored
with kernel warning. Note that dioread_nolock code path is only used
for extent-based files. Because of the restrictions this options
comprises it is off by default (e.g. dioread_lock).
也就是说,正如其他人所提到的,直接I / O通常是通过在open(2)系统调用中设置O_DIRECT标志来启用的 – 即,它由应用程序控制,而不是挂载选项.除非您使用data = journal mount选项(参见ext4 documentation和this commit),否则ext4支持O_DIRECT.
对于InnoDB,我知道innodb_flush_method参数可用于启用O_DIRECT,但我不知道MyISAM的类似设置?