Last change 01/12/2009
Basic Idea
During the running time of a linux box there is tons of data generated which is - at least for the sake of my multimedia box - completely useless (especially in terms of long-term interest). Here are some things I encountered:
- /tmp - required but can easily be ona ramdisk
- various logfiles - tro to get rid of some by putting em to /dev/null - the rest goes to a ramfs as well
- firefox cache - ramdisk it - its not really interesting after a reboot
- /var/cache/apt/archives - this is where the .deb files are cached when upgrading - can be a ramdisk as well (better add a crontab to remove stuff since after an update it can become quite big)
Background
The current (k)ubuntu creates a nice ramdisk on /dev/shm. I checked on my system (its been up for more than a month now) and figured some interesting data:
- I got around 20M of logfiles
- I had 500M of deb files from upgrades
- the rest of my var is only ~300M
- per default /dev/shm is 1.6G
Configurations
Firefox: edit your prefs.js (found in ~/.mozilla/firefox/YOURPROFILE/prefs.js) and add the line:
user_pref("browser.cache.disk.parent_directory", "/dev/shm");
Apache/syslog/...: recreate directory structure and then mount it
rsync -d -a -r --include '*/' --exclude '*' /var/log /dev/shm/
chmod -R 777 * /dev/shm/log
mount -o bind /dev/shm/log/ /var/log/
This should happen very early in the boot process to get syslog and the others to write there...
deb cache: this is basically just a symlink to /dev/shm