How to increase size of /tmp on cPanel server

We were regularly getting a error message that the /var/tmp directory in one of our cPanel server is full and we need to remove some data.

We considered the error log and discovered that the tmp partition goes full when the planned back-up runs. Therefore, we had nothing to do but increase the tmp partition size. After that, our server runs excellent and no problems or errors since then.

Here are the steps to increase the size of /var/tmp and /tmp partition on cPanle servers

Before start resizing we should stop the services by using following commands:

/etc/init.d/cpanel stop
/etc/init.d/httpd stop
/etc/init.d/mysql stop

 Umount /tmp and /var/tmp

umount -l /tmp
umount -l /var/tmp

 Take the backup of File

mv /usr/tmpDSK /usr/tmpDSK-bk

 Edit /scripts/securetmp

nano /usr/local/cpanel/scripts/securetmp

 Change the value of variable $tmpdsksize to required size.

Now to resize the /tmp partition run these commands one by one

rm -fv /usr/tmpDSK

 Then restart the Server

shutdown -r 0

Now when all services are restarted you may check the partition by using following command

df -h

 tmp size

[wpfmb type=’info’ theme=2]Time to time we need to remove old files from /tmp.,Here you can check steps on Deleting X days old files in TMP on cpanel server [/wpfmb]

Leave a Reply

Register to Get FREE Offers

Why Pay for Software when you can GET it for FREE