解析ext4文件系统的布局
来源:互联网 发布:阿里云app备案 编辑:程序博客网 时间:2024/04/30 19:30
对于ext2文件系统的布局可能如下图所示
显然,图片中展示的是ext2文件系统的第一个块组(因为超级快位于起始1024字节后),可以看出对于一个block group来说,Super Block和Group Descriptors(一般1block)以及Reserverd GDT Blocks后面跟的Block Bitmap为1个块大小,同样inode Bitmap也是一个块大小,inode Table占固定块大小,也就是说从硬盘数据的布局来看,一个标准块组里面只包含自身块组的的block bitmap、inode Bitmap以及inode Table,可能包括super block和group description table的备份。一个典型的例子如下图所示:
但是,我在使用dumpe2fs命令查看ubuntu的ext4文件系统时,发现从ext2块组的硬盘布局来说,一个块组所包括的块范围中可能并不止是包含自己块组的block bitmap、inode Bitmap以及inode Table,一个块组内可能存放着其他块组的block bitmap、inode Bitmap以及inode Table。它是每16个块组为单位,将这16个块组的所有block bitmap、inode Bitmap以及inode Table都放在16个块组的第一个块组内,同理,某个快组范围内的块可能不包括自己块组的block bitmap,inode bitmap和inode Table.具体见下面ext4文件系统结构信息。
Filesystem volume name: <none>Last mounted on: /Filesystem UUID: 0fbdfdd4-80ea-4962-84e8-9173c5ef1cb5Filesystem magic number: 0xEF53Filesystem 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_isizeFilesystem flags: signed_directory_hash Default mount options: user_xattr aclFilesystem state: cleanErrors behavior: ContinueFilesystem OS type: LinuxInode count: 6037504Block count: 24146432Reserved block count: 1207321Free blocks: 20876199Free inodes: 5787665First block: 0Block size: 4096Fragment size: 4096Reserved GDT blocks: 1018Blocks per group: 32768Fragments per group: 32768Inodes per group: 8192Inode blocks per group: 512Flex block group size: 16Filesystem created: Sun Jan 8 01:10:30 2017Last mount time: Sat Feb 18 11:26:16 2017Last write time: Sat Feb 18 19:26:08 2017Mount count: 150Maximum mount count: -1Last checked: Sun Jan 8 01:10:30 2017Check interval: 0 (<none>)Lifetime writes: 31 GBReserved blocks uid: 0 (user root)Reserved blocks gid: 0 (group root)First inode: 11Inode size: 256Required extra isize: 28Desired extra isize: 28Journal inode: 8First orphan inode: 2250909Default directory hash: half_md4Directory Hash Seed: 4c440967-7d09-4b9b-b3be-74a8d8bc47caJournal backup: inode blocksJournal features: journal_incompat_revokeJournal size: 128MJournal length: 32768Journal sequence: 0x0001f82eJournal start: 1Group 0: (Blocks 0-32767) [ITABLE_ZEROED] Checksum 0x5119, unused inodes 5265 Primary superblock at 0, Group descriptors at 1-6 Reserved GDT blocks at 7-1024 Block bitmap at 1025 (+1025), Inode bitmap at 1041 (+1041) Inode table at 1057-1568 (+1057) 22919 free blocks, 5287 free inodes, 592 directories, 5265 unused inodes Free blocks: 9255-9350, 9354-9500, 9529-10104, 10461-10462, 10490-10492, 10673-32767 Free inodes: 1219-1226, 1335-1345, 1637-1639, 2928-8192Group 1: (Blocks 32768-65535) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xd779, unused inodes 8192 Backup superblock at 32768, Group descriptors at 32769-32774 Reserved GDT blocks at 32775-33792 Block bitmap at 1026 (bg #0 + 1026), Inode bitmap at 1042 (bg #0 + 1042) Inode table at 1569-2080 (bg #0 + 1569) 23155 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 34151-34160, 34784-34812, 34868-34904, 34906-35013, 35064-35071, 35182-35839, 35865-36735, 36806-38911, 38936-38938, 39054-39057, 39061-39080, 39082-39849, 39932-39934, 39936-39939, 39948-39976, 39980-40027, 41007-41009, 41015-41016, 41018-41020, 41022, 41651-41653, 41655, 41694-41696, 41761, 41767-41830, 41832-41906, 41922, 41934, 42028-42029, 42033-55295, 56576-56622, 56640-56656, 56832-56879, 57344-59391, 59538-60415, 60896-60912, 63565-65535 Free inodes: 8193-16384Group 2: (Blocks 65536-98303) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x2ad8, unused inodes 8192 Block bitmap at 1027 (bg #0 + 1027), Inode bitmap at 1043 (bg #0 + 1043) Inode table at 2081-2592 (bg #0 + 2081) 28124 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 65536-71423, 71458-71551, 71627-71679, 73728-74541, 74981-75775, 77824-98303 Free inodes: 16385-24576Group 3: (Blocks 98304-131071) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x7ac4, unused inodes 8192 Backup superblock at 98304, Group descriptors at 98305-98310 Reserved GDT blocks at 98311-99328 Block bitmap at 1028 (bg #0 + 1028), Inode bitmap at 1044 (bg #0 + 1044) Inode table at 2593-3104 (bg #0 + 2593) 29970 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 99355-99359, 99391-101375, 102400-102911, 102964-103423, 103988-116223, 116300-131071 Free inodes: 24577-32768Group 4: (Blocks 131072-163839) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xafa8, unused inodes 8192 Block bitmap at 1029 (bg #0 + 1029), Inode bitmap at 1045 (bg #0 + 1045) Inode table at 3105-3616 (bg #0 + 3105) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 131072-163839 Free inodes: 32769-40960Group 5: (Blocks 163840-196607) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x35b1, unused inodes 8192 Backup superblock at 163840, Group descriptors at 163841-163846 Reserved GDT blocks at 163847-164864 Block bitmap at 1030 (bg #0 + 1030), Inode bitmap at 1046 (bg #0 + 1046) Inode table at 3617-4128 (bg #0 + 3617) 31743 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 164865-196607 Free inodes: 40961-49152Group 6: (Blocks 196608-229375) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x7786, unused inodes 8192 Block bitmap at 1031 (bg #0 + 1031), Inode bitmap at 1047 (bg #0 + 1047) Inode table at 4129-4640 (bg #0 + 4129) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 196608-229375 Free inodes: 49153-57344Group 7: (Blocks 229376-262143) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xadb9, unused inodes 8192 Backup superblock at 229376, Group descriptors at 229377-229382 Reserved GDT blocks at 229383-230400 Block bitmap at 1032 (bg #0 + 1032), Inode bitmap at 1048 (bg #0 + 1048) Inode table at 4641-5152 (bg #0 + 4641) 31743 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 230401-262143 Free inodes: 57345-65536Group 8: (Blocks 262144-294911) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xd0b4, unused inodes 8192 Block bitmap at 1033 (bg #0 + 1033), Inode bitmap at 1049 (bg #0 + 1049) Inode table at 5153-5664 (bg #0 + 5153) 32758 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 262144-267903, 267913-267974, 267976-294911 Free inodes: 65537-73728Group 9: (Blocks 294912-327679) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x300f, unused inodes 8192 Backup superblock at 294912, Group descriptors at 294913-294918 Reserved GDT blocks at 294919-295936 Block bitmap at 1034 (bg #0 + 1034), Inode bitmap at 1050 (bg #0 + 1050) Inode table at 5665-6176 (bg #0 + 5665) 31743 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 295937-327679 Free inodes: 73729-81920Group 10: (Blocks 327680-360447) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xe32a, unused inodes 8192 Block bitmap at 1035 (bg #0 + 1035), Inode bitmap at 1051 (bg #0 + 1051) Inode table at 6177-6688 (bg #0 + 6177) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 327680-360447 Free inodes: 81921-90112Group 11: (Blocks 360448-393215) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x63e2, unused inodes 8192 Block bitmap at 1036 (bg #0 + 1036), Inode bitmap at 1052 (bg #0 + 1052) Inode table at 6689-7200 (bg #0 + 6689) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 360448-393215 Free inodes: 90113-98304Group 12: (Blocks 393216-425983) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xa97c, unused inodes 8192 Block bitmap at 1037 (bg #0 + 1037), Inode bitmap at 1053 (bg #0 + 1053) Inode table at 7201-7712 (bg #0 + 7201) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 393216-425983 Free inodes: 98305-106496Group 13: (Blocks 425984-458751) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x1656, unused inodes 8192 Block bitmap at 1038 (bg #0 + 1038), Inode bitmap at 1054 (bg #0 + 1054) Inode table at 7713-8224 (bg #0 + 7713) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 425984-458751 Free inodes: 106497-114688Group 14: (Blocks 458752-491519) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x1375, unused inodes 8192 Block bitmap at 1039 (bg #0 + 1039), Inode bitmap at 1055 (bg #0 + 1055) Inode table at 8225-8736 (bg #0 + 8225) 32768 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 458752-491519 Free inodes: 114689-122880Group 15: (Blocks 491520-524287) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xc64f, unused inodes 8192 Block bitmap at 1040 (bg #0 + 1040), Inode bitmap at 1056 (bg #0 + 1056) Inode table at 8737-9248 (bg #0 + 8737) 27511 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 491520-504959, 505048-516095, 521237-522911, 522940-524287 Free inodes: 122881-131072Group 16: (Blocks 524288-557055) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xe6b2, unused inodes 8192 Block bitmap at 524288 (+0), Inode bitmap at 524304 (+16) Inode table at 524320-524831 (+32) 24544 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 532512-557055 Free inodes: 131073-139264Group 17: (Blocks 557056-589823) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x6b5f, unused inodes 8192 Block bitmap at 524289 (bg #16 + 1), Inode bitmap at 524305 (bg #16 + 17) Inode table at 524832-525343 (bg #16 + 544) 28480 free blocks, 8192 free inodes, 0 directories, 8192 unused inodes Free blocks: 561244-561279, 561380-589823 Free inodes: 139265-147456
参考资料:
ext2文件系统
ext4文件系统维基百科
0 0
- 解析ext4文件系统的布局
- EXT4文件系统的磁盘布局
- EXT4 之 文件系统在磁盘上的布局 之一
- Ext4文件系统的特色
- Ext3和Ext4文件系统磁盘布局
- ext4的Extent解析
- ext4的extent解析
- EXt4 文件系统
- ext4文件系统
- ext4文件系统
- ext4 文件系统
- EXT4文件系统误格式化的恢复
- linux新增硬盘,做ext4的文件系统
- [转]Uboot对Ext4文件系统的支持
- Ext4文件系统的特性和功能简介
- Windows下查看Linux的ext4文件系统
- EXT4文件系统代码阅读的一点思考
- [转]Uboot对Ext4文件系统的支持
- Linux三种时间参数的意义,touchh和find使用方法
- 深度学习论文笔记:Rich feature hierarchies for accurate object detection and semantic segmentation
- HDU1263_水果_stl的map的嵌套用法
- 唯品会纽约时装周开启95后时装秀 消费C2F时代真的要来了!
- ANDROID-漂浮背景效果
- 解析ext4文件系统的布局
- h5学习笔记:weui
- Chrome快捷键大全
- 关于博达CMS制作网站的心得与体会
- MXNet官方文档教程(5):CPU&GPU多维数组
- Python文件的编码注释 utf-8
- Linux下C语言应用编程——GCC和GDB的使用
- ## 2017.02.18队内胡策(三) 斗地主 ##暴力模拟
- Android Studio versionCode 自增 打包命名