[Alibaba Cloud] Resize Alibaba Cloud ECS (Linux) Yun Disk size online
growpart and resize2fs to extend disk size
Alibaba CLoud Elastic Compute Service (ECS) is a high-performance, stable, reliable, and scalable IaaS-level service provided by Alibaba Cloud. ECS eliminates the need for upfront investments in IT hardware and allows you to scale computing resources on demand. This makes ECS instances more convenient and efficient than physical servers. ECS provides a variety of instance types that suit various business needs and helps boost business growth.
This article provides instructions on how to use tools such as growpart
and resize2fs
to extend the partition and file system of the Linux system disk.
Prerequites
Before extending the system disk partition and file system, please complete the following tasks in advance.
-
A snapshot backup data has been created.
To prevent data loss due to operational errors, it is recommended that you use snapshots to back up data before operations.
-
The cloud disk has been expanded on the console.
-
Connect to the ECS instance remotely.
Installation
First, install growpart
or xfsprogs
according to your OS.
1 | CentOS7+ |
Usages
Run growpart <DeviceName> <PartionNumber>
command to resize disk.
1 | growpart /dev/vda 1 |
Run resize2fs <PartitionName>
command to resize file system.
1 | resize2fs /dev/vda1 |
Run the following commands to show disk size.
1 | df -m |
References
[1] What is ECS? - https://www.alibabacloud.com/help/en/doc-detail/25367.htm