Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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 kernel.org/doc/Documentation/filesystems/… and kernel.org/doc/Documentation/filesystems/tmpfs.txt –  sciurus May 3 '11 at 4:00
    
Good point, answer edited to reflect this. –  Red Tux May 3 '11 at 4:53

Your Answer

 
discard

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.