ext4 笔记二(dumpe2fs)

转自:http://wiki.debian.org.hk/wiki/index.php?title=Show_Ext2/Ext3/Ext4_filesystem_information&variant=zh-cn

显示 Ext2/Ext3/Ext4 档案系统资讯

要显示一个 Ext2/Ext3/Ext4 档案系统的资讯,可以使用 e2fsprogs 中的 dumpe2fs 或 tune2fs -l 命令,例如:

dumpe2fs /dev/sda6

或者

tune2fs -l /dev/sdb7

dumpe2fs 会显示 superblock 上的档案系统资讯和每个区块组 (block group) 的资讯,在一般拥有很多区块组档案系统,会佔据很长的画面。而 tune2fs -l 只会显示 superblock 上的资讯。如果您只想看 superblock 上关整个档案系统的资讯,除了使用 tune2fs -l 外,亦可以在 dumpe2fs 加上 -h 选项:

dumpe2fs -h /dev/sda6

目录

  [隐藏]
[ 编辑]

dumpe2fs/tune2fs -l 画面

以下是一个典型的 dumpe2fs 画面:

Filesystem volume name:   /home
Last mounted on:          <not available>
Filesystem UUID:          d7a9f647-3364-4ed9-824e-63cd748458bc
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:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              524288
Block count:              2096466
Reserved block count:     104823
Free blocks:              1426242
Free inodes:              518632
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      511
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Mon Dec 15 12:53:47 2008
Last mount time:          n/a
Last write time:          Wed Dec 31 23:15:43 2008
Mount count:              0
Maximum mount count:      23
Last checked:             Sun Dec 28 10:21:57 2008
Check interval:           15552000 (6 months)
Next check after:         Fri Jun 26 10:21:57 2009
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
Default directory hash:   half_md4
Directory Hash Seed:      17e9c71d-5a16-47ad-b478-7c6bc3178f1d
Journal backup:           inode blocks
Journal size:             128M


Group 0: (Blocks 0-32767) [ITABLE_ZEROED]
  Checksum 0x5ca1, unused inodes 8181
  Primary superblock at 0, Group descriptors at 1-1
  Reserved GDT blocks at 2-512
  Block bitmap at 513 (+513), Inode bitmap at 529 (+529)
  Inode table at 545-1056 (+545)
  24025 free blocks, 8181 free inodes, 2 directories, 8181 unused inodes
  Free blocks: 8743-32767
  Free inodes: 12-8192
Group 1: (Blocks 32768-65535) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0xa83d, unused inodes 8192
  Backup superblock at 32768, Group descriptors at 32769-32769
  Reserved GDT blocks at 32770-33280
  Block bitmap at 514, Inode bitmap at 530
  Inode table at 1057-1568
  32255 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes
  Free blocks: 33281-65535
  Free inodes: 
...
Group 63: (Blocks 2064384-2096465) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x1f29, unused inodes 8192
  Block bitmap at 1572879, Inode bitmap at 1572895
  Inode table at 1580576-1581087
  32082 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes
  Free blocks: 2064384-2096465
  Free inodes:
[ 编辑]

