Re-create corrupt /tmp directory on cPanel server

Wed, Jun 8, 2011


This is another one of those things that I can never remember off the top of my head, so I’m sticking it here for reference. I believe it was originally posted somewhere on the cPanel forums by the almighty chirpy.

lsof /tmp
# Umount /tmp and /var/tmp:
umount -l /tmp
umount -l /var/tmp
# Remove the corrupt partition file
rm -fv /usr/tmpDSK
# Create a nice new one

2 Comments For This Post

  1. Phoenix Says:

    Good tip. But the “securetmp” creates a very small tmp folder, less than 500 MB. For busy sites, this is useless. Do you know any way to increase the size of the /tmp folder it creates?

  2. Ben Says:

    Hi Phoenix,

    If you edit /scripts/securetmp, on about line 150, you will find my $tmpdsksize = 512000; # Must be larger than 250000

    Just set that to a larger number, make sure nothing is writing to it (and kill anything that is), then run /scripts/securetmp.

    There is a full guide to increasing the tmp size here:


Leave a Reply