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 need to put two directories into a ramdisc. They share the same parent directory but I can't make that parent directory part of the ram disc. How would I go about doing this?

share|improve this question

In Linux if a directory is associated with a mount all storage goes to that mount. With that said it is possible to have a TMPFS (Temp file system) mount inside a file system which comes from iSCSI for example, and within the TMPFS file system you can mount another file system which comes from local disk.

So in your case you have /path/to/parent as the directory you want your child1 and child2 directories.. In this case it's just a matter of putting this in your fstab file.

tmpfs /path/to/parent/child1 tmpfs defaults,size=20m 0 0
tmpfs /path/to/parent/child2 tmpfs defaults,size=20m 0 0

Now if the directory /path/to/parent is in another file system that file system must be mounted first.

More information can be found here.

share|improve this answer
I'd feel a little safer recommending tmpfs over ramfs. See… and – sciurus May 3 '11 at 4:00
Good point, answer edited to reflect this. – Red Tux May 3 '11 at 4:53

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.