I recently encountered an issue where my PC is taking more than 2 minutes to boot up. This started after I had an error message saying 'out of memory' and 'You need to load kernel first' when I turned it on this morning. After that, I managed to get into the grub menu and boot the system. Prior to this, it would boot up in just about 3 to 4 seconds.
Now, it hangs on the motherboard splash screen for 1-2 minutes, and the shutdown process is also slower than usual. I've tried a few commands like `sudo apt autoremove --purge`, `sudo update-grub`, and `sudo update-initramfs -u -k all`, as well as disabling `NetworkManager-wait-online.service`. Has anyone else experienced something like this, or can anyone help me troubleshoot?
5 Answers
You might want to check your BIOS settings and try disabling XMP. It could impact how your system boots up.
Do you have any external drives plugged in? I had a similar experience with Windows, where unplugging an external HDD made boot times drop drastically. If you do have a USB drive connected, try removing it and see if that helps!
Sometimes random issues crop up for no reason. You could enable grub logs to see what's going wrong during boot. Also, just to clarify, is the delay happening at the screen where you press a key to enter the BIOS? It might actually be a BIOS issue, rather than something with Linux or grub.
You could try turning off the power supply and pressing the power button for a few seconds to clear any residual power. Then, turn the power supply back on and boot normally. Sometimes hardware can get stuck in odd states.
Have you considered that Ubuntu might do automatic updates? You could have a partial update messing things up. Try running `apt update` and `apt upgrade` to see if that resolves the issue.

I had a USB drive connected and I removed it, and now it's fine... thanks mate!