档案系统资讯

  • 档案系统 volume 名称 (Filesystem volume name) - 即是档案系统标签 (Filesystem label),用作简述该档案系统的用途或其储存数据。现时 GNU/Linux 都会用 USB 手指/IEEE1394 硬盘等可移除储存装置的档案系统标签作为其挂载目录的名称,方便使用者识别。而个别 GNU/Linux distribution如 FedoraRHEL 和 CentOS 等亦在 fstab 取代传统装置档案名称 (即 /dev/sda1 和 /dev/hdc5 等) 的指定开机时要挂载的档案系统,避免偶然因为 BIOS 设定或插入次序的改变而引起的混乱。可以使用命令 e2label 或 tune2fs -L 改变
  • 上一次挂载于 (Last mounted on)' - 上一次挂载档案系统的挂载点路径,此栏一般为空,很少使用。可以使用命令 tune2fs -M 设定。
  • 档案系统 UUID (Filesystem UUID) - 一个一般由乱数产生的识别码,可以用来识别档案系统。个别 GNU/Linux distribution 如 Ubuntu] 等亦在 fstab 取代传统装置档案名称 (即 /dev/sda1 和 /dev/hdc5 等) 的指定开机时要挂载的档案系统,避免偶然因为 BIOS 设定或插入次序的改变而引起的混乱。可以使用命令 tune2fs -U 改变
  • (Filesystem magic number) - 用来识别此档案系统为 Ext2/Ext3/Ext4 的签名,位置在档案系统的 0x0438 - 0x0439 (Superblock 的 0x38-0x39),现时必定是 0xEF53。
  • 档案系统版本编号 (Filesystem revision #) - 档案系统微版本编号,只可以在格式化时使用 mke2fs -r 设定。现在只支援[1]
    • 0 - 原始格式,Linux 1.2 或以前只支援此格式[2]
    • 1 (dymanic) - V2 格式支援动态 inode 大小 (现时一般都使用此版本)
  • 档案系统功能 (Filesystem features) - 开启了的档案系统功能,可以使用合令 tune2fs -O 改变。现在可以有以下功能:
    • has_journal - 有日志 (journal),亦代表此档案系统必为 Ext3 或 Ext4
    • ext_attr - 支援 extended attribute
    • resize_inode - resize2fs 可以加大档案系统大小
    • dir_index - 支援目录索引,可以加快在大目录中搜索档案。
    • filetype - 目录项目为否记录档案类型
    • needs_recovery - e2fsck 检查 Ext3/Ext4 档案系统时用来决定是否需要完成日志纪录中未完成的工作,快速自动修复档案系统
    • extent - 支援 Ext4 extent 功能,可以加快档案系系效能和减少 external fragmentation
    • flex_bg
    • sparse_super - 只有少数 superblock 备份,而不是每个区块组都有 superblock 备份,节省空间。
    • large_file - 支援大于 2GiB 的档案
    • huge_file
    • uninit_bg
    • dir_nlink
    • extra_isize
  • 档案系统旗号 (Filesystem flags) - signed_directory_hash
  • 缺省挂载选项 (Default mount options) - 挂载此档案系统缺省会使用的选项
  • 档案系统状态 (Filesystem state) - 可以为 clean (档案系统已成功地被卸载)、not-clean (表示档案系统挂载成读写模式后,仍未被卸载) 或 erroneous (档案系统被发现有问题)
  • 错误处理方案 (Errors behavior) - 档案系统发生问题时的处理方案,可以为 continue (继续正常运作) 、remount-ro (重新挂载成只读模式) 或 panic (即时当掉系统)。可以使用 tune2fs -e 改变
  • 作业系统类型 (Filesystem OS type) - 建立档案系统的作业系统,可以为 Linux/Hurd/MASIX/FreeBSD/Lites[1]
  • Inode 数目 (Inode count) - 档案系统的总 inode 数目,亦是整个档案系统所可能拥有档案数目的上限
  • 区块数目 (Block count) - 档案系统的总区块数目
  • 保留区块数目 (Reserved block count) - 保留给系统管理员工作之用的区块数目
  • 未使用区块数目 (Free blocks) - 未使用区块数目
  • 未使用 inode 数目 (Free inodes) - 未使用 inode 数目
  • 第一个区块编数 (First block) - Superblock 或第一个区块组开始的区块编数。此值在 1 KiB 区块大小的档案系统为 1,大于1 KiB 区块大小的档案系统为 0。(Superblock/第一个区块组一般都在档案系统 0x0400 (1024) 开始)[1]
  • 区块大小 (Block size) - 区块大小,可以为 1024, 2048 或 4096 字节 (Compaq Alpha 系统可以使用 8192 字节的区块)
  • Fragment 大小 (Fragment size) - 实际上 Ext2/Ext3/Ext4 未有支援 Fragment,所以此值一般和区块大小一样
  • 保留 GDT 区块数目 (Reserved GDT blocks) - 保留作在线 (online) 改变档案系统大小的区块数目。若此值为 0,只可以先卸载才可脱机改变档案系统大小[3]
  • 区块/组 (Blocks per group) - 每个区块组的区块数目
  • Fragments/组 (Fragments per group) - 每个区块组的 fragment 数目,亦用来计算每个区块组中 block bitmap 的大小
  • Inodes/组 (Inodes per group) - 每个区块组的 inode 数目
  • Inode 区块/组 (Inode blocks per group) - 每个区块组的 inode 区块数目
  • (Flex block group size) - 16
  • 档案系统建立时间 (Filesystem created) - 格式化此档案系统的时间
  • 最后挂载时间 (Last mount time) - 上一次挂载此档案系统的时间
  • 最后改动时间 (Last write time) - 上一次改变此档案系统内容的时间
  • 挂载次数 (Mount count) - 距上一次作完整档案系统检查后档案系统被挂载的次数,让 fsck 决定是否应进行另一次完整档案系统检查
  • 最大挂载次数 (Maximum mount count) - 档案系统进行另一次完整检查可以被挂载的次数,若挂载次数 (Mount count) 大于此值,fsck 会进行另一次完整档案系统检查
  • 最后检查时间 (Last checked) - 上一次档案系统作完整检查的时间
  • 检查间距 (Check interval) - 档案系统应该进行另一次完整检查的最大时间距
  • 下次检查时间 (Next check after) - 下一次档案系统应该进行另一次完整检查的时间
  • 保留区块使用者识别码 (Reserved blocks uid) - 0 (user root)
  • 保留区块群组识别码 (Reserved blocks gid) - 0 (group root)
  • 第一个 inode (First inode) - 第一个可以用作存放正常档案属性的 inode 编号,在原格式此值一定为 11, V2 格式亦可以改变此值[1]
  • Inode 大小 (Inode size) - Inode 大小,传统为 128 字节,新系统会使用 256 字节的 inode 令扩充功能更方便
  • (Required extra isize) - 28
  • (Desired extra isize) - 28
  • 日志 inode (Journal inode) - 日志档案的 inode 编号
  • 缺省目录 hash 算法 (Default directory hash) - half_md4
  • 目录 hash 种子 (Directory Hash Seed) - 17e9c71d-5a16-47ad-b478-7c6bc3178f1d
  • 日志备份 (Journal backup) - inode blocks
  • 日志大小 (Journal size) - 日志档案的大小
  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值