Ec2 Linux Ubuntu 18.04 increased space resulted in second volume

0

fdisk-l I installed my Ubuntu instance on the default volume which was 8 GB. I then decided to go into the instance and increase its storage by clicking on the volume and then clicking on the modify link and entering 500 GB. But this resulted in a second volume of 500 GB And I am unable to continue my work on the existing instance because I do not have enough space. I actually get the error message I was getting before which states that there is not enough space left in that volume.

Is there a way to merge both volumes or what else would I have to do in order for the original volume to somehow will be automatically connected to the new one such that I no longer get the not enough space available error on the console?

Here are the results for df -h:

[cloudshell-user@ip-10-2-6-242 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          20G  3.9G   16G  21% /
tmpfs            64M     0   64M   0% /dev
tmpfs           1.3G     0  1.3G   0% /sys/fs/cgroup
shm              64M     0   64M   0% /dev/shm
/dev/vde         20G  3.9G   16G  21% /root
/dev/loop0      974M  6.9M  900M   1% /home/cloudshell-user

Im not seeing the 500GB volume that shows up on the web interface of AWS. I followed the instructions for expanding the volume from 8 to 500gb. If it doesnt show up, the document referred to (expanding filesystem) says to do the following:

[cloudshell-user@ip-10-2-6-242 ~]$ sudo lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0   7:0    0    1G  0 loop /home/cloudshell-user
vda   254:0    0    2G  0 disk 
vdb   254:16   0   10G  0 disk 
vdc   254:32   0   10G  0 disk 
vdd   254:48   0   10G  0 disk 
vde   254:64   0 20.3G  0 disk /aws/mde/logs

and Im on nitro according to the instance type command. Since I dont see any partitions, then i move to Step 3:

[cloudshell-user@ip-10-2-6-242 ~]$ df -hT
Filesystem     Type     Size  Used Avail Use% Mounted on
overlay        overlay   20G  3.9G   16G  21% /
tmpfs          tmpfs     64M     0   64M   0% /dev
tmpfs          tmpfs    1.3G     0  1.3G   0% /sys/fs/cgroup
shm            tmpfs     64M     0   64M   0% /dev/shm
/dev/vde       ext4      20G  3.9G   16G  21% /root
/dev/loop0     ext4     974M  6.9M  900M   1% /home/cloudshell-user
[cloudshell-user@ip-10-2-6-242 ~]$ sudo xfs_growfs -d /
sudo: xfs_growfs: command not found

but growfs command fails. Should I do sudo xfs_grows -d /root/vde/? Or use the resize command? That is the only step I haven't been through because I was worried not knowing the pount or partition to use:

sudo resize2fs /dev/??

How should i structure the command?

Mars
asked 8 months ago389 views
3 Answers
1
Accepted Answer

CloudShell doesn't log you in to the EC2 instance you're working with, use SSH or Instance Connect or AWS Systems Manager Session Manager.

It sounds like you originally had 1 x 8GB disk, and you want to expand this to 1 x 500GB disk, is that right? But instead you have ended up with two disks, 1x8GB + 1x500GB.

Confirm this by running lsblk.

You cannot merge these volumes. If you haven't made any use of the second disk yet, then it's safe to detach the 500GB disk from the EC2 instance and delete the volume.

If you actually want to end up with a 500GB rootdisk then the high-level steps are in this Knowledge Centre document https://repost.aws/knowledge-center/expand-root-ebs-linux

Once you have read through this it will direct you to two more links, firstly to expand the volume https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html

And once that has been done, to expand the filesystem https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

I would caution that it's probably not a good idea to have a 500GB root disk, and in all likelihood you should want to have a second disk which you mount as a separate filesystem on another mountpoint. But this is getting away from answering the question that you have submitted.

profile picture
EXPERT
Steve_M
answered 8 months ago
profile pictureAWS
EXPERT
reviewed 8 months ago
profile picture
EXPERT
reviewed 8 months ago
  • Thanks. What you say makes sense but I didn’t have to do it because it seems they merged themselves. I saw a message to that effect when supposedly modifying the existing volume to 500. But when I saw the second volume had been added I figured I messed up somewhere and created the second one. So it all sorted itself out. Thanks!

  • Here are the results from lsblk. As mentioned in here, now when I go to the storage tab of the instance I do indeed only have 1 volume and its 500gb. But my developer over ssh keeps seeing only 8gb. I posted his results below in another answer along with the lsblk results.

0

Hi,

If you have added additional volume to your EC2 instance, the only way to extend the original one is using LVM, but I'm not sure if you want to go this way. It could be that after extending the volume, you used additional space to create an additional partition but it's hard to say without having an output of fdisk -l

In this documentation, you can see how to extend the volume https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/step3-increase-size-of-data-volume.html, and there is an additional step on how to extend the filesystem.

profile picture
EXPERT
answered 8 months ago
  • Here is the result of fdisk -l

  • It doesn't show your discs except the loop. Please try with sudo

  • Hi, thx. I did do sudo. Its in the image, pls check.

  • Hi, thx. I did do sudo. Its in the image, pls check.

0

I've run sudo lsblk. Here is what my developer sees when he tries to upload the data:Enter image description here

Here are the lsblk results:

[cloudshell-user@ip-10-2-6-242 ~]$ sudo lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0   7:0    0    1G  0 loop /home/cloudshell-user
vda   254:0    0    2G  0 disk 
vdb   254:16   0   10G  0 disk 
vdc   254:32   0   10G  0 disk 
vdd   254:48   0   10G  0 disk 
vde   254:64   0 20.3G  0 disk /aws/mde/logs

I also updated the original question with more recent actions taken to expand the filesystem.

Mars
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions