Amazon EC2 - disk full

0 votes

Whenever I try to run udf -h on my Amazon EC2 server, this is the output:

[ec2-user@ip-XXXX ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1             25G   25G     0 100% /
tmpfs                 4.0G     0  4.0G   0% /dev/shm

for some reason, something is taking up my storage space.

Im trying to find all of the big files/folders and this is what i get back:

[ec2-user@ip-XXXX ~]$ sudo du -a / | sort -n -r | head -n 10
993580  /
639296  /usr
237284  /usr/share
217908  /usr/lib
206884  /opt
150236  /opt/app
150232  /opt/app/current
150224  /opt/app/current/[deleted].com
113432  /usr/lib64

How do I Detect what's taking my storage space?

Jul 9, 2018 in AWS by Hammer
• 360 points
1,128 views

1 answer to this question.

0 votes

Well, I think its one (or more) log files which have grown too large and need to be removed/backedup. I would suggest going after the big files first. So find all files greater than 10 MB (10 MB is a big enough file size, you can choose +1M for 1MB similarly)

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

and now you can identify which ones are causing the trouble and deal with them accordingly.

As for your original du -a / | sort -n -r | head -n 10 command, that won't work since it is sorting by size, and so, all ancestor directories of a large file will go up the pyramid, while the individual file will most probably be missed.

Note: It should be pretty simple to notice the occurence of similar other log files/binaries in the location of the files you so find, so as a suggestion, do cd in to the directory containing the original file to cleanup more files of the same kind. You can also iterate with the command for files with sizes greater than 1MB next, and so on.

answered Aug 10, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer

How can I find out why my storage space on Amazon EC2 is full?

One or more log files which have ...READ MORE

answered Feb 21, 2022 in AWS by Korak
• 5,820 points
1,468 views
0 votes
0 answers
0 votes
1 answer

Trying to Determine Amazon EC2 instance creation date/time

You can't find as such attribute called ...READ MORE

answered May 29, 2018 in AWS by Flying geek
• 3,280 points
9,762 views
+1 vote
4 answers

What is the difference between Amazon ECS and Amazon EC2?

EC2 allows you to launch individual instances ...READ MORE

answered Jul 11, 2018 in AWS by Priyaj
• 58,020 points
43,558 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,714 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
0 votes
1 answer
0 votes
1 answer

How to find unused Amazon EC2 security groups?

Select all and delete there you can ...READ MORE

answered Jul 10, 2018 in AWS by Priyaj
• 58,020 points
2,247 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP