Is there such a thing as a persistent ram drive?

I have a laptop with a LAMP setup. The HDD is slow, which causes my unit tests to run slowly.

I was wondering whether I could mount the web root the mysql database on some kind of ramdisk.

From what I have read of ramdisks, they are non-persistent.

Is there anyway to create a ramdisk that writes changes to an area of the hdd when shutting down and re-mounts the ramdisk on bootup?


A ramdisk is probably the way to go. However if you have some money to spend, and want a really persistent solution, you may also want to look at SSD Hard disks. The technology is quite young and not as robust as the classic hard disk yet, but it is maturing and becoming kind of affordable.


What you are looking for is something that stores the fs data in memory, persists it if it can, but doesn't worry too much about losing your data (as in if someone turns off the power).

You could look into cachefs, and see if you can configure it to be really lazy about writes.

I'm also suspicious that you are solving the right problem. With a reasonable amount of memory, you shouldn't be blocking on those disk writes.

you can also set the writeback mount option for your filesystem. See, for example, this.


You could write a simple rc script that does that. I remember doing a similar thing back in DOS days (with autoexec.bat) for fast access to some files.

You might consider buying an SSD or RAM drives with HDD interface instead.