Question

Cannot find what is filling up disk space /dev/vda1 is 100% full

  • Posted August 14, 2014

Here is what I have:

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   38G     0 100% /

However, I cannot find what is using the space up with du -sh *

Any ideas how to find what is using up all that space?

Subscribe
Share

This is better:

sudo du -h --max-depth=1 -x

After sending a support ticket about this issue, they point me to a direction of solving it myself.

For me there’s actually a log file that stacked up until the disk is full. Here’s how I solve it: I go to root dir: cd / list dirs and files: ls And do du -h [dir] for each of them When you see something suspicious you go inside that dir, or see from the du result. For me it’s a du -h home When I trace, it points me to my laravel app storage/logs.

On a sidenote, on my issue here is caused by job queue php artisan. And on those job queue there’s an error and it keeps logging and repeating, the php process also hogging the cpu. This solved me two issues altogether.

There you go. I hope it helps.

@mslinn thanks it really worked for me and let me find which is using up my space till now. in my case it was “./Trash-0000”

In response to

“And do du -h [dir] for each of them”

du -h --max-depth=1 will achieve this much quicker without having go into each folder. look for the once that looks suspicious then perform the same max depth in that folder.

@josualeonard Hello, I ve sent a request as well to them, and similar to fix it your self with those links …

I don’t think I have as much knowledge as you do, can you explain to me in a bit more detail how to solve this ?

Problem is the same :

Filesystem Size Used Avail Use% Mounted on /dev/vda1 30G 28G 0 100% /

I am not quite sure what you mean by cd / ect… ect… It was all working fine until yesterday. Thanks for your help !!

Same issue here!

This comment has been deleted

I am also seeing this

du -csh /
1.6G	total

But

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        30G   28G     0 100% /

I’m having the same issue. Did you find a resolution?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Another option that might help you find out what is using up space is ncdu Install it with:

sudo apt-get install ncdu

If you still can’t find anything, try running:

lsof / | grep deleted

Sometimes if a file is deleted while it is opened by a process, it will not actually free up the disk space until the process is ended. This command will show if there are any files in that state.

outside of other answers here what I did was:

navigate through subfolders with ncdu and finding large folders. Among them one can delete:

/var/logs https://bbs.archlinux.org/viewtopic.php?id=158510 // /var/logs/journal http://askubuntu.com/questions/100004/how-can-i-free-space-from-a-massive-39-5gb-var-log-folder // other already archived (GZ-ipped) files;

and compress .git folders of projects by shrinking them with this command: git repack -a -d --depth=250 --window=250 http://stackoverflow.com/questions/5613345/how-to-shrink-the-git-folder

Googled and found this question which had the same problem.

@TonyTsang That command helped me find what it was

Apparently it was a hidden log folder set by pm2.

You can run the following to see what is eating up your space from /

sudo du -ah --max-depth=1 -x

This will list out all the directories and files along with its size for current directory. feel free to increase --max-depth=N

if u didn’t get any directory that is using much space and still /dev/vda1 showing nearly occupied try re starting the server with these command “shutdown -r now” these solved my problem. :)

I had the exact same issue. I am running a laravel app on a linux instance. The app performs a lot of DB queries and I found that the mysql binlogs were eating up the disk space - almost 1GB each.

To fix:

SSH onto the server cd back to the root directory run sudo du -h --max-depth=1 -x to show which directory is consuming space cd down to var/lib/mysql run PURGE BINARY LOGS TO 'mysql-bin.000100';

That will clear out the bin logs. If you want a longer term solution, consider only retaining a few days of logs as explained here

How I solved it:

  1. Use Filezilla, search for file, Filesize greater “100000000” (shows files larger than 100 MB).
  2. Found the file ibtmp1 with 48 GB.
  3. Solved it with: ibtmp1 https://stackoverflow.com/q/41216630/1066234 and https://www.rmtweb.co.uk/mysql-ibtmp1-file-grows-exponentially

Hope that helps.

I found a number of log files that I think (although I’m not sure 100%) that I can delete. But how do I do this? What is the command to clear all log files in a certain directory Or what is the command to delete a single file? And what is the command to download that specific file should I want to because I’m not 100% sure I can delete it.

thanks!

Its usually because log file If you’re looking for large files… Here (run as root). This will give you your top 40 biggest files:

find / -type f  -size +10000k -exec ls -lh {} \; | awk '{print $5 ": " $9}' | sort -nr | head -n 40

Source: https://ubuntuforums.org/showthread.php?t=2262783

I have experienced it too. After upgrading to Windows 10, disk space always goes to 100%, I thought its because of the printer, I also took advice from HP Printer Support, but it still persists.