[[PageOutline]] * [http://hackerslab.aktsk.jp/technology/ext4-resize2fs-cmd/ resize2fsコマンドはどのようにして1秒未満での容量拡張を実現しているのか | Akatsuki Hackers Lab アカツキハッカーズラボ] * [http://d.hatena.ne.jp/incarose86/20150301/1425231302 ext4 ファイルシステムのオーバーヘッドを厳密に理解する - とあるSIerの憂鬱] = ext4lazyinit = * [https://forums.ubuntulinux.jp/viewtopic.php?id=11895 Ubuntu日本語フォーラム / HDDに書き込み続ける] * https://twitter.com/__nlkl/status/108910649106644992 > HDDを増設したら何かがHDDにアクセスし続けてる。原因はext4lazyinitというカーネルスレッドのようだ。2.6.37から入った機能で、inodeテーブルの作成を遅延させてmkfsを高速化するらしい。確かにmkfsが異様にはやかった気がする。 * [http://lists.fedoraproject.org/pipermail/users/2011-November/408441.html ext4lazyinit?] * [http://lists.fedoraproject.org/pipermail/users/2011-November/408445.html ext4lazyinit?] > So when you have millions of files the backup takes many hours. * [http://ubuntuforums.org/showthread.php?t=2018313 [ubuntu] Constant Hard Drive Access - Ubuntu Forums] * [http://forums.gentoo.org/viewtopic-t-921108-start-0.html 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 } }}} * [http://serverfault.com/questions/267393/mkfs-ext4-is-taking-hours-to-complete-on-4tb-raid-5 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. = Very long mount times of large ext4 filesystems - 12.04.1 LTS = * ~~TB級のext4をマウントしようとすると、数分以上待たされる~~ 現在は修正済 * [http://ubuntuforums.org/showthread.php?p=12257819 (64 bit) Very long mount times of large ext4 filesystems - 12.04.1 LTS - Ubuntu Forums] * [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1054605 Bug #1054605 “Mount very slow for 22TB ext4 filesystem on Ubuntu...” : Bugs : “linux” package : Ubuntu] > ext4: fix long mount times on very big file systems > > This commit was applied in v3.6-rc3. > > After further investigation, it seems that a fix may already exist in v3.2.29: