I'm using Ubuntu 12.04 64bit installed on a WD Velociraptor (10.000 rpm) hard disk. I'm not using Wubi, it's a clear install.
I think that "adding swap" procedure on boot takes too long. At first I thought that it has something to do with the swap mounting, but as you can see, I've spotted the problem in the "ureadahead" deamon.
You can see below dmesg
partial output:
[ 5.347709] Console: switching to colour frame buffer device 210x65
[ 5.351756] fb0: VESA VGA frame buffer device
[ 5.613411] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[ 21.421858] Adding 1227772k swap on /dev/sda5. Priority:-1 extents:1 across:1227772k
[ 21.425834] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 21.425841] ADDRCONF(NETDEV_UP): eth1: link is not ready
Taking into account my hard drive's speed, this delay is not normal.
After upgrading to the latest kernel (3.2.0.36 from 3.2.0.35) or after removing "/var/lib/ureadahead/pack" file, the problem is temporary solved, just for one boot.
After the second boot the problem returns.
This is the dmesg
output when everything works perfect:
[ 5.120096] Console: switching to colour frame buffer device 210x65
[ 5.124150] fb0: VESA VGA frame buffer device
[ 5.285586] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[ 6.953086] Adding 1227772k swap on /dev/sda5. Priority:-1 extents:1 across:1227772k
[ 7.516909] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7.516916] ADDRCONF(NETDEV_UP): eth1: link is not ready
As suggested in the comments I've tried to disable the swap mounting and the delay was moved to the next process, so it seems that it has nothing to do with swap mounting:
dmesg
output:
[ 5.862973] EXT4-fs (sda3): recovery complete
[ 5.887252] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[ 17.589428] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 17.589435] ADDRCONF(NETDEV_UP): eth1: link is not ready
@gertvdijk noticed that in the latest dmesg
output my system recovered from something, but this just happened just when I've comment out the swap from "/etc/fstab".
I've spoted the problem
Ureadahead slows down the boot process. This is weird since the opposite should happen!
Below I'm posting bootchart
images and dmesg
output of three different boots:
- Without ureadahead (disabled following this guide) there is no
delay:
dmesg output (ureadahead disabled)
bootchart output (ureadahead disabled) With ureadahead enabled first boot (pack file is build for the first time) no delay:
dmesg output (ureadahead enabled)
bootchart output (ureadahead disabled)With ureadahead enabled second boot (ureadahead full working) delay is back:
dmesg output (ureadahead enabled second boot)
bootchart output (ureadahead disabled second boot)
NOTE
My question seems to be a duplicate of this Very slow boot due to mounting filesytem which concerns Ubuntu 11.04 and has no solution yet! If any admin reading this, I don't know if I have to delete my question as a duplicate since the problem doesn't seems to be the swap mounting... if so, delete it, or please, inform me to do so!
Try e4rat, it's faster and reliable
ppa https://launchpad.net/~trinitronx/+archive/minimal-no-ureadahead
how to use http://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boot-time-in-half-with-e4rat/
ureadahead is run on the next boot when key packages such as the kernel are updated so that it can determine the location of file data during a boot. If you reboot again after that it should improve the boot speed since it now knows the location of the data and it does not have to re-instrument the files.
Do a clean install of Ubuntu 13.10, it is the latest updated Ubuntu version. Your problems might be fixed under that version, updates always fix problems.