Centos的Inode及Block相关知识
时间:2016-06-04 02:14 来源:51cto.com 作者:IT
本经验均在CentOSrelease6.7(Final)下操作,如知识有欠缺之处 欢迎批评指正。
[root@techW ~]
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/vg_techw-lv_root
1152816 55846 1096970 5% /
tmpfs 125596 1 125595 1%
/dev/shm
/dev/sda1
128016 38 127978 1%
/boot
[root@techW ~]
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_techw-lv_root
18G 1.5G 15G 9% /
tmpfs 491M 0 491M 0%
/dev/shm
/dev/sda1
477M 36M 416M 8%
/boot
[root@techW ~]
# dumpe2fs /dev/sda1 | grep -i "block size"
dumpe2fs 1.41.12 (17-May-2010)
Block size: 1024
[root@techW ~]
#
[root@techW ~]
#
[root@techW ~]
# dumpe2fs /dev/sda1 | grep -i "inode size"
dumpe2fs 1.41.12 (17-May-2010)
Inode size: 128
###boot分区为128,常规分区为256
[root@techW ~]
#
[root@techW ~]
#
[root@techW ~]
# dumpe2fs /dev/sda1 | grep -i "inode count"
dumpe2fs 1.41.12 (17-May-2010)
Inode count: 128016
[root@techW ~]
#
[root@techW ~]
# dumpe2fs /dev/sda1 | grep -i "block count"
dumpe2fs 1.41.12 (17-May-2010)
Block count: 512000
Reserved block count: 25600
[root@techW ~]
# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x2d37eabe.
Changes will remain
in
memory only,
until
you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (
command
'c'
) and change display
units
to
sectors (
command
'u'
).
Command (m
for
help): n
### add a new partition
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
### 为做区分,选择2
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
Using default value 652
Command (m
for
help): w
### write table to disk and exit
The partition table has been altered!
Calling ioctl() to re-
read
partition table.
Syncing disks.
分区时的参数命令:
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system
id
u change display
/entry
units
v
verify the partition table
w write table to disk and
exit
x extra functionality (experts only)
[root@techW ~]
# mkfs.ext4 /dev/sdb2
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS
type
: Linux
Block size=4096 (log=2)
###默认的Block的大小为4096
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1309289 blocks
65464 blocks (5.00%) reserved
for
the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block
groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables:
done
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information:
done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@techW ~]
# mkfs.ext4 -b 2048 -I 2048 /dev/sdb2
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS
type
: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
Stride=0 blocks, Stripe width=0 blocks
326400 inodes, 2618578 blocks
130928 blocks (5.00%) reserved
for
the super user
First data block=0
Maximum filesystem blocks=540016640
160 block
groups
16384 blocks per group, 16384 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104,
2048000
Writing inode tables:
done
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information:
done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@techW ~]
# dumpe2fs /dev/sdb2 | grep "Inode size"
dumpe2fs 1.41.12 (17-May-2010)
Inode size: 2048
###大小更改成功
[root@techW ~]
#
s
/dev/sdb2
|
grep
"Block size"
dumpe2fs 1.41.12 (17-May-2010)
Block size: 2048
###大小更改成功
(责任编辑:IT)
本经验均在CentOSrelease6.7(Final)下操作,如知识有欠缺之处 欢迎批评指正。
(责任编辑:IT) |