if you are getting error on site due to tmp of full or getting emails Drive Critical: /dev/loop0 (/var/tmp) is 97% full then you have to follow steps below.
First you have to resize the tmp partation
Edit /scripts/securetmp
nano /scripts/securetmp
and fine the line my $tmpdsksize
my $tmpdsksize = 512000; # Must be larger than 250000
Change to this line for 2GB:
my $tmpdsksize = 2097152; # Must be larger than 250000
Save the file then run these commands to resize /tmp partition:
umount -l /tmp
umount -l /var/tmp
rm -fv /usr/tmpDSK
/scripts/securetmp
You can use the following steps to move the MySQL /tmp directory location:
nano /etc/my.cnf
Place the following line into the file under the [mysqld] section:
tmpdir=/mysqltmp
Save the file
- Create the /mysqltmp directory
mkdir /mysqltmp
chmod 1777 /mysqltmp
- Restart MySQL and check that the tmpdir is now /mysqltmp
/etc/init.d/mysql restart
mysqladmin var | grep tmpdir
You should see the following return:
mysqladmin var | grep tmpdir
| slave_load_tmpdir | /mysqltmp
| tmpdir | /mysqltmp
This presumes / partition itself has sufficient space. I would like to hope / partition would have more space than /tmp was provided on most systems.