![une2fs 輸出中的“第一個孤立 inode”](https://rvso.com/image/36003/une2fs%20%E8%BC%B8%E5%87%BA%E4%B8%AD%E7%9A%84%E2%80%9C%E7%AC%AC%E4%B8%80%E5%80%8B%E5%AD%A4%E7%AB%8B%20inode%E2%80%9D.png)
我tune2fs -l /dev/sda
今天在生產伺服器上運行並得到以下輸出:
tune2fs 1.42.9 (4-Feb-2014)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: a5b1c696-aa59-43db-a252-88b2e6d8212c
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
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: journal_data user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 60923904
Block count: 243670272
Reserved block count: 12183513
Free blocks: 223441953
Free inodes: 60799595
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 965
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Fri May 9 19:48:11 2014
Last mount time: Fri Jun 6 20:17:28 2014
Last write time: Fri Jun 6 20:17:01 2014
Mount count: 1
Maximum mount count: -1
Last checked: Fri Jun 6 20:17:01 2014
Check interval: 0 (<none>)
Lifetime writes: 194 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
First orphan inode: 17301533
Default directory hash: half_md4
Directory Hash Seed: 1fbb5b3a-79fe-42b3-b69d-0f8073618d27
Journal backup: inode blocks
對我來說最突出的是這句話:
First orphan inode: 17301533
我一直將孤立 inode 理解為崩潰後留下的 inode。然而,有問題的檔案系統始終被乾淨地卸載,並且系統位於 UPS 上,並且從未被不乾淨地關閉過。
存在孤立 inode 是否有原因?
答案1
孤立 inode 是指已取消連結但在另一個行程中仍處於開啟狀態的 inode。例如,tail -f {file}
在一個 shell 中運行,然後rm {file}
在另一個 shell 中運行。檔案系統會追蹤這些內容,以便在進程退出時將其清除。