Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: disk space mistery
PostPosted: Fri Nov 28, 2014 6:08 am 
Offline

Joined: Thu Nov 27, 2014 4:11 pm
Posts: 1
I have a Linode with 20GB disk space. I also have another 4GB partition, but I'm not using it right now.

I ran out of disk space: this the output of df -h

Filesystem Size Used Avail Use% Mounted on
/dev/xvda 20G 19G 0 100% /
tmpfs 502M 0 502M 0% /lib/init/rw
udev 10M 116K 9.9M 2% /dev
tmpfs 502M 0 502M 0% /dev/shm

Then I ran ncdu to analyse which folders are taking all the space. But when I run it from the root folder /, it says that I'm using only 7.7GB in total (and the sum of the sizes of folders seems to be that).

Any idea where the other 12GB used could be hiding?
Is there any other tool I could use to locate the big folders?

Thanks
Bruno


Top
   
 Post subject: Re: disk space mistery
PostPosted: Fri Nov 28, 2014 12:08 pm 
Offline
Junior Member

Joined: Wed Nov 18, 2009 12:27 am
Posts: 28
Try this with and without -x and compare:

du -d 1 -c -h -x / | sort -h

If -d doesn't work you might need to specify the literal --max-depth.


Top
   
 Post subject: Re: disk space mistery
PostPosted: Fri Nov 28, 2014 1:41 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Scenarios like this frequently mean a file was deleted while it was still open. Most commonly a debug log file in /tmp or log files in /var/log. When you delete a file in Linux (and most sane Unix-like systems) it doesn't free up the disk space until no one is using the file any more.

You can check for this with "lsof | grep deleted". If you see a line similar to
Code:
tin      21208      sweh    6u      REG      253,0       1768    851996 /tmp/tmpfMXfjFg (deleted)

then you need to check the "size". In this case the size is 1768 bytes, so this is a small file and not a problem (it just happens to be how "tin" works). If you find a program with a large deleted file then you need to stop that program. That should free up the file and let the OS reclaim the disk space.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject: Re: disk space mistery
PostPosted: Sat Nov 29, 2014 12:08 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
In case of deleted-but-unclosed files, simply rebooting your server is also a valid solution.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group