Today I am going to explain about how to resize/recreate /temp partition in Linux. Why you need it? Many software like MySQL writes temporary files in /tmp partition and if /tmp is of less space then sometimes software are unable to function properly. Following are the steps I use to fix this problem:
- umount -l /tmp
- dd if=/dev/zero of=/usr/tmpDSK bs=1024 count=512000
- mkfs.ext3 /usr/tmpDSK
Then mount this to /tmp
- mount -o loop,rw,noexec,nosuid /usr/tmpDSK /tmp
Now new /tmp partition is created by you may have to give proper permission to your applications to this new /tmp directory. In my case I had to give permission to MySQL and achieved using following commands;
- usermod -G mysql /tmp
- chmod 0770 -R /tmp
That's it and you are done with it.