Version 3 (modified by mitty, 12 years ago) (diff) |
---|
ext4lazyinit
- Ubuntu日本語フォーラム / HDDに書き込み続ける
- https://twitter.com/__nlkl/status/108910649106644992
HDDを増設したら何かがHDDにアクセスし続けてる。原因はext4lazyinitというカーネルスレッドのようだ。2.6.37から入った機能で、inodeテーブルの作成を遅延させてmkfsを高速化するらしい。確かにmkfsが異様にはやかった気がする。
- ext4lazyinit?
- ext4lazyinit?
So when you have millions of files the backup takes many hours.
- ext4lazyinit?
- [ubuntu Constant Hard Drive Access - Ubuntu Forums]
- Gentoo Forums :: View topic - ext4-dio-unwrit / ext4lazyinit processes
ext4 has the feature of "lazy init" which basically means formatting doesn't complete when mkfs finishes, but that some of the formatting gets done upon first mount.
- Ubuntu 12.04.1 x86_64で作ったext4のfeature
- sudo mkfs.ext4 /dev/md0 -m 1
- sudo tune2fs -l /dev/md0
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl
- man mke2fs
-E extended-options lazy_itable_init[= <0 to disable, 1 to enable>] If enabled and the uninit_bg feature is enabled, the inode table will not be fully initialized by mke2fs. This speeds up filesystem initialization noticeably, but it requires the kernel to finish initializing the filesystem in the background when the filesystem is first mounted. If the option value is omitted, it defaults to 1 to enable lazy inode table zeroing. lazy_journal_init[= <0 to disable, 1 to enable>] If enabled, the journal inode will not be fully zeroed out by mke2fs. This speeds up filesystem initialization noticeably, but carries some small risk if the system crashes before the journal has been overwritten entirely one time. If the option value is omitted, it defaults to 1 to enable lazy journal inode zeroing. (snip) -O feature[,...] uninit_bg Create a filesystem without initializing all of the block groups. This feature also enables checksums and highest-inode-used statistics in each block‐ group. This feature can speed up filesystem cre‐ ation time noticeably (if lazy_itable_init is enabled), and can also reduce e2fsck time dramati‐ cally. It is only supported by the ext4 filesystem in recent Linux kernels.
- /etc/mke2fs.conf
[defaults] base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr default_mntopts = acl,user_xattr enable_periodic_fsck = 0 blocksize = 4096 inode_size = 256 inode_ratio = 16384 [fs_types] ext3 = { features = has_journal } ext4 = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize auto_64-bit_support = 1 inode_size = 256 } ext4dev = { features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize inode_size = 256 options = test_fs=1 }
- lvm - mkfs.ext4 is taking hours to complete on 4TB raid 5 - Server Fault
Note that lazy_itable_init is turned on by default if the kernel you are running supports automatic background initialization of the inode table ( 2.6.37+ ). Without that support, enabling this option is unsafe as it leaves the inode tables uninitialized, so they may contain garbage that fsck will mistake as valid inodes under certain circumstances. Also uninit_bg is enabled by default for ext4.