Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On Centos 6.3 server I noticed that /tmp has no longer free space to store files.

[root@]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg0-lv_root
                       99G   11G   84G  12% /
tmpfs                  16G     0   16G   0% /dev/shm
/dev/sda1             194M   65M  120M  35% /boot
/dev/mapper/vg0-lv_tmp
                       97M   92M  704K 100% /tmp
/dev/mapper/vg1-lv0    50G  180M   47G   1% /mnt/ssd2

But there is nothing in /tmp at all

[root@]# ls -Sahl /tmp |more
total 10K
dr-xr-xr-x. 25 root root 4.0K Mar 16 04:29 ..
drwxrwxrwt.  3 root root 3.0K Mar 16 03:32 .
drwx------.  2 root root 1.0K Mar 16 04:28 mc-root

My question is: How could it be? By what /tmp mount space used? And how could I clean it?

share|improve this question
    
df -h is telling you Used=0 ... –  Brigo Mar 15 '13 at 12:55
add comment

2 Answers

up vote 2 down vote accepted

you should you 'lsof /tmp' to see currently opened file.

If you delete a file, while a software still have a lock on it, you won't see it anymore, but it will still have hd space assigned to it.

share|improve this answer
    
All /tmp space used by so many threats like: php-fpm 2186 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 –  Ken Tang Mar 15 '13 at 14:43
    
I have server with nginx+php-fpm+apc so it looks line the /tmp partition is not enough space at all... –  Ken Tang Mar 15 '13 at 14:44
    
I've found apc.ini this line: ; The mktemp-style file_mask to pass to the mmap module. apc.mmap_file_mask=/tmp/apc.XXXXXX i think change this line to /var/tmp/apc.XXXXXX??? –  Ken Tang Mar 15 '13 at 14:47
    
When you check the LSOF result, the 'DEL' give you an idea of which file now only exist in memory. Restarting your software stack (ie: nginx, php, etc.) should clear the HD space issues. And you are right, 100MB is not enough –  CloudWeavers Mar 15 '13 at 17:43
add comment

That's a very small /tmp partition.

Show the output of lsof /tmp to see which processes have open files there. Stopping the relevant process should free the space.

share|improve this answer
    
<pre>[root@]# lsof /tmp COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php-fpm 2185 root DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2186 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2187 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2188 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2189 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2190 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 php-fpm 2253 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4 ... </pre> –  Ken Tang Mar 15 '13 at 14:42
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.