/tmp used 100% where is files?

24,280

Solution 1

You should use 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.

Solution 2

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:
24,280

Related videos on Youtube

Ken Tang
Author by

Ken Tang

Updated on September 18, 2022

Comments

  • Ken Tang
    Ken Tang over 1 year

    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?

    • Brigo
      Brigo about 11 years
      df -h is telling you Used=0 ...
  • Ken Tang
    Ken Tang about 11 years
    <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
    Ken Tang about 11 years
    All /tmp space used by so many threats like: php-fpm 2186 nginx DEL REG 253,3 12 /tmp/apc.7mboJ4
  • Ken Tang
    Ken Tang about 11 years
    I have server with nginx+php-fpm+apc so it looks line the /tmp partition is not enough space at all...
  • Ken Tang
    Ken Tang about 11 years
    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???
  • CloudWeavers
    CloudWeavers about 11 years
    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
  • jdknight
    jdknight about 9 years
    An alternative command to lsof /tmp is the command fuser -vm /tmp.