Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS C9 - Your environment is running out of quota. Please make some free space

Good evening guys! I don't understand why my C9 instance is says that is full. But my actual size is 437784 kb. When I type df I get:

Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs         4073856      64   4073792   1% /dev
tmpfs            4084416       0   4084416   0% /dev/shm
/dev/xvda1       8123812 7868088    155476  99% /

And when I look at the folder where is my application, du ./ I get:

437784  ./

Looks very odd for me as I used only (437784 kb = 437.784 mb) of ( 8123812 kb = 8123.812 mb ). I checked every folder but I can't get to that 8 GB

like image 289
REWA Avatar asked Oct 31 '18 21:10

REWA


2 Answers

There seems to be two methods I came across:

Method 1:

Go to EC2 -> Volumes -> Modify Volume.

Now, increase the Disk space allocation. The change will be reflected immediately, even on running system. Once done, go to Cloud9 terminal, and:

$ lsblk
nvme0n1     259:0    0   20G  0 disk 
└─nvme0n1p1 259:1    0   10G  0 part /

$ sudo growpart /dev/nvme0n1 1
CHANGED: partition=1 start=2048 old: size=20969439 end=20971487 new: size=41940959,end=41943007

$ lsblk
nvme0n1     259:0    0   20G  0 disk 
└─nvme0n1p1 259:1    0   20G  0 part /

$ sudo resize2fs /dev/nvme0n1p1
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/nvme0n1p1 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/nvme0n1p1 is now 5242619 (4k) blocks long.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1   20G  9.5G  9.9G  49% /

Ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

Method 2:

I had issues while practicing docker commands as some images were large enough to exhaust the disk space. Since I read that images are stored in /var/lib/docker, I created an EBS volume of 25 GiB and mounted it at /var location. This solved my issues.

# This will show the attached devices
sudo lsblk

# Say, if the volume to be mounted is "/dev/nvme1n1", we can:
sudo mount /dev/nvme1n1 /var

# Now check disk usage
sudo df -h

Whenever I attached this new EBS to any other cloud9 instance, the docker images are already present, saving some time for me from downloading again.

So mounting volumes where such huge files are present will resolve this issue.

like image 144
Srikanth Sharma Avatar answered Sep 23 '22 00:09

Srikanth Sharma


Your instance is full! All the data is allocated in the xvda1 volume. Only 2GB is available to use for each instance and you are using 99% of this. As the df command clearly shows.

To change the size of the volume go to EC2 page in the AWS console. Look for Elastic Block Store and modify the size of the volume.

like image 42
antuirno Avatar answered Sep 23 '22 00:09

antuirno