Many of you might have come across situations where your /tmp gets filled very often either due to eaccelerator cache or due to session files or such temporary files. Cpanel by default creates /tmp with 512M size. You can always resize tmp to your choice. Here is the step by step details on how it can be done.
1) Stop mysql, apache and cpanel to prevent writing temporary files to /tmp.
2) Unmount tmp partition.
Sometimes you will receive errors stating that the device is busy or /tmp cannot be unmounted. Then find out all processes using /tmp and kill them.
The above command will list the process ids currently using /tmp. Kill the pids as follows.
kill -9 pid
eg: kill -9 3766
3) The cpanel /scripts/securetmp is the one which maintains the tmp size. You can edit the following line in it to change the size.
my $tmpdsksize = 512000;
Suppose you want to raise the partition size to 2G, you can also do it as follows.
sed -i -e ‘s/512000/2048000/g’ /scripts/securetmp
The above will replace 512000 with 2048000 in the file /scripts/securetmp
4) Remove the temp disk
5) Now, run the following to recreate tmp
6) Now go to /tmp and set the mysql socket file.
ln -s /var/lib/mysql/mysql.sock
7) Restart all services
8) Now check your tmp size using the command df -h