oot@libin:~# mke2fs /dev/loop0
mke2fs 1.41.11 (14-Mar-2010)
文件系统标签=
操作系统inux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
正在写入inode表: 完成
Writing superblocks and filesystem accounting information: 完成
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
但是这样还没完,我们还是不能访问我们新建的ext2文件系统,因为还没有挂载,我决定将loop 设备挂载在/mnt/bean 目录下。
mkdir /mnt/bean
mount -t ext2 /dev/loop0 /mnt/bean
root@libin:/mnt/bean# mount
.........
/dev/loop0 on /mnt/bean type ext2 (rw)
我们知道,超级块是很重要的,因为它告诉了linux 这个块设备是怎样组织的,它告诉linux我这个文件系统是什么文件系统,每个块的大小是多大(1024、2048 or 4096),每个块组有多少个块,inode占多少个字节。等等的信息。正是因为超级块很重要,所以我们不能将这些信息只保存1份。试想一下,如果超级块坏掉了,而我们只有一个块组有超级块,那么就彻底完蛋了,后面接近500M的空间及里面的数据我们都没办法获得了。这是比较容易理解的。但是,是不是每个块组都要有启动块呢。这就没必要了,这也有点空间浪费。那到底把超级块放到那些块组呢?
最后,最后的最后,解释以下,为什么每个块组中的块数blocks per group 是8192,因为,我们用1个块作为位图保存本块组 block的使用情况(bit为1表示对应的block被使用,bit为0表示对应的block空闲),1个block是1024字节,共有1024*8=8192个bit,所以,每个块组最多只能是81292个块。