RAM disks

Sometimes it is desirable to have a ram disk for reasons as:

To create a ram disk check is you already have some ls -l /dev/ram*

If you are lucky you have some, so check if something is mounted: cat /etc/mtab | grep ram

If you do not find /dev/ram* device files, then you need to check the kernel:

You should modify it to have something as:


Then format it mke2fs -m 0 /dev/ram0

Create a mounting point and mount it: mount /dev/ram0 /mnt/ram

Recheck that it is mounted: cat /etc/mtab | grep ram

Check the disk size df -T | grep ram

cat /usr/src/linux/.config | grep DEV_RAM

If you are not happy with the size you could instead of reconfiguring and recompiling the kernel pass a parameter to the kernel at boot time to get more memory. Using grub add something as the following to get 16MByte

kernel /kernel-3.<version>-gentoo-r<release> ramdisk_size=16000

Linurs startpage