How to increase tmp directory size in cPanel

increase tmp directory
Increase tmp Directory

How to increase tmp directory size in cPanel

This post explains a way to increase tmp directory (/usr/tmpDSK) size in cPanel. You may be noticed the following notification email from cPanel.

Drive Critical: /usr/tmpDSK (/tmp) is 100% full

It is due to the /tmp directory is got filled with temporary files. The file /usr/tmpDSK is created while running the cPanel script /scripts/securetmp. /scripts/securetmp is used to secure the /tmp partition. If you run the script /scripts/securetmp, it will mount the /tmp partition to a temporary file for extra security.

You can simply increase the /tmp directory size using the following steps:

First of all please edit /scripts/securetmp for this line:

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

Increase it to the desired size you want to setup. I am changing this line for 4GB here.

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

Please stop Apache, MySQL and cPanel services to prevent them to write files to tmp directory.

service httpd stop
service mysqld stop
service cpanel stop

Then you need to unmount /tmp and /var/tmp partitions and remove the file /usr/tmpDSK. Once it is completed, run the cPanel script /scripts/securetmp again.

umount -l /tmp
umount -l /var/tmp
rm -fv /usr/tmpDSK

It will create /tmp partition with the size 4GB and then it will mount to the file /usr/tmpDSK. Once the process is completed start the services:

service httpd start
service mysqld start
service cpanel start

That’s it!

Also Read: How to Increase tmp partition size on CentOS

If you like this post and wish to receive more articles from us, please like our FB page: Button

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at

Add Comment

Click here to post a comment