How To Create A RAMDISK On Ubuntu / Linux

In this tutorial I will show you how to create a RAMDISK on Ubuntu/Linux. A RAMDISK is basically using your RAM to store files and is much quicker that storing them on your hard drive. You should only use a certain percentage of your available RAM because this could take away from your performance.

Creating A RAMDISK On Ubuntu/Linux

To create a RAMDISK first you have to make a folder that will somewhat act as an alias to browse and use the space you will be mounting and dedicating to this RAMDISK. You can do this by opening a terminal (CTRL+ALT+T) and running the command below.

sudo mkdir -p /media/<FOLDERNAME>

After this you will need to mount the folder to a temporary storage area on that uses RAM instead of hard drive space. You can do this with the following command, you should edit the grey to what you need.

sudo mount -t tmpfs -o size=2048M tmpfs /media/<FOLDERNAME>

After this you can navigate to your RAMDISK by going to the folder you created located in /media/. If you want to unmount the RAMDISK then you just need to enter this next command and it should be done.

sudo umount /media/<FOLDERNAME>

I hope this helped you create a RAMDISK on Ubuntu/Linux, please don’t forget to share/like/plus-one as it helps the blog out a lot. Thank you!

Incoming search terms: