- UID
- 1029342
- 性别
- 男
|
- Superblock backups stored on blocks:
- 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
这是格式化loop设备输出到终端的result信息,因为每个块组是8192个块(原因后面讲),所以第0个块组 ,第1块组,第3个块组 第5个块组,第7个块组,第9个块组,第25个块组,第27个块组,第49个块组存储有超级块。
怎么计算出来的,为什么非要存在这些块组?计算规则是3 5 和7的幂,这样的块组保存超级块。
解释块组描述符之前我们先看下超级块的相关信息:
- struct ext2_super_block {
- __u32 s_inodes_count;
- __u32 s_blocks_count;
- __u32 s_r_blocks_count;
- __u32 s_free_blocks_count;
- __u32 s_free_inodes_count;
- __u32 s_first_data_block;
- __u32 s_log_block_size;
- __u32 s_dummy3[7];
- unsigned char s_magic[2];
- __u16 s_state;
- ...
-
- }
下面我们通过debugfs来获取一下ext2的相关信息。
- root@libin:/mnt/bean# dumpe2fs /dev/loop0
- dumpe2fs 1.41.11 (14-Mar-2010)
- Filesystem volume name: <none>
- Last mounted on: <not available>
- Filesystem UUID: 3bff7535-6f39-4720-9b64-1dc8cf9fe61d
- Filesystem magic number: 0xEF53
- Filesystem revision #: 1 (dynamic)
- Filesystem features: ext_attr resize_inode dir_index filetype sparse_super
- Filesystem flags: signed_directory_hash
- Default mount options: (none)
- Filesystem state: not clean
- Errors behavior: Continue
- Filesystem OS type: Linux
- Inode count: 128016
- Block count: 512000
- Reserved block count: 25600
- Free blocks: 493526
- Free inodes: 128005
- First block: 1
- Block size: 1024
- Fragment size: 1024
- Reserved GDT blocks: 256
- Blocks per group: 8192
- Fragments per group: 8192
- Inodes per group: 2032
- Inode blocks per group: 254
- Filesystem created: Fri Jul 6 22:31:09 2012
- Last mount time: Fri Jul 6 22:33:28 2012
- Last write time: Fri Jul 6 22:33:28 2012
- Mount count: 1
- Maximum mount count: 24
- Last checked: Fri Jul 6 22:31:09 2012
- Check interval: 15552000 (6 months)
- Next check after: Wed Jan 2 22:31:09 2013
- Reserved blocks uid: 0 (user root)
- Reserved blocks gid: 0 (group root)
- First inode: 11
- Inode size: 128
- Default directory hash: half_md4
- Directory Hash Seed: 0140915d-91ae-43df-9d84-9536cedc0d2b
-
- Group 0: (Blocks 1-8192)
- 主 superblock at 1, Group descriptors at 2-3
- 保留的GDT块位于 4-259
- Block bitmap at 260 ( 259), Inode bitmap at 261 ( 260)
- Inode表位于 262-515 ( 261)
- 7663 free blocks, 2021 free inodes, 2 directories
- 可用块数: 530-8192
- 可用inode数: 12-2032
- ...
- Group 62: (Blocks 507905-511999)
-
- Block bitmap at 507905 (+0), Inode bitmap at 507906 (+1)
- Inode表位于 507907-508160 (+2)
- 3839 free blocks, 2032 free inodes, 0 directories
- 可用块数: 508161-511999
- 可用inode数: 125985-128016
|
|