We can increase the /tmp directory by doing the following steps:

cd /usr
dd if=/dev/zero of=/usr/tmpMnt bs=1024 count=2000000

mke2fs -j /usr/tmpMnt

cd /
cp -R /tmp /tmp_backup

mount -o loop,noexec,nosuid,rw /usr/tmpMnt /tmp
chmod 0777 /tmp
/bin/cp -R /tmp_backup/* /tmp/
rm -rf /tmp_backup

+ Now, we will need to add this new block device in fstab. Open fstab by using your favorite editor

nano -w /etc/fstab

+ Add the following line at the bottom of the file

/usr/tmpMnt /tmp ext3 loop,noexec,nosuid,rw 0 0

That is it:)

3 thoughts on “Increase /tmp size”

  1. You have to specify the file system format. e.g ext3

    in case if it is not accepting then go to /etc/fstab add the line exactly mentioned below.

    /usr/tmpMnt /tmp ext3 loop,noexec,nosuid,rw 0 0

Leave a Reply