Linux : Mount /tmp as ramdisk to improve performance December 29, 2010Posted by Tournas Dimitrios in Linux.
My previous article made an introduction to the concepts of ” ramdisk ” and the benefits of using them on a Linux box . This article will demonstrate a practical example …. To increase performance on your linux box and decrease IO waits for applications that use /tmp, you can mount it as a ramdisk. The process is simple, just keep in mind that it gets cleared any time a system is rebooted.
- Open fstab using whatever editor you prefer: sudo vim /etc/fstab
- Add the following line at the bottom: none /tmp tmpfs defaults 0 0
- Save and exit.
If you have /tmp already mounted as a separate partition, comment it out in the fstab.
Reboot your system.
You can also optionally specify the size of the partition (the amount of RAM to use). This is not necessary and probably best to let your system manage the memory.
none /tmp tmpfs defaults,size=512m 0 0