- 论坛徽章:
- 0
|
根据《鸟哥》书上的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 数量是从这里看么?那么如果是为什么数量没有和我命令中写的一样呢?谢谢解答! |
|