Unable to complete the operation because your AWS Cloud9 environment is running out of disk space. Please free up space or resize your EBS volume.

0

When I open my Cloud9 environment, I am getting the below error.

Unable to access your environment. Unable to complete the operation because your AWS Cloud9 environment is running out of disk space. Please free up space or resize your EBS volume.

Even I tried resing the volumes attached to Cloud9 instance and rebooted in the console as I am unable to open the terminal itself. As per the given doc https://ec2spotworkshops.com/ecs-spot-capacity-providers/workshopsetup/resize_ebs.html , I modified the volumes but I am still getting the same error. To extend the file system, the terminal is not opening at all.

I tried with EC2 Serial Console but it is asking for Login credentials. I haven't added any kind of user.

I tried with SSM by adding the Service Role to the EC2 instance still not able to connect.

  1. Stopped the instance and edited User data with given script (to increase filesystem) sudo growpart /dev/xvda 1 sudo resize2fs /dev/xvda1 sudo reboot
  2. Started the instance and waited till the instance is up and running (healthy).
  3. Opened Cloud9 but still unable to acess the environment and getting the same error.
asked 5 months ago352 views
1 Answer
1
Accepted Answer

Hi,

Out of disk space could be the reason of the instance not being reachable using SSM. SSM agent might have stopped making it unable to let you connect via SSM.

To increase partition and Filesystem size inside the operating system :

[+] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system

This can be done by detaching the root volume and attaching it as a secondary volume to another rescue instance.

NOTE: Make sure you take a backup before trying out the below steps

1)Detach root volume from the problematic instance. 2)Attach as secondary to another instance (.i.e., a rescue instance to be launched in the same Availability zone with similar instance configuration as problematic instance) 3)Inside this instance run the below commands to mount the volume as sudo user. Modify the below commands as per your device names.

# lsblk
# lsblk -f

Get the name, size, type, and mount point for the file system that you need to extend : 
	# df -hT

# growpart /dev/xvdf 1 (note that there is a space after /dev/xvdf)

Mount the volume under /mnt 
	# mount /dev/xvdf1 /mnt

	If a xfs file system is being used, use : 
	# mount -t xfs -o nouuid /dev/xvdf1 /mnt 

The commands to extend the file system differ depending on the file system type. Choose the correct command based on the file system type.

	- XFS file system : # xfs_growfs -d /mnt  

	- Ext4 file system : # resize2fs /dev/xvdf1

Verify that the file system has been extended :
	# df -hT

Refer the link for more information on extending file system : [+] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

4)Once you notice the Filesystem size has increased, unmount the volume as below.

# umount /mnt
# df -h

5)Detach the volume from the rescue instance and attach back to original instance as root volume.

6)Start the EC2 instance

Monitor the EC2 screenshot feature and notice the operating system boots all the way up and the EC2 instance is healthy and passing all status checks.

AWS
answered 5 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