I installed a minimal ubuntu (xubuntu-core). It works well, but boot is a bit too slow.

Right after I make my choice in grub, the screen turns black and after around 15 seconds I see the kernel boot messages, starting with [ 0.028000]. So what's it doing in between, I I.e. after grub, but before the boot messages. And how can I find out?

I remember in an old installation, grub produced output itself (and maybe even a log file?) is there a way to make grub more verbose?

EDIT: systemd-bootchart tells me that the display manager is up after 8 seconds. However, from the moment i made my choice in grub roughly 25 seconds pass.

The bit I'm choosing in grub is pretty vanilla:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-29414df5-b194-46a5-ae12-dac11924ae3c' {
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  29414df5-b194-46a5-ae12-dac11924ae3c
          search --no-floppy --fs-uuid --set=root 29414df5-b194-46a5-ae12-dac11924ae3c
        linux   /boot/vmlinuz-4.18.0-15-generic root=UUID=29414df5-b194-46a5-ae12-dac11924ae3c ro 
        initrd  /boot/initrd.img-4.18.0-15-generic
  • You pass quiet flag to the kernel so no wonder there are not so many messages. And to see which service takes long time to start run systemd-analyze blame (I'm assuming you are using systemd, as a ubuntu user). – jimmij Feb 10 '19 at 23:34
  • 1
    hey, yes I am aware of that (and have run it without). the point is that it spends a lot of time even before the first dmesg entry is generated – sheß Feb 11 '19 at 0:43

The kernel is setting up all kinds of stuff (CPUs, memory, other low-level platform components such as interrupt controllers) in the early parts of the boot and the relevant messages are being recorded all the time. The timestamps will be zero on all the messages up to the point where a clocksource is initialized. Thus even if there's a lengthy delay at some point during the early boot, you won't see it from the timestamps. Tools like systemd-bootchart just visualize the timestamp data, so they won't help here either.

You need to take a close look at the dmesg log from the early stages to see if there's anything going wrong. Unless there's a misbehaving platform component, broken interrupt delivery or something, the delays could perhaps come from steps like gathering entropy for KASLR. You can try disabling that using the nokaslr boot option and see if it helps.

  • Thanks. I believe there's nothing wrong within all those 0.0000 messages, based on what I see in dmesg, there are rather few (a few lines, posted here: pastebin.com/JEWbfqGV) and nothing that strikes as worrisome. nokaslr didn't have a noticeable effect either. I still believe it's grub. But I have to admit I am not an expert on the subject matter. But, for example I noticed that the power button still immediately shuts down the PC during the black-screen delay. Which is probably not good, but might be an indication – sheß Feb 28 '19 at 14:27

Run dmesg? Another possibility to debug boot times is systemd-bootchart (or bootchart2), a nice tool that visualizes the boot process as SVG when init=/lib/systemd/systemd-bootchart is passed to the kernel.

  • yes, i did run dmesg. the issue is the time that is spent before the first dmesg entry. I will try bootchart, but I assume it's grub or the initrd – sheß Feb 11 '19 at 0:44
  • 1
    Hmm, my messages start with [ 0.000000] Linux version 4.9.0-8-amd64... and initrd stuff is a lot later at [ 0.383459] Unpacking initramfs.... – Freddy Feb 11 '19 at 0:58
  • I, see, well mine also start with 0.00000 when i remove the quiet, so I guess it's not the initrd Mine end at 9.263542 but overall my boot process takes like 25 seconds, which is why i think there the black screen after grub is before the kernel messages start recording – sheß Feb 11 '19 at 1:01
  • 1
    Yes, the black screen should be a matter of some milliseconds. Hope you can find anything with bootchart, but I guess logging is starting too late. – Freddy Feb 11 '19 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.