您的位置:首页 > 其它

得到文件系统的相关信息

2013-04-05 22:53 344 查看
1.利用dumpe2fs命令来得到文件系统的相关信息。

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: user_xattr acl (--默认挂载参数)
Filesystem state: clean (--系统没问题)
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 6566400
Block count: 26214400
Reserved block count: 1310732
Free blocks: 25099755
Free inodes: 6475104
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1017
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8208
Inode blocks per group: 513
Flex block group size: 16
Filesystem created: Thu Mar 28 04:48:50 2013
Last mount time: Sat Mar 30 09:20:08 2013
Last write time: Thu Mar 28 05:08:34 2013
Mount count: 6
Maximum mount count: -1
Last checked: Thu Mar 28 04:48:50 2013
Check interval: 0 (<none>)
Lifetime writes: 6475 MB
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(---日志文件的inode号)
First orphan inode: 6041110
Default directory hash: half_md4
Directory Hash Seed: 3ddbebed-df72-4990-b8f6-bf28d838e3ac
Journal backup: inode blocks
Journal features: journal_incompat_revoke
日志大小: 128M
Journal length: 32768
Journal sequence: 0x00001549
Journal start: 1

Group 0: (Blocks 0-32767) [ITABLE_ZEROED]
校验和 0xc33f,8196个未使用的inode
主 superblock at 0, Group descriptors at 1-7
保留的GDT块位于 8-1024
Block bitmap at 1025 (+1025), Inode bitmap at 1041 (+1041)
Inode表位于 1057-1569 (+1057)
23456 free blocks, 8196 free inodes, 2 directories, 8196个未使用的inodes
可用块数: 9312-32767
可用inode数: 13-8208
Group 1: (Blocks 32768-65535) [INODE_UNINIT, ITABLE_ZEROED](省略。)

2.目录树的读取(---要搞清流程)
通过挂载的信息可以得到挂载点的inode号码(通常一个文件系统的inode号码由2开始),此时可以得到根目录的inode内容
并依据inode读取/的block内的文件名数据,再依次一层一层往下读取真确的文件名
[root@localhost ~]# ll -di / /etc /etc/passwd
2 dr-xr-xr-x. 23 root
root 4096 3月 30 09:20 /
6303745 drwxr-xr-x. 97 root root 4096 3月 30 09:21 /etc
6305420 -rw-r--r--. 1 root root 1606 3月 28 05:11 /etc/passwd
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: