Rename it and create a symbolic link to /tmp:
# mv /var/tmp /var/tmp1
# ln -s /tmp /var/tmp
Copy the old data back:
# cp /var/tmpold/* /tmp/
Resize /tmp from 512MB to 2GB
It’s quite common for a cPanel server to need a larger /tmp partition.
cPanel, by default, creates a loopback device that mounts to /tmp. The default size is only 512MB. This is quite small, especially for shared systems.
Reasons /tmp might become full:
* MySQL operation or Repair requiring temporary space. Keep in mind the /tmp partition must be big enough to support the largest table size on your system. (8GB table would require 8+GB /tmp space)
* PHP sessions consuming space in /tmp
* Rogue scripts living in /tmp
To resize follow these steps:
** Note that this will stop MySQL and will cause service interruption. These commands will resize /tmp to 2GB. If you wish to resize to a greater or smaller size simply change 2048000 to your desired size in bytes.
sed -i -e 's/512000/2048000/g' /scripts/securetmp
ln -s /var/lib/mysql/mysql.sock
If you receive errors stating that /tmp could not be unmounted simply run the following command to identify the PID (Process ID) still using /tmp
Next, kill all processes using /tmp using “kill –9