Jan 252011
The older approach involves the creation of an ext3 filesystem on /dev/ram0 (a part of the RAM):
sudo mke2fs -t ext3 -m 0 -q /dev/ram0
sudo mkdir -p /media/ram0
sudo mount /dev/ram0 /media/ram0
sudo chown USERNAME /media/ram0
sudo chmod u+rwx /media/ram0
The newer and easier method to create a ramdisk is to make use of the tmpfs system shipped with the Linux kernel.
On Ubuntu there is usually already a tmpfs ramdisk mounted at /dev/shm but if you want to mount one more you can do that using:
mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
sudo mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/
It will create a 256MiB tmpfs ramdisk in /tmp/ramdisk. If you want a 1GiB ramdisk with 10240 inodes, only accessible by the owner of /tmp/ramdisk2 mount instead using:
sudo mount -t tmpfs -o size=1G,nr_inodes=10k,mode=0700 tmpfs /tmp/ramdisk2
resources
- http://en.wikipedia.org/wiki/RAM_disk
- http://wiki.ubuntuusers.de/Ram-Disk_erstellen
- http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/
- http://www.computechgroup.com/?p=423
VN:F [1.9.22_1171]
Usage of a Ramdisk on Linux, 9.0 out of 10 based on 1 rating