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 am working on external server - just doing some web-api there. Today when I wanted to use api php returned following error:

Unknown: write failed: No space left on device (28)

So I figured out that tmp is full:

~# df -h /tmp
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       102G   97G     0 100% /

So I guess I have to clear some trash in tmp - but first of all I would like to know what is causing the problem, I mean what takes so much memory in tmp? Maybe something is flooding tmp dir somehow? I am not expert in system administration I just write web-api... Is it normal that tmp size is exeeded? Maybe it just happens from time to time?

The command result:

du -sh /tmp/* | sort -h
0       /tmp/tmpEZIyDT
0       /tmp/unity_support_test.0
4.0K    /tmp/amazoncookie.txt
4.0K    /tmp/at-spi2
4.0K    /tmp/filewhHOLH
4.0K    /tmp/keyring-b3ZOTY
4.0K    /tmp/mc-domator
4.0K    /tmp/mc-root
4.0K    /tmp/pulse-2L9K88eMlGn7
4.0K    /tmp/pulse-PKdhtXMmr18n
4.0K    /tmp/ssh-thimUVhk2748
8.0K    /tmp/pulse-5N1YM8s2cT0i

Strange - as I understand not much things in tmp dir... maybe something else is taking so much disk space - how I can check it?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

The first command indicates that /tmp is actually on the same filesystem as / (ie, everything else). If your root partition is full, it could be that other stuff (such as /var/log) is taking up space.

A decent way of finding things is to do

du -sc * .[^.]* | sort -n

to find what directories are big. Then you can continue to cd into lower directories and rerun the command to narrow things down.

share|improve this answer
1  
Run a quick check over the contents of /var/log/ - If a program has been spewing gigabytes of unmonitored errors, this can quickly fill up a drive. –  Darth Android Oct 18 '12 at 17:49
    
thanks - it was good idea of lookin for hidden files - the problem was huge file ".xsession-errors" in some users home dir - for now I just deleted it –  user166241 Oct 18 '12 at 20:03
add comment

On a recent distro :

du -sh /tmp/* | sort -h

On a older distro :

du -csm /tmp/* | sort -n
share|improve this answer
    
I edited post - the result of first command is strange... –  user166241 Oct 18 '12 at 17:36
add comment

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.