Usually big hosting firms, who have a proper sys-admin department in house, will have a proper cPanel partitioning scheme as well. But some players in the industry goes with the default partitioning scheme, diskdruid presents i.e /, /boot, and swap. While installing cPanel it uses a script to provide a loopback device to make /tmp, nosuid and noexec set . But the script never asks for the size of /tmp partition and instead creates a default 512MB /tmp partition.
Situations may arise which asks for increasing the /tmp partition in such cases and this is how it is done.
/etc/init.d/chkservd stop
/etc/init.d/httpd stop
/etc/init.d/mysql stop
/etc/init.d/postgresql stop
/etc/init.d/exim stop
umount /tmp
umount /var/tmp
If you get the error “ioctl: LOOP_CLR_FD: Device or resource busy” while doing umount, do the umount /tmp again. If it still says resource busy, it’s time to approach your sysadmin. Or else system may stop responding on further actions.
replace â512000â³ â2048000â³ â /scripts/securetmp
If you don’t want to edit /scripts/securetmp directly, you can use the below script. Create a file, paste the small script below, and then run “sh file_name_you_created”
#!/bin/bash
echo -n "How many GB you want the /tmp to be ? "
read GB
echo "Editing /scripts/securetmp file to have tmp size to $GB GB"
replace "512000" "$((GB*1024000))" -- /scripts/securetmp
/usr/bin/chattr +i /scripts/securetmp
rm /usr/tmpDSK
/scripts/securetmp
cd /tmp
/etc/init.d/chkservd start
/etc/init.d/httpd start
/etc/init.d/mysql start
/etc/init.d/postgresql start
/etc/init.d/exim start
/etc/init.d/securetmp start
A df -h after that should show the increased size. If for any reason your machine hangs, we are not responsible ð