• 5
Votes
name
name Punditsdkoslkdosdkoskdo

Xubuntu 18.04 kernel takes long to boots

After upgrading from 17.10, I've experienced longer boot times. At first it took more than 5 minutes. dmesg revealed the culprit was a non-existent floppy drive, that kernel tried to find.

Promptly removing that, the 5 minutes went down to about 40 seconds, which I feel is still more than it took before the update. Running dmesg again shows it takes 30 seconds to mount a filesystem (full output), with the following message:

[   36.362834] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)

I'm booting from an SSD, with two other hard drives plugged in, one of which is formatted in ext4, but holds no system data. I presume this is the SSD. During these 30 seconds, no text is displayed, nor is splash, just a blank screen.

Now, I said that it feels slower than before update, because I don't have exact times from before, so my first question is, is it normal to take 30 seconds to mount a filesystem, and if no, how to find out more about what could be causing the delay?

EDIT 1:

Turning swap on or off has no effect whatosever

Meanwhile I've also installed another hard drive into my computer. It seems to have further prolonged my boot time by some 10 seconds, with another line appearing in dmesg output, right before the aforementioned 30-second delay:

[    3.312351] hid-generic 0003:09DA:F613.0005: input,hiddev0,hidraw4: USB HID v1.11 Keyboard [COMPANY USB Device] on usb-0000:00:12.1-1/input2
[   17.169519] random: crng init done
[   51.611617] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)

EDIT 2:

systemd-analyze blame results are here

meanwhile after several restarts, the dmesg lines I blamed above changed their times thusly:

[    3.348384] hid-generic 0003:09DA:F613.0005: input,hiddev0,hidraw4: USB HID v1.11 Keyboard [COMPANY USB Device] on usb-0000:00:12.1-1/input2
[   34.091886] random: crng init done
[   36.488321] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)

I'll do a couple of restarts to find out whether this changes randomly, or stays the same (the code block in the first edit is from the first boot after inserting the extra HDD).

EDIT 2.5: the random: crng init done usually appears in times as shown in edit 1, rarely as in edit 2. It seems to be... random.

 

At boot, the kernel waits for mouse movements to initialize the random number generator. Kernel messages on boot:
sudo dmesg | less

The problem:
kernel: random: crng init done

The solution:
sudo apt install haveged
sudo systemctl enable haveged

  • 0
Reply Report

I experienced a similar increase in boot times, and after investigating with dmesgand systemd-analyze blame the culprit appeared to be random: crng init

The problem seems to be not enough entropy in booting from the SSD for initialization. This hypothesis appears to be confirmed because wiggling the mouse a bunch during boot decreases the boot time from around 2 minutes down to close to what it was before.

  • 0
Reply Report

I had same problem. During boot messages it would say that it timed out waiting for resume device. Check in /etc/initramfs-tools/conf.d/resume if there is UUID in it like RESUME=some-uuid remove uuid and replace with "none" to be RESUME=none. After that run sudo update-initramfs -uk all and it should be good to go.

  • 0
Reply Report