How to Make a Linux RAM Disk
- 1). Log in to the computer as user "root" if your version of Linux allows superuser logins. If it does not, log in as your regular user.
- 2). Launch a command shell by clicking on the "Terminal" icon on the graphical desktop, or by logging in in text mode.
- 3). Elevate the privileges of your shell -- if you did not log in as "root" -- by typing the following command into the shell:
sudo -i
Press "Enter." Type your password, then press "Enter" again. - 4). Create a mount point, which is a location on your directory hierarchy for the RAM disk you will create. Type the following command into the shell:
mkdir -p /media/myRamDisk
Replace "/media/myRamDisk" by the full path of the mount point being created. Press "Enter." - 5). Create and mount the RAM disk by typing the following command into the shell:
mount -t tmpfs none /media/myRamDisk -o size=512m
Replace "512" by the size (in Megabytes) of the RAM disk you want to create. After executing this command, all applications will be able to read from, and write to, the RAM disk as if it were any regular Linux storage device.
Source...