How to increase tmp partition in Linux? 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /tmp partition full… How to increase /tmp partition in Linux?
  2. You can create a Virtual partition on Linux in case your server isn’t built with a /tmp partition OR you need
  3. to increase the size of the partition for some reason, and then you can mount the virtual partition as /tmp.
  4. The following steps will guide you to create a virtual partition:
  5. 1) To create a virtual partition of 2GB, use the below dd command:
  6. # dd if=/dev/zero of=/home/tmp-dir bs=1024M count=2
  7. 2) Once the partition is created, you need to create the file system on it using the mke2fs command
  8. # mke2fs -j /home/tmp-dir
  9. 3) Now, the partition is ready to be used but you need to mount it on /tmp directory.
  10. # mount -t ext3 -o loop /home/tmp-dir /tmp
  11. Here, we have used ‘loop’ while mounting /home/tmp-dir partition because we are not mounting an actual
  12. block device but to make a file accessible as a block device.
  13. 4) To verify the partition, execute
  14. # mount
  15. 5) To make sure this partition is mounted automatically after every reboot, edit the /etc/fstab file and replace
  16. the /tmp line with the following one:
  17. /home/tmp-dir /tmp ext3 defaults,loop 0 0