Disk /dev/vda: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a448d

Disk /dev/vdb: 3221.2 GB, 3221225472000 bytes
255 heads, 63 sectors/track, 391625 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Filesystem volume name:   <none>
Last mounted on:          /data
Filesystem UUID:          99a6d751-f357-4270-83e5-f081dfb3b160
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              3072000
Block count:              786431991
Reserved block count:     39321599
Free blocks:              519217362
Free inodes:              266899
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      836
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         128
Inode blocks per group:   8
Flex block group size:    16
Filesystem created:       Sat Nov 28 17:13:20 2015
Last mount time:          Sun Aug 27 03:25:16 2017
Last write time:          Sun Aug 27 03:25:16 2017
Mount count:              5
Maximum mount count:      27
Last checked:             Sat Nov 28 17:13:20 2015
Check interval:           15552000 (6 months)
Next check after:         Thu May 26 17:13:20 2016
Lifetime writes:          1473 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
First orphan inode:       470825
Default directory hash:   half_md4
Directory Hash Seed:      9a9c132f-b96b-4b88-85a4-9d79a8ccc429
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
日志大小:             128M
Journal length:           32768
Journal sequence:         0x005e5995
Journal start:            7226
[root@public ~]# df -i
Filesystem      Inodes   IUsed   IFree IUse% Mounted on
/dev/vda3      3276800  130147 3146653    4% /
tmpfs          1005135       4 1005131    1% /dev/shm
/dev/vda1        65536      39   65497    1% /boot
/dev/vdb1      3072000 3014553   57447   99% /data
[root@public ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda3        50G  7.4G   40G  16% /
tmpfs           3.9G   76K  3.9G   1% /dev/shm
/dev/vda1      1008M   62M  896M   7% /boot
/dev/vdb1       3.0T  1.5T  1.4T  52% /data
[root@public ~]# df -T
Filesystem     Type   1K-blocks       Used  Available Use% Mounted on
/dev/vda3      ext4    51605116    7713280   41270448  16% /
tmpfs          tmpfs    4020540         76    4020464   1% /dev/shm
/dev/vda1      ext4     1032088      62684     916976   7% /boot
/dev/vdb1      ext4  3144751332 1525715856 1461749080  52% /data

对比

[root@web app-school]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda2        50G  7.3G   40G  16% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/dev/vda1       194M   34M  151M  19% /boot
/dev/vdb1       197G  117G   71G  63% /data
[root@web app-school]# df -i
Filesystem       Inodes  IUsed    IFree IUse% Mounted on
/dev/vda2       3276800  93411  3183389    3% /
tmpfs           2041473      1  2041472    1% /dev/shm
/dev/vda1         51200     45    51155    1% /boot
/dev/vdb1      13107200 469147 12638053    4% /data

Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          49f819fd-e56d-48a4-86d3-7ebe0a68ec88
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              3276800
Block count:              13106944
Reserved block count:     655341
Free blocks:              12127279
Free inodes:              3142482
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      508
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Thu Apr 21 15:00:29 2016
Last mount time:          Sun Nov 25 13:27:21 2018
Last write time:          Sun Nov 25 13:27:20 2018
Mount count:              13
Maximum mount count:      -1
Last checked:             Thu Apr 21 15:00:29 2016
Check interval:           0 (<none>)
Lifetime writes:          36 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
First orphan inode:       139283
Default directory hash:   half_md4
Directory Hash Seed:      e74c0d45-bdb1-4aaa-9864-f29ad06e91c1
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x000139a4
Journal start:            9131

格式化

mkfs.ext4: invalid option -- '-'
Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size]
    [-i bytes-per-inode] [-I inode-size] [-J journal-options]
    [-G flex-group-size] [-N number-of-inodes]
    [-m reserved-blocks-percentage] [-o creator-os]
    [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
    [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
    [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]

3 对 “inode与blocks问题”的想法;

  1. -i 2048更改inode每2KB创建一个
    -b 8192设置block size的大小为8kB
    -f 1024设置fragments的大小为1KB
    –N 2939495更改inode count。
    

    无法热调节

  2. 参数-i 最小值是1024,这个值的大小决定inode count的大小,对应关系:

    i=2048 Inode count:1025024
    i=1024 Inode count:2048256

  3. 1。卸载文件系统
    umount /data0
    2。建立文件系统,指定inode节点数
    mkfs.ext3 /dev/sda6 -N 18276352
    3。修改fstab文件
    vi /etc/fstab
    /dev/sda6 /data0 ext3 defaults 1 2
    4,挂载文件系统
    mount -a
    4。查看修改后的inode参数
    dumpe2fs -h /dev/sda6 | grep node

回复 zyh 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code