免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2892 | 回复: 0
打印 上一主题 下一主题

[系统管理] 关于fdisk硬盘分区后mke2fs格式化更改块数量和inode数量的一点疑惑 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-05-17 20:46 |只看该作者 |倒序浏览
根据《鸟哥》书上的fdisk例子做实验:
                              我在linux下新添加了一块硬盘,用fdisk命令的分区如下:
[root@localhost ~]# fdisk /dev/hdb

The number of cylinders for this disk is set to 44384.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hdb: 21.4 GB, 21474836480 bytes
15 heads, 63 sectors/track, 44384 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1         101       47691   83  Linux
/dev/hdb2             102       44384    20923717+   5  Extended
/dev/hdb5             102       44384    20923686   83  Linux

然后格式化/dev/hdb5 分区为ext3文件系统

root@localhost ~]# mke2fs -j -L "logical" /dev/hdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=logical
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2616320 inodes, 5230921 blocks
261546 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
160 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

随后看到《鸟哥》上说mke2fs格式化硬盘命令还可以添加参数更改块和inode的数量,于是我又做了如下操作:

[root@localhost ~]# mke2fs -j -L "logical" -b 2048 -i 4096  /dev/hdb5
mke2fs 1.39 (29-May-2006)
Filesystem label=logical
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
5234688 inodes, 10461842 blocks
523092 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=547356672
639 block groups
16384 blocks per group, 16384 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104,
        2048000, 3981312, 5619712, 10240000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

但是我只看到了
块的大小由:
Block size=4096 (log=2)
变成了:
Block size=2048 (log=1)

但是并没有看到inode的大小更改:
最开始:
2616320 inodes
变成:
5234688 inodes

想问下:
inodes 数量是从这里看么?那么如果是为什么数量没有和我命令中写的一样呢?谢谢解答!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP