Introduction to Ram Disks
Clear your Temporary Internet and Cookie directories with the flick of a switch
You probably clear your cookies and temporary Internet files once in a while. Some clear it more often than others (for obvious reasons...;-). But if you've read our "Secure File Deletion" tutorial then you'll know that deleting files DOES NOT remove them from disk and it's quite easy to recover them. Then there is the persistent index.dat file that refuses to leave without a fight. - Are you paranoid? (hopefully you're not) but if you are or simply want to clear these "caches" of data with the flick of your reset button then the answer is RAM DISK!
Ram Disks are exactly as the name suggests. Using Ram Disk software you are able to assign part of your physical memory to act as a "drive" on your computer. You can then use this drive as any other drive on your system but the difference is the data is cleared no matter what upon a reboot (since all data on the RAM chip is lost). So you can see that the best things to store on a Ram Disk are your Temporary Internet files and Cookies. Every bit of persistent data will "vanish" without a trace when you want it to. There is also the added bonus of reduced disk activity and possibly enhanced performance.
You need to have plenty of memory to "mount" a Ram Disk. Remember every bit of RAM is important for the well being of your system and the bigger your Ram Disk the less memory that is available for your system. Get a decent RAM monitor and see how much free physical memory you have left during your normal day to day use of your computer. Then think how much space you'll require on your RAM DISK. It may be that you need a new stick of RAM for everything to work smoothly.
RAM Disk Software
For Microsoft Windows
[sample] RAM DISK driver (with source code!) for
I don't really recommend this unless you are a tweaker/developer. In its current form there is a maximum disk size of 32MB and unfortunately the new disk identifies it self as a "Ram Disk" -not- "hard disk" hence some applications may get confused and not see the disk. Also you have to change registry entries to configure it. The sample driver is good to learn how RAM Disks work however.
- Ram disk9x
Whilst not free this software provides the richest feature set. There are lots of settings to optimize your Ram Disk including disk images. If you chose this software please read the documentation thoroughly as the various options are VERY powerful. Also it supports both the NT/2000/XP AND Win9x architecture.
for 2000/XP/2003 (and WinPE)
Freeware RAM DISK software based on Microsoft's sample driver but includes a graphical interface to easily change settings. Easy to install and the disk can be dynamically resized without a reboot. An extended version is available that allows for disks over 64MB and support for WinPE systems. The source for the standard version is also available.
Setting it up is pretty easy and you'll end up with a new drive with your choice of drive letter. (T:\ is a good one, it reminds you that its temporary). If you want more than just a simple Ram Disk then RamDisk9x/NT is the way to go.
For Linux based Operating Systems
On newer kernels (2.4 and above) simply issue this command as privileged user to create a dynamic RAM DISK that expands and contracts as required. Unlike older versions, memory is released back to the system after un-mounting. The kernel will expand the drive whilst balancing memory usage. For those that compiled the kernel without ram disk support you may need compile it again
mount none /mnt/ramdisk -t tmpfs
Your RAMDISK is now available for use at /mnt/ramdisk
/mnt/ramdisk must exist prior to mounting so create the directory
Using your RAM Disk!
After you install the Ram Disk software and have a new drive working it's time to move the caches over to it.
First lets set your IE Cache to be stored on your new RAM Disk. Create a folder on your new RAM DISK where you want your Temporary Internet Files to be stored. Creating directories on your new disk is the same as on a normal hard disk.
Now click Start -> Settings -> Control Panel -> "Internet Options", click "Settings" and then "Move Folder". Browse to the folder you just created on your RAM DISK, move the disk space slider to a new value that is less than your RAM Disk and then hit OK at all the prompts. Internet Explorer will recreate this folder upon every reboot.
Moving Cookies Dir
Moving your cookie directory to your RAM Disk a little harder. You'll have to edit these two keys in the registry so be careful.
CurrentVersion\Explorer\User Shell Folders\History
You can move anything "temporary" onto your Ram Disk. All data will be lost permanently upon a reboot or system shut down. I recommend not moving your Windows "temp" directory to your Ram Disk because some software store data in there which may be required after a reboot. That's an incorrect way to use the temp directory but unfortunately many software titles do so.
Mozilla/Firefox, Opera, Konqueror et al have simple user interface options to set Cache and Cookie locations so look at your particular browsers preferences menu.
A ~30MB Ram Disk should be fine for tasks mentioned above, although if you have less than 128MB then it may actually be too big and will deny the system of valuable memory. If you have a lot of RAM such as 768MB or 1024MB you could make a massive 500MB RAM Disk. This will boost performance if you have to extract large amounts of data before installing it (there is virtually no "write/read" time on a RAM DISK). If you are a developer of software that creates lots temporary files at compile time then again this "large" RAM Disk method is good. Most Ram Disk software create drives with FAT16 as the file system hence the "disk" size is ~2GB (though I doubt most have this much to dedicate to a disk). Ram Disks work well in the NT/2000/XP environment as they have far superior memory management compared with the Win9x/ME product line.
As a final note never store important data on your Ram Disk as a system crash may mean a reboot and a reboot means loss of all data on the Ram Disk.