0

we just ran almost out of space on our main EC2 instance. I wanted to increase the EBS volume size to 2.5TB from 2TB.

However, I noticed that I could not increase the partition anymore due to the MBR limit of 2TB.

I should've known that before...Is there any way to use the 500GB without much downtime, e.g., by creating a new partition? But since it is the root volume I'm not sure if this is even possible. Any ideas?

Thanks a lot!

Edit @Nikita Kipriyanov

sudo fdisk -l /dev/nvme0n1p1
Disk /dev/nvme0n1p1: 1.102 TiB, 2199022206976 bytes, 
    4294965248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

and

sudo cat /etc/fstab
LABEL=cloudimg-rootfs   /    ext4   defaults,discard    0 0

/dev/nvme1n1p2 none swap sw 0 0

and

df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/root      ext4      2.0T  1.8T  149G  93% /

/dev/root is on /dev/nvme0n1p1

Thanks

Pat
  • 1
  • 2
  • In principle, it may be possible to change partition table "on the fly" (keeping root partition physical location), but there are many caveats and this is quite an expert topic. Please, attach to the question your current partition table (`fdisk -l /dev/sdX` or something like this), and also your `/etc/fstab`, if it's possbile I could come up with concrete instructions. OR, as suggested in the answer below, you can always just add another EBS volume, that's easier and less error-prone. – Nikita Kipriyanov Feb 08 '22 at 19:28

2 Answers2

0

In this case, I recommend creating a new EBS volume and attaching it to your instance. EBS volumes can be as large as 64 TiB, so you can store quite a lot in there.

You can then format the EBS volume directly, and move the data that is consuming space on your root volume to this new volume.

APrincess
  • 1
  • 1
0

I am having a similar situation, the application running on the root filesystem and the size needs to be increased on the root filesystem itself. (adding one more volume is not an option for me). Could you please help how I can increase the size above 2TB on the root filesystem?

df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  2.0T  1.4T  587G  71% /


lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme1n1     259:0    0  200G  0 disk
└─nvme1n1p1 259:1    0  200G  0 part /cwc_project
nvme0n1     259:2    0  2.3T  0 disk
└─nvme0n1p1 259:3    0    2T  0 part /


sudo fdisk -l /dev/nvme0n1p1
Disk /dev/nvme0n1p1: 2 TiB, 2199022206464 bytes, 4294965247 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes