Weblogs: Gadgets and Stuff

Ubuntu 12.04: Solving slow boot times on Toshiba NB300 Netbook

Thursday, November 01, 2012

I picked up a Toshiba NB300-108 for just under £70 on an ebay auction a few weeks ago, and decided to clean install Ubuntu 12.04. True to form Ubuntu installed flawlessly. But, there was one annoying problem. It took about 5 to 7 minutes to boot.

It’s taken a couple of days of hacking around, trashing Ubuntu and re-installing it, but I’ve gotten to the bottom of the issue. Most of the 5 minute boot sequence seems to be the laptop just sitting there waiting for something to happen, there’s only a tiny amount of disk activity going on.

The first step is to figure out why the boot process is so slow. So in a Terminal, run dmesg which displays a timestamped log of each subsystem initialising. The timestamp counts the number of seconds from power on. Looking through this list I saw a huge leap in seconds (about 350 seconds), and that line said:

[  352.885250] ADDRCONF(NETDEV_UP): eth0: 
    link is not ready

Turns out Ubuntu can’t quite deal with the Ethernet card (possibly a Realtek network module). Opening the “Connection Information” in the Network menu (top right icon of up-and-down arrows) identifies the network card driver as r8169.

The solution turns out to delay the initialisation of the Ethernet card, removing it from the boot sequence and adding it to the rc.d initialisation. Here’s how to do that:

First we blacklist the card from the early boot initialisation steps (all on one line):

echo "blacklist r8169" | 
  sudo tee /etc/modprobe.d/blacklist-ethernet.conf

Second step is initialising it by editing /etc/rc.local and adding in modprobe r8169 just before the exit 0 line:

modprobe r8169
exit 0

Thirdly we need to rebuild the boot image to take into account the newly added blacklist item, so run the following:

sudo dpkg-reconfigure linux-image-$(uname -r)

Once that is done, reboot the laptop.

For me that reduced the boot time to 38 seconds, so a reduction of about 90%. There’s still a couple more seconds to be saved by disabling the ipv6 and parallel port support, but that’s for a rainy day.

Related links


[ Weblog | Categories and feeds | 2011 | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 ]