Thursday, September 1, 2016

How to Create a RAM disk in Linux

How to Create a RAM disk in Linux



as root user
   
mkdir /mnt/ramdisk
mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk

Please note the 1024M is the memory from physical memory, ensure the memory we assign for creating the ramdisk must be free. from the physical memory i.e. RAM, we are taking and creating the ramdisks.


Enter the following entry into the fstab file
vi /etc/fstab

tmpfs       /mnt/ramdisk tmpfs   nodev,nosuid,noexec,nodiratime,size=1024M   0 0

df -h

It will show the rman disks..

start using rman disks..

It is not recommended storage for any type of files and must not be used unless it is test environment .  A big no for important db. The data that get stored in ramdisks get erased when systems get reboot or for any other issues.

It is purely for testing not for real use. Take your own call..