/tmp running out of inodes

Tankko tankko at gmail.com
Thu Dec 18 17:25:32 UTC 2008


For the second time in 2 weeks my server has gone down due to running
out of inodes in /tmp.  The first time it did this /tmp was filled
with files, so that made sense.  I delete all the files from /tmp and
all was well for a few weeks.  Just this morning it did it again (keep
in mind that this sever is currently 700 miles away) and had to be
rebooted.

But when I looked at /tmp, it was empty except for a couple of files,
but running df shows the follow:

Filesystem     Size    Used   Avail Capacity iused    ifree %iused  Mounted on
/dev/ad4s1a    496M     59M    398M    13%    1535    64255    2%   /
devfs          1.0K    1.0K      0B   100%       0        0  100%   /dev
/dev/ad4s1e    496M     69M    387M    15%   65790        0  100%   /tmp
/dev/ad4s1f    221G    5.2G    198G     3%  337742 29596848    1%   /usr
/dev/ad4s1d    1.9G    757M    1.0G    42%    1632   280990    1%   /var
/dev/md0        19M     12K     18M     0%       9     2805    0%   /tmp
/dev/ad5s1c    289G     49G    217G    18%   27779 39115643    0%   /bigdrive

65790 used inodes and 0 free on /tmp

I ran fsck and it shows:

** /dev/ad4s1e (NO WRITE)
** Last Mounted on /tmp
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
65790 files, 35374 used, 218441 free (9 frags, 27304 blocks, 0.0% fragmentation)

So where are these mysterious 65790 files?  Is there a way to clean
this up?  And more importantly is there a way to do this remotely
given that I am 700 miles from the server right now?

Every time the server goes down due to this problem, it won't come up
again without someone physically running fsck at boot.

On a side question...what the the best policy for deleting files from
/tmp?  Seems like a lot of apps are happy to leave files in /tmp.  Is
clean up commonly done as a cron job?  What about files like
mysql.sock= which are important.  I can't just blindly remove
everything in /tmp each night.

Thanks for any help.

Tankko


More information about the freebsd-questions mailing list