When I log into my ec2 ubuntu instance, I can not download files. I see this error

OSError: No space left on device

When I run this

(python3) ubuntu@ip-172-30-1-208:~$ df -hFilesystem Size Used Avail Use% Mounted onudev 30G 0 30G 0% /devtmpfs 6.0G 8.9M 6.0G 1% /run/dev/xvda1 93G 93G 0 100% /tmpfs 30G 0 30G 0% /dev/shmtmpfs 5.0M 0 5.0M 0% /run/locktmpfs 30G 0 30G 0% /sys/fs/cgroup/dev/loop0 92M 92M 0 100% /snap/core/8689/dev/loop1 90M 90M 0 100% /snap/core/8039/dev/loop2 18M 18M 0 100% /snap/amazon-ssm-agent/1480/dev/loop4 18M 18M 0 100% /snap/amazon-ssm-agent/1566tmpfs 6.0G 24K 6.0G 1% /run/user/1000

It looks like all my hard disk, 93G is taken up by xvda1. Am I reading this right?

2

Best Answer


This happened because root is full.

You can find which files are using more space by using the following command.

sudo find / -type f -size +10M -exec ls -lh {} \;

After that delete large files using rm command

rm -f <path-to-large-file>

The root file system is full

Usually, this happens on servers when the logging goes awry

My tip is, log in, become root and then cd /var/log and run du -smc *

This may well take a while but will show you where the big logs are

Note that deleting an in-use logfile will not usually free up disk space