Lucid on the SSD with dialogs

Damn. 15 secondish boot time (from power on). Lot of that is the BIOS checking for drives and starting grub! From selecting the OS in grub to the login screen is about 3-4 seconds, and from entering my password to having a usable desktop: about 2 more.

Here’s how (on Ubuntu Lucid):

I’m using a shared ramdisk for /tmp, /var/tmp, /var/log and /var/cache. My root file system’s fstab entry looks like this:

# <file system> <mount point>   <type>  <options>       <dump>  <pass> proc /proc proc nodev,noexec,nosuid 0 0 tmpfs /tmp tmpfs defaults,noatime,nodiratime,mode=1777 0 0 none /var/tmp aufs br:/tmp=rw:/var/tmp=ro 0 0 none /var/log aufs br:/tmp=rw:/var/log=ro 0 0 none /var/cache aufs br:/tmp=rw:/var/cache=ro 0 0
# / was on /dev/sda1 during installation UUID=50143bce-e400-418b-a8d4-c8e596820fb3 / ext4 noatime,nodiratime,data=writeback,barrier=0,nobh,commit=25,errors=remount-ro 0 1

http://kerneltrap.org/node/14148 Linus doesn’t particularly care for ‘atime’ :)

Not sure how keen I am on putting that much in /tmp, I seem to use up memory fairly quickly when I install updates etc. I think I might let /var/cache go back onto SSD or possibly even hard drive.

In /etc/default/grub, changed the GRUB_CMDLINE_LINUX_DEFAULT for Grub2:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline rootflags=data=writeback"
then execute
sudo update-grub2
to write that to disk, changed the ext4 file system to use the data=writeback journal mode:
tune2fs -o journal_data_writeback /dev/sda1

And add this to /etc/rc.local before the “exit 0”

echo 1 > /sys/block/sda/queue/iosched/fifo_batch
for dir in apparmor apt news cups dist-upgrade fsck gdm installer samba unattended-upgrades
do
    if [ ! -e /var/log/$dir ]
    then
            mkdir /var/log/$dir
    fi
done
if [ -d '/sys/module/hid_apple' ] ; then
 echo 2 > /sys/module/hid_apple/parameters/fnmode
elif [ -d '/sys/module/hid/parameters' ] ; then
 echo 2 > /sys/module/hid/parameters/pb_fnmode
fi

and these lines to /etc/sysctl.conf to reduce the tendency to swap stuff out of RAM to the disk.

vm.dirty_ratio = 40
vm.dirty_background_radio = 1
vm.dirty_writeback_centisecs = 24000
vm.swappiness = 1

And, boom!

Now I just wish I had a bigger SSD so I could put Windows 7 and Linux on it :)

Have to wait a few months till I can justify splashing out on another SSD though :)

6 Comments

Kaleidoscope!

You’re not funny, GGGGggellisa.

noatime implies nodiratime, so you don’t need both of them

Very good boot time. It takes my system at least 15s just to get to GRUB (my BIOS sucks). I have an Intel X25-M and it takes 26s from GRUB to KDE desktop (I have auto login). I will try some of these tips.

Did you get any problem with update-manager being unable to find “/var/cache/apt/archives”? See this Bug report: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1054903
I’d appreciate knowing if this always happens with /var/cache on a tmpfs or just on some systems. Cheers :-)

Trackbacks and Pingbacks

[…] By kfsone Leave a Comment Categories: General Tags: ssd, ubuntu In my previous post about running Ubuntu Lucid Lynx (10.4b1) I mentioned my /etc/fstab […]

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: