Increase the size of /tmp

Once the process of the server increase, /tmp drive space may not able to cater your server need. So if you are using the cPanel, there is a script for you to increase it. Below is the step.

(1) Open /scripts/securetmp and edit the link as below

my $tmpdsksize = 512000;

Note: This is increase to 512MB

(2) stop cpanel, httpd, mysql service first as we do not have new session file go there when we increase the size.

service httpd stop
service mysql stop
service cpanel stop

(3) Take a copy of all the session file in /tmp

cp -apr /tmp /tmp_bak

(4) Check what processes are still writing to /tmp and kill it

lsof |grep /tmp

(5) Unmount /tmp

umount /tmp

(6) Run the script that you edit in step 1


(7) Verify it have done

df -h

(8) Copy back the session file

cp -apr /tmp_bak/* /tmp/

(9) Start back all service

service mysql start
service cpanel start
service httpd start

Done, bingo!

Leave a Reply

Your email address will not be published. Required fields are marked *