简体   繁体   中英

AWS EC2: error expanding EBS volume partition

I am trying to expand an EBS volume from 120GB to 200GB on an c5d.xlarge EC2 instance running Ubuntu. I am following this guide .

So far, I have created a snapshot of the current EBS volume and then expanded it to 200GB.

sudo lsblk

nvme1n1     259:0    0  93.1G  0 disk
nvme0n1     259:1    0   200G  0 disk
└─nvme0n1p1 259:2    0   120G  0 part /

Following the guide, I have tried to expand the nvme0n1p1 partition to 200GB:

sudo growpart /dev/nvme0n1p1 1

WARN: unknown label
failed [sfd_dump:1] sfdisk --unit=S --dump /dev/nvme0n1p1
sfdisk: /dev/nvme0n1p1: does not contain a recognized partition table
FAILED: failed to dump sfdisk info for /dev/nvme0n1p1

It seems the partition is not recognized.

I have also tried with resize2fs command, but it doesn't do anything:

sudo resize2fs /dev/nvme0n1p1

resize2fs 1.44.1 (24-Mar-2018)
The filesystem is already 31457019 (4k) blocks long.  Nothing to do!

Any idea how can I make the partition to expand to the correct size?

Actually the growpart command was wrong. It must follow the syntax growpart path/to/device_name partition_number , so the right command is:

sudo growpart /dev/nvme0n1 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM