尝试这个: mkfs.ext4 -N 104 -m0 -O ^has_journal,^resize_inode /dev/purgatory/test1
我认为这确实可以让您了解“发生了什么”。
-N 104
(设置文件系统应具有的iNode数)
- 每个iNode都会“消耗” 可用空间(128字节)
-m 0
(无保留块)
-O ^has_journal,^resize_inode
(停用功能has_journal
和resize_inode
resize_inode
“花费” 可用空间(您看到的大部分1550 1K块/ 2%df
-12K用于“丢失+找到”文件夹)
has_journal
“花费” 可用空间(您的情况为4096个1K块)
我们102348
退出102400
,另外52个块不可用(如果我们已删除“丢失+找到”文件夹)。因此,我们潜入dumpe2fs
:
Group 0: (Blocks 1-8192) [ITABLE_ZEROED]
Checksum 0x5ee2, unused inodes 65533
Primary superblock at 1, Group descriptors at 2-2
Block bitmap at 3 (+2), Inode bitmap at 19 (+18)
Inode table at 35-35 (+34)
8150 free blocks, 0 free inodes, 1 directories, 65533 unused inodes
Free blocks: 17-18, 32-34, 48-8192
Free inodes:
Group 1: (Blocks 8193-16384) [BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x56cf, unused inodes 5
Backup superblock at 8193, Group descriptors at 8194-8194
Block bitmap at 4 (+4294959107), Inode bitmap at 20 (+4294959123)
Inode table at 36-36 (+4294959139)
8190 free blocks, 6 free inodes, 0 directories, 5 unused inodes
Free blocks: 8193-16384
Free inodes: 11-16
Group 2: (Blocks 16385-24576) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x51eb, unused inodes 8
Block bitmap at 5 (+4294950916), Inode bitmap at 21 (+4294950932)
Inode table at 37-37 (+4294950948)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 16385-24576
Free inodes: 17-24
Group 3: (Blocks 24577-32768) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x3de1, unused inodes 8
Backup superblock at 24577, Group descriptors at 24578-24578
Block bitmap at 6 (+4294942725), Inode bitmap at 22 (+4294942741)
Inode table at 38-38 (+4294942757)
8190 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 24577-32768
Free inodes: 25-32
Group 4: (Blocks 32769-40960) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x79b9, unused inodes 8
Block bitmap at 7 (+4294934534), Inode bitmap at 23 (+4294934550)
Inode table at 39-39 (+4294934566)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 32769-40960
Free inodes: 33-40
Group 5: (Blocks 40961-49152) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x0059, unused inodes 8
Backup superblock at 40961, Group descriptors at 40962-40962
Block bitmap at 8 (+4294926343), Inode bitmap at 24 (+4294926359)
Inode table at 40-40 (+4294926375)
8190 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 40961-49152
Free inodes: 41-48
Group 6: (Blocks 49153-57344) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x3000, unused inodes 8
Block bitmap at 9 (+4294918152), Inode bitmap at 25 (+4294918168)
Inode table at 41-41 (+4294918184)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 49153-57344
Free inodes: 49-56
Group 7: (Blocks 57345-65536) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x5c0a, unused inodes 8
Backup superblock at 57345, Group descriptors at 57346-57346
Block bitmap at 10 (+4294909961), Inode bitmap at 26 (+4294909977)
Inode table at 42-42 (+4294909993)
8190 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 57345-65536
Free inodes: 57-64
Group 8: (Blocks 65537-73728) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0xf050, unused inodes 8
Block bitmap at 11 (+4294901770), Inode bitmap at 27 (+4294901786)
Inode table at 43-43 (+4294901802)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 65537-73728
Free inodes: 65-72
Group 9: (Blocks 73729-81920) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x50fd, unused inodes 8
Backup superblock at 73729, Group descriptors at 73730-73730
Block bitmap at 12 (+4294893579), Inode bitmap at 28 (+4294893595)
Inode table at 44-44 (+4294893611)
8190 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 73729-81920
Free inodes: 73-80
Group 10: (Blocks 81921-90112) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x60a4, unused inodes 8
Block bitmap at 13 (+4294885388), Inode bitmap at 29 (+4294885404)
Inode table at 45-45 (+4294885420)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 81921-90112
Free inodes: 81-88
Group 11: (Blocks 90113-98304) [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
Checksum 0x28de, unused inodes 8
Block bitmap at 14 (+4294877197), Inode bitmap at 30 (+4294877213)
Inode table at 46-46 (+4294877229)
8192 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 90113-98304
Free inodes: 89-96
Group 12: (Blocks 98305-102399) [INODE_UNINIT, ITABLE_ZEROED]
Checksum 0x9223, unused inodes 8
Block bitmap at 15 (+4294869006), Inode bitmap at 31 (+4294869022)
Inode table at 47-47 (+4294869038)
4095 free blocks, 8 free inodes, 0 directories, 8 unused inodes
Free blocks: 98305-102399
Free inodes: 97-104
并计算使用的块(用于备份超级块,组描述符,块位图,Inode位图和Inode表),或者我们grep
计算:
LANG=C dumpe2fs /dev/mapper/vg_vms-test1 | grep ' at ' | grep -v ',' | wc -l
这给了我们具有单个块的行数(在我们的示例中),
LANG=C dumpe2fs /dev/mapper/vg_vms-test1 | grep ' at ' | grep ',' | wc -l
这给了我们具有两个块的行数(在我们的示例中)。
因此,在我们的示例中13
,每行有一个块,每19
行有两个块。
13+19*2
这给我们提供51
了ext4本身正在使用的块。最后,仅剩一个街区了。块0,1024
在启动扇区之类的内容的开头是跳过的字节。
ext2
小型分区的原因。