Interestingly enough, I can think of 4 different ways to get something like a ram disk on Linux. (If you don't know which one you want, you want tmpfs.)
1. The old ramdisk driver (brd). With this kernel module, you can create a number of ramdisks, all the same size, with the first one being (IIRC) /dev/ram0. After inserting the module, you can make a file system on the device and then mount it. One downside is that the size is fixed at creation, and will always consume the full amount of ram.
2. Use ramfs or tmpfs. These are in-memory filesystems, and unlike the brd driver, will only consume the amount of memory actually needed to store the files. (The half ram limit is there for safety, and it can be changed when mounting (or remounting, which is handy because it won't erase existing files.) The main difference between the two is that tmpfs can be swapped to disk (if you have swap configured), but ramfs will always remain in memory (and filling memory with ramfs can cause a kernel panic). (One other difference I noticed; you can create a swap file on ramfs (not that there is any point other than perhaps testing the swap mechanism), but the kernel won't let you do this on tmpfs, with good reason; using the loop device to work around this restriction is a good way to deadlock the kernel, locking up the entire system.) tmpfs is the simplest way to get a ramdisk on Linux, and is recommended for most uses. Note that there is no need to create a filesystem, as ramfs and tmpfs are filesystems rather than devices. (If you actually need a specific file system for whatever reason, there's always the loop device.)
3. Use zram. This module creats a number of block devices, but you have to activate them individually by writing to files in /sys/modules/zram. The notable characteristic of the zram devices is that the data is compressed in memory, which saves RAM at the cost of CPU cycles. Note that you do need to create a filesystem on this device for it to work. One use for zram is to put swap space there.
4. Use phram and mtdblock. This is a highly specialized approach; you need to find some area of physical memory that the kernel isn't used, and you can use these modules to tell the kernel to treat that region of memory as a block device, allowing you to make a filesystem here. The uses of this mechanism tend to be rather specialized; accessing the ramdisk created by the MEMDISK utility (from syslinus) is one use, while I've read about it being used to use GPU memory as swap. I've also seen it as a way to be able to access kernel memory or hardware registers from userspace, which is occasionally useful for kernel or hardware debugging.
clarry: If you have enough RAM, you can just extract it on a tmpfs and it likely won't hit the disk.
rtcvb32: Tried that, the tmpfs was locked at half the ram size (
2GB), although i can probably override it that is already done for now.
That's only an upper limit set at mount time, and it can be changed by remounting the filesystem (mount -o remount,size=13G to change the size to 13 gigabytes, for example).