black and gray computer motherboard

How to create a ramdisk?

Whether you have SSD with NVME Protocol or good old HDD, It is not going to make you feel superior than your Random Access Memory or RAM.

By creating a ramdisk, you can use your unused memory as a super fast disk space and work with it. I do need to use nginx and for caching, I always go to tmpfs which is filesystem type that typically uses ram. How do I create one?

Processes are –

sudo mkdir /tmp/myramdisk
sudo chmod 777 /tmp/myramdisk

Fstab entry –

myramdisk  /tmp/myramdisk  tmpfs  defaults,size=1G,x-gvfs-show  0  0

Now, every boot, there will be a ramdisk named myramdisk for you. By the way, mount with mount -a

Thank you for reading this. This is kind of a journal.

2 thoughts on “How to create a ramdisk?”

Leave a Reply

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