Using tmpfs to mount /tmp in RAM

On a Unix/Linux/BSD device /tmp tends to see heavy usage. I’ve moved mine into RAM to ever-so-slightly improve performance and more significantly reduce SSD I/O.

To do this I edited

/etc/fstab

as root with my favourite editor. I added the following line at the end:

tmpfs           /tmp            tmpfs   defaults,noatime  0       0
tmpfs           /var/tmp        tmpfs   defaults,noatime  0       0

You can reboot at this point and you’re all set. You could manually mount this but it could cause problems with your system.

UPDATE: Ubuntu and Lotus Notes for Linux don’t like mounting /tmp as nosuid and noexec.

Let me know if you do this and how it works for you.

This site uses Akismet to reduce spam. Learn how your comment data is processed.