查看磁盘详细信息

[root@2020 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        909M     0  909M   0% /dev
tmpfs           919M  4.0K  919M   1% /dev/shm
tmpfs           919M  568K  919M   1% /run
tmpfs           919M     0  919M   0% /sys/fs/cgroup
/dev/vda1        20G   11G  8.3G  56% /
/dev/vdb1        20G   19G  467M  98% /mch
tmpfs           184M     0  184M   0% /run/user/1003
tmpfs           184M     0  184M   0% /run/user/0


使用 growpart 命令热扩容


[root@2020 ~]# growpart /dev/vda 1
CHANGED: partition=1 start=2048 old: size=41940992 end=41943040 new: size=83883999 end=83886047
[root@2020 ~]# growpart /dev/vdb 1
CHANGED: partition=1 start=2048 old: size=41940992 end=41943040 new: size=83883999 end=83886047


使用 resize2fs 命令更新磁盘大小


[root@2020 ~]# resize2fs /dev/vda1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vda1 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/vda1 is now 10485499 blocks long.

[root@2020 ~]# resize2fs /dev/vdb1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vdb1 is mounted on /mch; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 5
The filesystem on /dev/vdb1 is now 10485499 blocks long.

最后重新检查磁盘



[root@2020 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        909M     0  909M   0% /dev
tmpfs           919M  4.0K  919M   1% /dev/shm
tmpfs           919M  576K  919M   1% /run
tmpfs           919M     0  919M   0% /sys/fs/cgroup
/dev/vda1        40G   11G   28G  28% /
/dev/vdb1        40G   19G   20G  49% /mch
tmpfs           184M     0  184M   0% /run/user/1003
tmpfs           184M     0  184M   0% /run/user/0



点赞(0) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部