Knowledgebase: cPanel
Increase the Size of tmpDSK (/tmp)
Posted by SEO Admin on 20 July 2015 12:37 PM

cPanel’s default partition size for /tmp is 512 MB, which in some cases can very small for your uses. 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, which 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, which is super 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.

To increase the size of the partition on a standalone server:

  1. Stop MySQL, Apache, and cPanel to prevent writing to the /tmp partition

  2. Copy the contents of /tmp to another location, such as /home (cp -rfp /tmp /home)

  3. 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)

  4. Delete /usr/tmpDSK (rm -rf /usr/tmpDSK)

  5. ‚ÄčOpen /scripts/securetmp and look for this line:

    my $tmpdsksize     = 512000;    # Must be larger than 250000

  6. Change the '512000' value to your desired size in MB, and save the file

  7. Run the following script to recreate /tmp: /scripts/securetmp


This will recreate your /tmp (tmpDSK) partition using the size you specified. While the secure tmp script may be overwritten in a cPanel update, the size of /tmp will not be affected one you alter its size.

(2 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk Software by Kayako fusion