How to increase /tmp & /usr/tmpDSK size in Linux

1. Connect to your server using SSH or WHM Terminal

2. Stop MySQL service and kill the tailwatchd process. Run the following command:

/etc/init.d/mysqld stop

to kill all processes run this command to check out what is running behind the scenes!

pstree -p | grep tailwatchd

after knowing the running processes kill them using this command but don’t forget to change process ID

kill -9 2522

3. Take a backup of /tmp as /tmp.bak. To do that, run the command line:

cp -prf /tmp /tmp.bak

4. Create a 10 GB file in the available free space

dd if=/dev/zero of=/usr/tmpDSK bs=1024k count=10240
du -sch /usr/tmpDSK

5. Assign ext3 filesystem to the file:

mkfs -t ext3 /usr/tmpDSK

if this message appears to you, type y and click Enter on your keyboard
Proceed anyway? (y,n) y

6. Check the file system type

file /usr/tmpDSK

You may also use the following comands for making ext3 file system on a file.

mkfs.ext3 /usr/tmpDSK
mke2fs /usr/tmpDSK

7. Unmount /tmp partition

umount /tmp

8. Mount the new /tmp filesystem with noexec

mount -o loop,noexec,nosuid,rw /usr/tmpDSK /tmp

9. Set the correct permission for /tmp

install -d –mode=1777 /tmp
ls -ld /tmp

or, use this simple command as root

chmod 1777 /tmp

10. Check if the /tmp size is updated!

df -h

this command should return something like this:
Filesystem Size Used Avail Use% Mounted on
/usr/tmpDSK 6.0G 68M 5.9G 4% /tmp

if you see the new size appear like the above example, then it’d DONE!

11. *optional* Restore the content of old /tmp.bkp directory

cp -rpf /tmp.bak/* /tmp

12. Restart MySQL and tailwathchd services

/etc/init.d/mysql start

13. Mount all filesystems

mount -a

after that check the filesystems again using df -h command.

Hope it’s working well with you!

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...