I've got an ASUS Eee PC 901/Linux with the solid state drive (SSD). I've been having issues with the /tmp dir and /var/log dir utilizing too much of my 4GB drive. So to fix this I came across this eeeuser.com thread which talks about moving those directories to RAM. The process is pretty straight forward and will increase the life of your SSD. Find out what I did below.
This will move /tmp, /var/tmp, and /var/logs to RAM using tmpfs which means everything will be deleted on a reboot. That is fine since both /tmp and /var/tmp are deleted on reboot anyway. For the logs, however, we can create a couple scripts to backup only the logs from the last session as it's not really necessary to keep tons of logs on a netbook. In case you're wondering, I'm running Ubuntu Eee on my Eee PC.
As a quick warning, MAKE BACKUPS!! This file is crucial to the inner workings of Ubuntu. Once you've got a backup all you need to do is add a few lines to move the directories to tmpfs.
tmp /tmp tmpfs noexec,nosuid,rw,size=8192k 0 0
vartmp /var/tmp tmpfs noexec,nosuid,rw,size=1024k 0 0
varlog /var/log tmpfs noexec,nosuid,rw,size=8192k 0 0
If you're wondering why I gave /tmp 8MB in memory it is because Flash videos need a good amount of space and will hang if you only give it 1MB. So if you don't plan on streaming anything through Flash you can lower size=8192k to 1024k.
Create a couple scripts for our log problem
So in order to only keep logs from the last session we'll make a simple script and have it launch on shutdown but before that create the directory /var/log_bkup.
sudo mkdir /var/log_bkup
That's where the tar archive of the logs will be stored. Here's the script to remove the old and bring in the new:
if [ -f /var/log_bkup/log_bkup.tar.gz ]; then
echo "Backing up logs to tar archive..."
/bin/tar czf /var/log_bkup/log_bkup.tar.gz /var/log
This next script will create a skeleton in /var/log so all the directories already exist to avoid any problems.
echo "Creating directories in /var/log"
Make sure the scripts are executable
sudo chmod +x /etc/init.d/mklogdir.sh
sudo chmod +x /etc/init.d/logbkup.sh
Link them to various rc directories so they run at the proper times (startup/shutdown)
sudo ln /etc/init.d/mklogdir.sh /etc/rc2.d/505mklogdir.sh
sudo ln /etc/init.d/logbkup.sh /etc/rc0.d/515logbkup.sh
sudo ln /etc/init.d/logbkup.sh /etc/rc6.d/515logbkup.sh
Pretty much done at this point. Just want to remove everything in /tmp and /var/tmp to avoid any issues when remounting on next boot with everything running in tmpfs.
sudo rm -rf /tmp/* /var/tmp/*
Go ahead and reboot. You should now be running a system with a lot less disk writes. All your log writes will now only be written once per session instead of little writes here and there every time something happens.