Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've some software that wants access to a very fast disk. I could buy an SSD, but my server has approx 64GB of ram spare. Is it possible to use a portion of that unused RAM to create and mount a virtual disk?

I'm using either Ubuntu or CentOS.

share|improve this question
up vote 8 down vote accepted

Tmpfs might help:

mount -t tmpfs -osize=4g tmpfs /mountpoint

You'll lose whatever is there if you reboot, though. It may be okay for temporary files, but it is not a replacement for an SSD.

share|improve this answer

Any unused RAM will be automatically allocated for caching reads / buffering writes - and you get the added advantage that its automatically flushed to disk. Certainly there will be times (e.g. after a reboot) when the cache might benefit from being primed - but that's just a matter of reading all the files.

share|improve this answer

You could probably use /dev/shm for this, as long as the files saved are temporary. Ubuntu apparently auto-mounts this filesystem. See this superuser question.

Alternatively you can create a custom ramdisk this way:

mount -t tmpfs -o size=SIZE tmpfs /where/to/mount

As SIZE you can specify either a size in K, M or G or a percentage of physical RAM (ie size=50%).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.