Server Administration & Management

Increasing the Size of /tmp Directory

By Default, cPanel’s /tmp partition size is 1024 MB to5120 MB, which in some cases can be way too small.  The /tmp partition on cPanel servers 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
  • Others temporary files

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. So there is a following way to increase the size of this partition on a standalone server.

  1. Stop MySQL, Apache, and cPanel services to prevent writing to the /tmp partition
  2. Copy the contents of /tmp to another location, such as /home or /root (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)(-l options is use for focefully umount the partition) .
  4. Delete /usr/tmpDSK (rm -rf /usr/tmpDSK)

Now open /scripts/securetmp and look for this line:

#tmpdsksize     = 1024000;    # Must be larger than 250000

And change the “1024000″ value to your desired size in MB, and save the file. Now run the following script to recreate /tmp:


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.

January 5, 2011 - Posted by | Unix/Linux | , ,


  1. This really is a terrific article. Thank you so much for taking the time to describe all of this out for us. It is a great help!

    Comment by Randal Rochlin | June 15, 2011 | Reply

  2. Please continue to write on this subject matter. Generally there is usually a larger need than you may expect for this sort of advice and assistance. That which you talk about is beneficial to the individual that wants the ideas that you have put together.

    Comment by clean water | June 15, 2011 | Reply

  3. Nice one for unveiling this data. I believe it is extremely valuable certainly share it to associates, too. If you keep on writing about this subject I will certainly carry on checking your upcoming blogposts.

    Comment by fresh water | June 16, 2011 | Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: