点击(此处)折叠或打开
root@libin:/mnt/bean# dd if=/dev/loop0 bs=1k skip=204802 count=2|od -tx1 -Ax > /tmp/dump_hex_ 记录了2+0 的读入 记录了2+0 的写出 2048字节(2.0 kB)已复制,0.000160205 秒,12.8 MB/秒 root@libin:/mnt/bean# vi /tmp/dump_hex_ 000000 04 01 00 00 05 01 00 00 06 01 00 00 ef 1d e5 07 000010 02 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 000020 04 21 00 00 05 21 00 00 06 21 00 00 fd 1d f0 07 000030 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 000040 01 40 00 00 02 40 00 00 03 40 00 00 00 1f f0 07 000050 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 000060 04 61 00 00 05 61 00 00 06 61 00 00 fd 1d f0 07 000070 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 000080 01 80 00 00 02 80 00 00 03 80 00 00 00 1f f0 07 000090 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 0000a0 04 a1 00 00 05 a1 00 00 06 a1 00 00 fd 1d f0 07 0000b0 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 .... 0007c0 01 c0 07 00 02 c0 07 00 03 c0 07 00 ff 0e f0 07 0007d0 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 0007e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 000800 最后,最后的最后,解释以下,为什么每个块组中的块数blocks per group 是8192,因为,我们用1个块作为位图保存本块组 block的使用情况(bit为1表示对应的block被使用,bit为0表示对应的block空闲),1个block是1024字节,共有1024*8=8192个bit,所以,每个块组最多只能是81292个块。 同样道理如果用户使用的是4094大小的块,那么,4096*8=32768个bit,所以每个块组会有32K个块。证据在下面。 root@libin:/mnt/bean# cd /home root@libin:/home# umount /dev/loop0 root@libin:/home# cd /mnt/bean root@libin:/mnt/bean# ll 总用量 8 drwxr-xr-x 2 root root 4096 2012-07-06 22:32 ./ drwxr-xr-x 4 root root 4096 2012-07-06 22:32 ../ root@libin:/mnt/bean# mke2fs -b 4096 /dev/loop0 mke2fs 1.41.11 (14-Mar-2010) 文件系统标签= 操作系统:Linux 块大小=4096 (log=2) 分块大小=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 128000 inodes, 128000 blocks 6400 blocks (5.00%) reserved for the super user 第一个数据块=0 Maximum filesystem blocks=134217728 4 block groups 32768 blocks per group, 32768 fragments per group 32000 inodes per group Superblock backups stored on blocks: 32768, 98304 正在写入inode表: 完成 Writing superblocks and filesystem accounting information: 完成 This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override