Mount your /tmp in ram

Posted on February 12, 2012

1


Target audience

This tip is aimed at Linux users with 4GB or more ram. Those with less can also use this but they should reduce the amount of ram allocated.

Disclaimer

This tip involves messing around with a system file. If it goes wrong you could render your computer un-bootable. This is nothing that a live CD can’t fix.

Here we go

Edit the file /etc/fstab you can allocate some of your ram to the /tmp file system. This is down to the rather wonderful in memory file system tmpfs.

sudo nano /etc/fstab

Add the following to the end of the file to allocate 1/2 Gigabyte ram to your /tmp.

tmpfs /tmp tmpfs size=512m 0 0

Then simply run the command

sudo mount -a

If your distro does not use sudo then su to root instead. This gives a nice little speed boost.

About these ads
Posted in: Hints and Tips, Linux