jump to navigation

Linux : Mount /tmp as ramdisk to improve performance December 29, 2010

Posted 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.

  1. Open fstab using whatever editor you prefer: sudo vim /etc/fstab
  2. Add the following line at the bottom: none /tmp tmpfs defaults 0 0
  3. 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


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s