Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I don not know what is using my disk space.

I tried df and du commands to check the system storage used they both show diff results

ubuntu@ip-111-121-42-198:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            7.9G  7.5G     0 100% /
udev                  289M  4.0K  289M   1% /dev
tmpfs                 119M  156K  119M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  297M     0  297M   0% /run/shm

ubuntu@ip-10-128-42-198:~$ sudo du -sh /
du: cannot access `/proc/3294/task/3294/fd/4': No such file or directory
du: cannot access `/proc/3294/task/3294/fdinfo/4': No such file or directory
du: cannot access `/proc/3294/fd/4': No such file or directory
du: cannot access `/proc/3294/fdinfo/4': No such file or directory
1.9G    /

How do I check what is eating up my disk space?

share|improve this question
    
Run du -h --max-depth=1 with elevated privileges, this should let you know what is using space in each directory to a depth of 1 level. You can then check lower levels from there. –  deveneyi Aug 20 '12 at 15:14

1 Answer 1

up vote 3 down vote accepted

A running process (or processes) has a file (or files) open that have been deleted. The space occupied by those file(s) appears to df but doesn't appear to du. You can use the lsof command to find which processes have which files open — or you can simply reboot, and the space occupied by the deleted files will be reclaimed.

The du command only shows the sizes of files that it can find by name. A deleted file does not exist in any directory (i.e., it has no name), so du cannot see it. The df command gives overall free space data on the entire filesystem, which is always accurate, but which will show the space occupied by deleted files that are still held open by some process.

share|improve this answer
1  
Could you expand on that please? Why would the file be visible to one and not the other? –  terdon Aug 20 '12 at 15:17
    
The du command only shows the sizes of files that it can find by name. A deleted file does not exist in any directory (i.e., it has no name), so du cannot see it. The df command gives overall free space data on the entire filesystem, which is always accurate, but which will show the space occupied by deleted files that are still held open by some process. –  Fran Aug 20 '12 at 15:24
    
Gotcha, thanks, that's good to know. –  terdon Aug 20 '12 at 15:25
    
@Fran,thanks I got it, I had deleted a log file before stoping the server and then restarted it. this seems to have broken something. I have added your comment in answer I found it very useful :) –  PriteshJ Aug 20 '12 at 15:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.