Ramdisk Size

Jeffrey B. Layton laytonjb at bellsouth.net
Mon Sep 22 14:34:04 EDT 2003

Tony Travis wrote:

> Eric R Johnson wrote:
>> I would like to create a large ramdisk to keep a database which will 
>> be searched often, but not changed.
>> The only thing I currently know how to do to create a ramdisk is:
>> mke2fs /dev/ram0
>> mount /dev/ram0 /tmp/ramdisk0
>> The only problem is that this creates a 4MB ramdisk, and I would like 
>> something on the order of 1GB.
> Hello, Eric.
> Are you *sure* you want to do this?
> RAM disks are usually used for loading modules at boot time. That's 
> why they are small. Typically, the contents of a RAM disk are used as 
> a root filesystem for the kernel to load e.g. SCSI drivers, then 
> discarded when the 'real' root filesystem is mounted from SCSI disks. 
> People also use them to boot a 'minimal' Linux for diagnostics or for 
> some other reason. 

   Check out Warewulf: warewulf-cluster.org. Very cool cluster
distribution that uses a very small Ramdisk to hold the necessary
parts of the OS. I've just started to use it and it's very slick.


> However, I think it would be better to use 'tmpfs' for a 1Gb RAM 
> filesystem. The kernel will provide fast access to the most frequently 
> accessed areas of your database held in RAM, but it will move the less 
> frequently accessed areas onto the swap device freeing up RAM for your 
> programs and for other disk caches. 

   What's the difference between tmpfs and a ramdisk created through
the kernel? Is there a speed difference?

BTW, here's a link on creating a generic ram disk:


(read the bottom part).

   If you are happy with the speed improvement of using a ram disk
to store the database, you might want to consider squashfs
(http://squashfs.sourceforge.net/) It's a read-only filesystem that you
can use to reduce the size of the required ram disk. You will take a
hit in speed, but perhaps the ram disk will make up for it. Oh, and
you will have to patch the kernel to use it.

Good Luck!


Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

More information about the Beowulf mailing list