You are not logged in.
Pages: 1
I have a question for you all linux filesystems experts...
The setting: I have an eee laptop, and I want to have /var mounted in the memory, so that the ssd doesn't get written to too often. The best solution I've come up so far is to mount /var as tmpfs, and every now and then (for instance after booting and before shutdown, and before some other dangerous moments) rsync its contents to some other location, so that I don't loose the changes made to it.
I remember that on openbsd one could use mfs (their version of tmpfs) which has one advantage: during its mounting one can specify a directory whose contents will be present on the newly mounted filesystem. An example fstab line:
swap /var mfs rw,-P=/perm/var,-s=32768,noexec,nosuid 0 0
Thus, rsyncing the whole /perm/var to /var right after mounting /var as tmpfs is not necessary. [EDIT: of course, rsyncing before unmounting *is* still necessary.]
The question: is this possible with some analogue of tmpfs on linux? As far as I could find out, tmpfs does not support this feature.
Thanks.
Last edited by bender02 (2008-11-03 14:48:03)
Offline
I don't know about that, never heard of it.
But, what _is_ possible - and much simpler -: Linux flushes dirty block to disk at specified intervals. So you could make it a disk filesystem, just one that gets flushed infrequently.
Only caveat: I'm not sure if you can specify this on a per-device or per-filesystem basis. Google will know. See http://tynne.de/r31 and maybe http://www.gelato.unsw.edu.au/lxr/sourc … p-mode.txt
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Thanks for the links. I think the flushing is a global thing. I think I'll still go with my rsyncing - that's something I have a direct control over
Offline
Yeah, I think there are only global settings for dirty page flush. I tried tweaking them on my Eee but quickly ended with a very unresponsive system.
For now, I simply mount some directories like /tmp, /var/log or /var/cache/pacman/pkg to ram because I don't really care about keeping their contents.
What does not kill you will hurt a lot.
Offline
For now, I simply mount some directories like /tmp, /var/log or /var/cache/pacman/pkg to ram because I don't really care about keeping their contents.
Yes, that works pretty well as well. I just wanted to keep the logs (especially pacman.log), and then I thought that why not mount the whole /var as tmpfs. My original intention was to actually run with / as mostly read-only, but I need to check whether some not-so-well-designed programs don't try to write somewhere else than /tmp, /var and /home (e.g. /etc) during the usual run.
By the way, now I have it set up as I described in the first post, and the initial rsyncing to the empty /var is pretty quick (less than a second). Satisfactory for me.
Offline
Pages: 1