2

First ran into this problem after upgrading from Ubuntu 18.04 to 20.04 in an old HP Pavillion laptop (dv7-2185dx): the system was stuck at a blank screen sometimes after a boot/reboot. After editing grub to enable debug mode (linux /boot/vmlinuz-5.4.0.58-generic root=... ro debug), I see that whenever the boot sequence hangs, it is always after "random: fast init done" or random: crng init done (or both). Sample output below:

snapshot: boot halts after crng init done

I have checked previous questions on similar issues, e.g.: Ubuntu installation stuck at random crng init done Boot - very slow start "random: fast init done"

However, the solutions there don't work in my case: I have no SD cards to remove, I boot from an internal SSD and my UUIDs in blkid and fstab agree, my system does not use a swap partition but rather a swap file in the same partition as the system, I tried installing rng-tools and haveged but the situation was not resolved. I also did a fresh 20.04 installation and this problem occurred there too.

Curiously, I have Ubuntu 18.04 in another partition of the same disk which always boots fine. Both systems seem to use the same initrd image version (initrd.img-5.4.0-58-generic).

I am baffled at this point, hence the request for help. The problem is not even well-reproducible, it happens randomly but quite frequently. Any ideas what might be going on, or at least any pointers on how to troubleshoot?

Happy to provide more info as necessary...

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26

1 Answers1

0

I had the same problem recently.
The boot process was sometimes stuck on:

random: fast init done

After a while it got stuck on:

random: crng init done

According to post #8 in this forum:

At boot, the kernel waits for mouse movements to initialize the random number generator.

Being a headless server, I don't have anything attached to it. And, indeed, if I simply attach a keyboard, after some test-reboots, the problem never occurs.

After some searching around, I found out that the linux kernel relies on several inputs (including user inputs) for random number generation.

So, in this case, for some reason, it just hangs there, waiting for some kind of "input".

The solution is to install havaged (Hardware Volatile Entropy Gathering and Expansion):

sudo apt install haveged
sudo systemctl enable haveged