Put /proc and /var into a ramdisk, but other stuff on drive?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Put /proc and /var into a ramdisk, but other stuff on drive?
Is it possible to have a system which has /proc and /var (directories which get the most writes...hmm, although not sure what that means for /proc) onto a ramdisk but have the rest of the stuff on a normal disk?
This would be booting of a CF card, I don't mind having it execute off the CF card, but I'd like to keep writing to a min, but I don't have enough memory (nor do I think I'd need to) put everything in a ramdisk and run out of there. But things like /var (and maybe others) that get alot of 'traffic' would be great in a ramdisk.
Any help would be greatly appreciated?
I am running Gentoo with a 2.6.9 kernel, I figure making a kernel with initrd in it, then would I just set that up in grub.conf? (I'm using grub) What would go into /etc/fstab?
Well, the /proc filesystem is a virtual filesystem. It's a means of communicating with the kernel itself. It exists in pure RAM - no disk storage required (other than the /proc stub to mount to).
As for moving the /var partition to RAM, I would advise against it. Logs are stored under the /var tree, and other applications store databases and run-time information there (the locate database comes to mind). Depending on the activity of the machine, the logs and databases could chew through the available ramdisk space in a hurry. Not to mention if something goes wrong, requiring a reboot, you can't look at your log files to find out what happened; they're toast since they were in RAM.
I know that's not the answer you were hoping for. I just don't think it's worth the effort. You'll probably run into a number of problems without seeing any substantial benefit.
I have seen several ways to make a Linux system boot off a CF card in read-only mode, so nothing is written to the CF card ever, it just creates a ramdisk and does everything in there (apparently any logging too, although in a setup like that probably no logging would be better, since even if you have a logfile, what good does it do you...). I am planning on doing something along that line, but didn't see the need to have *everything* in memory, since you can read off the CF card just fine, it's just the writing to it that you'd want to limit, so I figured if I just put the write-intensive directories into the ramdisk.
A friend just told me there is a flash-linux version which uses some different file system and takes care of all of this, so it doesn't do the intensive writing to the CF card, so I guess I'll look into that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.