ECS 云硬盘扩容命令

#!/bin/bash
set -eu
# 1. 安装growpart工具【您当前的分区类型为GPT,还需安装gdisk工具】
type growpart || yum install -y cloud-utils-growpart
type sgdisk || yum install -y gdisk
#
# 2. 扩容分区:运行命令 growpart /dev/vda 3
LC_ALL=en_US.UTF-8 growpart /dev/vda 3
# 扩容文件系统:您当前的文件系统为xfs,因此您需要先安装xfsprogs,再执行xfs_growfs命令
type xfs_growfs || yum install -y xfsprogs
xfs_growfs /

# 2. 扩容分区:运行命令 growpart /dev/vda 3
LC_ALL=en_US.UTF-8 growpart /dev/vda 1
resize2fs /dev/vda1
--------------------------------------------------------------------

type growpart || yum install -y cloud-utils-growpart
LC_ALL=en_US.UTF-8 growpart /dev/vda 1
resize2fs /dev/vda1

posted @ 2024-11-21 07:47  lfzjky  阅读(1)  评论(0编辑  收藏  举报