LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Put /proc and /var into a ramdisk, but other stuff on drive? (https://www.linuxquestions.org/questions/linux-general-1/put-proc-and-var-into-a-ramdisk-but-other-stuff-on-drive-277035/)

mabrodis 01-12-2005 04:19 PM

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?

Thanks in advance!
Mark Brodis

Dark_Helmet 01-12-2005 06:31 PM

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.

mabrodis 01-12-2005 07:24 PM

Hmm, thanks for the reply.

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.

Thanks!


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