| 1 | [[PageOutline]] |
| 2 | |
| 3 | = ext4lazyinit = |
| 4 | * [https://forums.ubuntulinux.jp/viewtopic.php?id=11895 Ubuntu日本語フォーラム / HDDに書き込み続ける] |
| 5 | * https://twitter.com/__nlkl/status/108910649106644992 |
| 6 | > HDDを増設したら何かがHDDにアクセスし続けてる。原因はext4lazyinitというカーネルスレッドのようだ。2.6.37から入った機能で、inodeテーブルの作成を遅延させてmkfsを高速化するらしい。確かにmkfsが異様にはやかった気がする。 |
| 7 | * [http://lists.fedoraproject.org/pipermail/users/2011-November/408441.html ext4lazyinit?] |
| 8 | * [http://lists.fedoraproject.org/pipermail/users/2011-November/408445.html ext4lazyinit?] |
| 9 | > So when you have millions of files the backup takes many hours. |
| 10 | * [http://ubuntuforums.org/showthread.php?t=2018313 [ubuntu] Constant Hard Drive Access - Ubuntu Forums] |
| 11 | * [http://forums.gentoo.org/viewtopic-t-921108-start-0.html Gentoo Forums :: View topic - ext4-dio-unwrit / ext4lazyinit processes] |
| 12 | > 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. |
| 13 | |
| 14 | * Ubuntu 12.04.1 x86_64で作ったext4のfeature |
| 15 | * sudo mkfs.ext4 /dev/md0 -m 1 |
| 16 | * sudo tune2fs -l /dev/md0 |
| 17 | {{{ |
| 18 | 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 |
| 19 | Filesystem flags: signed_directory_hash |
| 20 | Default mount options: user_xattr acl |
| 21 | }}} |
| 22 | |
| 23 | * man mke2fs |
| 24 | {{{ |
| 25 | -E extended-options |
| 26 | lazy_itable_init[= <0 to disable, 1 to enable>] |
| 27 | If enabled and the uninit_bg feature is enabled, the |
| 28 | inode table will not be fully initialized by mke2fs. |
| 29 | This speeds up filesystem initialization noticeably, |
| 30 | but it requires the kernel to finish initializing |
| 31 | the filesystem in the background when the filesystem |
| 32 | is first mounted. If the option value is omitted, |
| 33 | it defaults to 1 to enable lazy inode table zeroing. |
| 34 | |
| 35 | lazy_journal_init[= <0 to disable, 1 to enable>] |
| 36 | If enabled, the journal inode will not be fully |
| 37 | zeroed out by mke2fs. This speeds up filesystem |
| 38 | initialization noticeably, but carries some small |
| 39 | risk if the system crashes before the journal has |
| 40 | been overwritten entirely one time. If the option |
| 41 | value is omitted, it defaults to 1 to enable lazy |
| 42 | journal inode zeroing. |
| 43 | |
| 44 | (snip) |
| 45 | |
| 46 | -O feature[,...] |
| 47 | uninit_bg |
| 48 | Create a filesystem without initializing all of the |
| 49 | block groups. This feature also enables checksums |
| 50 | and highest-inode-used statistics in each block‐ |
| 51 | group. This feature can speed up filesystem cre‐ |
| 52 | ation time noticeably (if lazy_itable_init is |
| 53 | enabled), and can also reduce e2fsck time dramati‐ |
| 54 | cally. It is only supported by the ext4 filesystem |
| 55 | in recent Linux kernels. |
| 56 | }}} |
| 57 | * /etc/mke2fs.conf |
| 58 | {{{ |
| 59 | [defaults] |
| 60 | base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr |
| 61 | default_mntopts = acl,user_xattr |
| 62 | enable_periodic_fsck = 0 |
| 63 | blocksize = 4096 |
| 64 | inode_size = 256 |
| 65 | inode_ratio = 16384 |
| 66 | |
| 67 | [fs_types] |
| 68 | ext3 = { |
| 69 | features = has_journal |
| 70 | } |
| 71 | ext4 = { |
| 72 | features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize |
| 73 | auto_64-bit_support = 1 |
| 74 | inode_size = 256 |
| 75 | } |
| 76 | ext4dev = { |
| 77 | features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize |
| 78 | inode_size = 256 |
| 79 | options = test_fs=1 |
| 80 | } |
| 81 | }}} |