17

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?

Ken Tang
  • 309

2 Answers2

18

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.

CloudWeavers
  • 2,561
  • 1
  • 16
  • 17
3

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.

ewwhite
  • 201,205