4月 30, 2021 AWS EC2
### On AWS

To resize the root volume of an EC2 instance, you can do the following steps:

1. Login to AWS console, navigate to "EC2" .

2. Select an instance.

![](https://cdn.19site.net/files/ed/0d/ed0d49e9-5aff-4ddb-ac6a-7ea39d4e453a.png)

3. Click the "Storage" tab.

![](https://cdn.19site.net/files/f6/5f/f65f7de2-232b-4396-8b1f-9222b845a04b.png)

4. Click on the volume that you want to resize.

![](https://cdn.19site.net/files/29/e6/29e6658b-2aa2-4094-b39c-4451756c3203.png)

5. Then you may redirected to volumes listing page, select the target volume and click "Action > Modify Volume".

![](https://cdn.19site.net/files/9f/0f/9f0f7bd3-9506-4bfa-b68e-96bc77676df1.png)

6. Now you may resize the volume.

![](https://cdn.19site.net/files/d5/76/d576404b-25e4-4a14-af48-bd05612a6016.png)

### On your EC2 instance

To take effect on your EC2 instance, you may do some action on you instance:

> Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system

1. Use `df -h` check the current disk mount points and partition.

2. Use `lsblk` to check disk and partitioning.

3. Use `sudo growpart /dev/xvda 1` to grow the partition to use entire disk spaces.

4. Use `lsblk` to check the result.

5. Use `sudo resize2fs /dev/xvda1` to extend the volume of partition.

Enjoy : )
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)