7

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

Complete dmesg output

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

Complete dmesg output

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:

  1. Without ureadahead (disabled following this guide) there is no delay:
    dmesg output (ureadahead disabled)
    bootchart output (ureadahead disabled)
  2. With ureadahead enabled first boot (pack file is build for the first time) no delay:
    dmesg output (ureadahead enabled)
    bootchart output (ureadahead disabled)

  3. 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!

naskoos
  • 379
  • Have you tried disabling swap for the time being to exclude all other causes? Just comment (prepend with #) the line for swap in /etc/fstab and reboot. – gertvdijk Jan 18 '13 at 01:07
  • Thank you for your interest!
    I've just tried it.. I no more have this issue but again booting takes more time than normal delaying on the next line "ADDRCONF(NETDEV_UP): eth0: link is not ready"! 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
    – naskoos Jan 18 '13 at 09:16
  • Then it's not loading of swap being the cause. I see recovery complete in your logs, indicating that you haven't shut down your system properly. I feel there's a lot more going on... like... are you using Wubi for example? – gertvdijk Jan 18 '13 at 09:23
  • If you look above the output of the dmesg in the first update of my question, 17.589428 is not normal time for ADDRCONF! Sorry for the mess in my comments but how can I add a line break when writing a comment? – naskoos Jan 18 '13 at 09:26
  • No I'm not using Wubi! It's a clear install! – naskoos Jan 18 '13 at 09:27
  • Please don't use comments for posting updates. Edit your question as being it one question. Also avoid "update #1" at the bottom parts - just make it one piece. We can see the edits you make in the revision history. It's a Q&A site, not a discussion forum, you see. :) – gertvdijk Jan 18 '13 at 09:43
  • Thank you I'll fix it asap!! I can't find any recovery complete in my logs, could you please point me to? Do you know were can I find the shutdown log...? – naskoos Jan 18 '13 at 09:51
  • You just posted it yourself in this comment! (do Ctrl+F on this page if you don't believe me ;)) – gertvdijk Jan 18 '13 at 10:18
  • :) You are right! I was looking for it in the previous 3 dmesg's outputs, posted in the question above and I could find it... – naskoos Jan 18 '13 at 13:56
  • It seems you've found a solution (answer) to your issue (question). Can you post it as an answer? Answers don't belong in the question body on this site. Thanks :) – gertvdijk Jan 18 '13 at 22:59
  • But it's more like a workaround than a solution... I don't know why my system boots faster without "ureadahead" since more read/writes to HD take place (see first bootchart)! I've just spotted the problem! I'd like to have ureadahead back again because if there is a way to make it work properly, maybe I can get even better performance! – naskoos Jan 19 '13 at 00:08

3 Answers3

0

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.

-1

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.

Brask
  • 1,588