LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   TMPFS, RAMFS and BSDs MFS (https://www.linuxquestions.org/questions/linux-general-1/tmpfs-ramfs-and-bsds-mfs-717750/)

sleeper0110 04-08-2009 12:33 PM

TMPFS, RAMFS and BSDs MFS
 
In *BSD they have something called MFS, memory file system. As far as I can tell, Tmpfs and RAMfs in linux are very similar in concept, however there is one option in MFS that I don't see in tmpfs/ramfs.

MFS give the option to mount some ram to a directory based off of an existing directory (see -P option). So you can mount the contents of /home/user/dir to /mnt/dir as an MFS partition. Any changes you make in /mnt/dir don't propagate to /home/usr/dir, you have to do that copy manually.


Is there a similar feature in tmpfs/ramfs? I know you can probably do the copy manually, but would be nice if I could specify the contents when I mount the ram based partition.

Thoughts?

johnsfine 04-08-2009 12:50 PM

I'm not quite sure what you're describing, but I think it is a combination of aufs and tmpfs.

I'd need some retesting to rediscover the details (I can't explain from memory) but the general concept is:

You mount an aufs that represents parallel directory trees between an ordinary already mounted directory tree and a new (initially empty) tmpfs.

On every file lookup or read, the aufs will look in the tmpfs first, but if the file isn't there it would read from the other directory tree.

On every file write, the aufs will write only to the tmpfs. If you write to only part of a file, the rest of the file is copied from the other fs to the tmpfs.

So the aufs represents a modified copy of the underlying directory tree, with the tmpfs holding only the files that are different.


All times are GMT -5. The time now is 06:18 PM.