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

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.


I think before we start adding space at additional cost, we might consider pruning wasted space. In my case, the development code itself was taking up a relatively small amount of space, while the docker images and global modules were taking up a relatively large amount of space.

https://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size/156648#156648 outlines how we can get a better sense of what exactly is taking up the space.

https://docs.docker.com/config/pruning/ was useful for me in dealing with Docker-specific issues.


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.