On TMPFS on the Acer Aspire One

I’ve found FireFox3 to be rather slow on mouse and a bit of reading shows that it’s primarily due to how disk i/o heavy FF3 is. SQLite backed this and that, it’s more than the poor little SSD can take. However with 1.5gb of ram there is a solution. TMPFS!

I’ve mounted a ram-backed TMPFS and run Firefox, Thunderbird, Liferea and Pidgin out of there. It’s made a huge difference. I started with the instructions from here, and have since modified the setup over the last week.

Step by step, this is what it would take to recreate what I’ve done. As your regular, browsing user:
$ mkdir ~/.tmpfs

Then as root add the following to /etc/fstab, modifying it for your username, uid, and gid:
my-tmpfs /home/$USERNAME/.tmpfs tmpfs size=200M,noauto,user,exec,uid=1000,gid=100 0 0

With that done I modified the shell script to read as follows:
#!/bin/bash
# Change this to match your correct profile

cd "${HOME}/.tmpfs_backup"
if test -z "$(mount | grep -F "${HOME}/.tmpfs" )"
then
mount "${HOME}/.tmpfs"
fi

if test -f "${HOME}/.tmpfs/.unpacked"
then
rsync --exclude='Cache' --exclude='.unpacked' --exclude='lock' -r "${HOME}/.tmpfs/" .
else
cd "${HOME}/.tmpfs"
cp -r ${HOME}/.tmpfs_backup/* . && touch .unpacked
fi

I named it tmpfs_rsync and put it in ~/bin. That’s right, no more tar for this guy. I found that after adding Thunderbird, Liferea and Pidgin into the mix, I was creating a sufficiently large enough tarball that performance would drop through the floor every 5 minutes as it backed up the tmpfs. Speaking of every 5 minutes, the respective crontab line for my user:
*/5 * * * * ~/bin/tmpfs_rsync

Make the script executable, and execute it once to mount the tmpfs and create the .unpacked lock-file of sorts:
$ chmod u+x ~/bin/tmpfs_rsync
$ ~/bin/tmpfs_rsync

With that done, all that’s left is to copy what you want to the tmpfs, then symlink it back in place. In the case of Liferea:
$ mv .liferea_1.4 ~/.tmpfs/liferea
$ ln -s ~/.tmpfs/liferea_1.4 .liferea_1.4

I repeated the above for Firefox, Thunderbird, and Pidgin and bob was my uncle. Make sure tmpfs_rsync executes once before shutdown and everything is backed up.

One thought on “On TMPFS on the Acer Aspire One”

Leave a Reply to Dan Cancel reply

Your email address will not be published. Required fields are marked *