Increasing the Size of tmpDSK (/tmp)
Posted by Vanessa | Tagged under fixes,howto | Posted on February 5, 2010
17
You may have noticed that cPanel’s default partition size for /tmp is 512 MB, which in some cases can be way too small. The /tmp partition on cPanel servers, assuming it was the one cPanel created and not one you did yourself, is a file-based partition that can easily be resized.
By default on most servers, /tmp is the temporary dumping place for a lot of things, for example:
- PHP session files
- PHP temporary file uploads
- MySQL temporary files
- Cache files for certain Apache modules
Most software that uses temporary files or sessions will automatically prefer to use /tmp – this folder is usually set to 777 permissions and therefore writeable by every user on the server.
When your /tmp partition fills up, it can cause noticeable problems for your users. If you run a larger server, the /tmp folder can fill up quickly and be very annoying as far as maintenance is concerned. Fortunately there is a very easy way to increase the size of this partition on a standalone server.
- Stop MySQL, Apache, and cPanel to prevent writing to the /tmp partition
- Copy the contents of /tmp to another location, such as /home (cp -rfp /tmp /home)
- Unmount /tmp. If you’re unable to, you can do an lsof (lsof |grep /tmp) to see what processes are still writing to it, and kill them off. Or do a lazy unmount (umount -l /tmp) .
- Delete /usr/tmpDSK (rm -rf /usr/tmpDSK)
Now open /scripts/securetmp and look for this line:
my $tmpdsksize = 512000; # Must be larger than 250000
And change the “512000″ value to your desired size in MB, and save the file. Now run the following script to recreate /tmp:
/scripts/securetmp
This will recreate your /tmp (tmpDSK) partition using the size you specified. While the securetmp script may be overwritten in a cPanel update, the size of /tmp will not be affected one you alter its size.
Related posts:





sending...

[...] this is a continual issue, try increasing the size of the /tmp partition: Increasing the Size of tmpDSK (/tmp) :: The cPanel Admin __________________ http://www.thecpaneladmin.com [...]
[...] Increasing the Size of tmpDSK (/tmp) [...]
What would you recommend making the size of the /tmp ? thanks Mally
Usually between 1-2GB
[...] WHM kullanarak /tmp boyutunu değiştirme: Link [...]
Hello there thx you very much
Actually, the permissions of /tmp should be set to 1777, not 777. The sticky bit should be set to ensure that users are unable to modify other user’s data. Most phpmyadmin errors and common PHP script errors (such as /tmp/.sessXXXXXXXX) can be eliminated by properly setting /tmp to 1777.
phpMyAdmin and other cPanel software now use /var/cpanel/userhomes for tmp data storage – so the permissions of /tmp as 777 or 1777 will both work.
Thank you. very helpful!
Hi thanks for this tutorial,
Is there anything in the /tmp folder copied to /home/tmp that needs to be put back after following the rest of the process. Or is everything that was in the original expendable?
thanx this helps me…
Worked perfectly on a CentOS VPS (Linode) – Didn’t even need to reboot!
Also, the reason I needed to do this is because it keeps getting full. Is there any thing I can do to make sure it stays clean?
It depends – do you know what’s filling it up?
Thanks for your guide.
I followed the guide – any ideas why my /tmp size hasnt’ increased by the /usr/tmpDSK has?
/tmp /var/tmp 3% (13,410 of 495,844)
/usr/tmpDSK /tmp 2% (36,908 of 2,015,824)
Thanks
Kevin
You need to many sure that /tmp is mounted using /usr/tmpDSK. Yours isn’t.