Date: Tue, 12 Sep 2000 16:06:47 -1000 To: Edoardo S Biagioni From: Bryan Lee Norman Subject: ramDisk i found this how-to...maybe it can give you an idea. CREATING A RAMDISK You can create a RAMDISK as large as your available RAM, less the memory needed for the operating system and applications. If you have 256M of RAM, a 200Mbyte RAMDISK would allow 56Mbyte of RAM for the applications and operating system. 1. Edit /etc/lilo.conf. Add the line: ramdisk=size-in-Kbytes The sample lilo.conf below creates a 40Mbyte RAMDISK: boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 image=/boot/vmlinuz-2.0.32 label=linux root=/dev/hda2 initrd=/boot/initrd-2.0.32.img ramdisk=40000 read-only append="mem=252M" 2. Run lilo to recompile the lilo.conf information. (On the command line type lilo and press Enter.) 3. A RAMDISK can be mounted to any empty directory, or use mkdir to create a directory mount point. For example, if you want to have the RAMDISK on a temporary directory in /home, cd /home mkdir temp 4. Edit /etc/rc.d/rc.local so the RAMDISK gets formatted and mounted on system boot. Add the following lines to the end of rc.local: mke2fs -m0 /dev/ram 40000 mount /dev/ram /home/temp WHAT THE LINES DO: "mke2f" assigned the RAMDISK to /dev/ram and formats it with the UNIX filesystem. "mount" mounts the RAMDISK /dev/ram on the directory /home/temp. All subsequent writes or reads to /home/temp will be done on the RAMDISK. MULTIPLE RAMDISKS You can add multiple "mke2fs" and "mount" lines to create other RAMDISKs. For example: mke2fs -m0 /dev/ram2 100000 mount /dev/ram2 /home/temp2 This creates a 100Mbyte RAMDISK called /dev/ram2, formats it, and mounts it to the /home/temp2 directory. 5. Load the RAMDISK. Data must be written to the RAMDISK before it may be read. It is common to back up the RAMDISK on a hard drive and reload the RAMDISK from the hard drive upon reboot. For example, this line could be added following the mke2fs/mount lines in rc.local: cp /backup/* /home/temp The "cp" copies all files on the hard disk backup directory to the RAMDISK mounted at /home/temp. Similarly, if the information on the RAMDISK is changed during operation, it must be rewritten to the hard disk backup before rebooting or turning off power. 6. After editing lilo.conf and rc.local, restart the computer. After executing LILO and rc.local, your RAMDISK will be operational. WHERE TO USE RAMDISKS Use RAMDISKs to replace access to frequently used hard disk files. In the database world, information access is dramatically accelerated by putting database indices into RAMDISK. Smaller databases can be entirely contained in RAMDISK. Some frequently used operating system files might benefit from being placed in RAMDISK. This has been tested on LINUX Red Hat 5.0, 5.2., and 6.0.