aws磁盘扩容和aliyun磁盘扩容

1.在aws网站控制面板上找到需要扩充的实例,打开实例的卷并扩充到指定值
一般在线升级磁盘需要一定的时间,等网站上显示ok之后就可以执行第二部
2.生效后到服务器上执行命令
命令1:[root@ip-xxxx-xx-xx-xx /]# lsblk
nvme0n1 259:0 0 80G 0 disk
└─nvme0n1p1 259:1 0 50G 0 part /
命令2:[root@ip-xxxx-xx-xx-xx /]# growpart /dev/nvme0n1 1
CHANGED: partition=1 start=2048 old: size=104855519 end=104857567 new: size=167770079 end=167772127
命令3:[root@ip-xxxx-xx-xx-xx /]# xfs_growfs /dev/nvme0n1p1
meta-data=/dev/nvme0n1p1 isize=512 agcount=26, agsize=524224 blks
= sectsz=512 attr=2, projid32bit=1
.......
命令3:[root@ip-xxxx-xx-xx-xx /]# df -h

 

阿里云同理:
命令1:[root@ip-xxxx-xx-xx-xx /]#  lsblk
命令2:[root@ip-xxxx-xx-xx-xx /]#  growpart /dev/vda 1
........
命令3:[root@ip-xxxx-xx-xx-xx /]# xfs_growfs /dev/vda1
xfs_growfs: /dev/vda1 is not a mounted XFS filesystem
命令3:[root@ip-xxxx-xx-xx-xx /]# resize2fs /dev/vda1
resize2fs 1.42.9 (28-Dec-2013)
The filesystem is already 15728379 blocks long. Nothing to do!
命令4:[root@ip-xxxx-xx-xx-xx /]#   df -h

   解决xfs_growfs提示 xxx is not a mounted XFS filesystem报错
    解决xfs_growfs: xxx is not a mounted XFS filesystem报错
   解决办法
     可以尝试把xfs_growfs替换为resize2fs试一试


posted @ 2023-09-12 11:10  心愿路自平  阅读(79)  评论(0编辑  收藏  举报