Increase /tmp size

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:)

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

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

Scroll to Top