Knowledgebase

Powered by WHMCompleteSolution

Language:

Please Login or Register

 

Knowledgebase Article
Subject: How to increase the partition size of /tmp which logically points to /usr/tmpDSK?
Log in to SSH using root access and do the following commands:



/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.



Just to note though, if for any reason your machine hangs, we cannot be held responsible
Back