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

  • 0

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
/scripts/restartsrv_tailwatchd

13. Mount all filesystems

mount -a

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

Hope it’s working well with you!


Was this answer helpful?

« Back

Send Message