Ubuntu 21.04 was working fine for a month or more, but today it doesn't boot. I am stuck on a black screen, with a blinking cursor at the top. Is this something I can fix, or must reinstall Ubuntu? I also see the same black screen in safe graphics mode I have the same problem.
-
Disable Secure Boot in UEFI as it may have been re-enabled by a UEFI update. – ChanganAuto Jun 05 '21 at 03:31
-
Is it a dual boot, and was there a Windows update? – Archisman Panigrahi Jun 05 '21 at 07:00
-
1I'm having same issue. Kernel 5.11.0-16 boots ok, but 5.11.0-17 and 5.11.0-18 don't. I suspect something is not being created ok on the "initial ramdisk" – morhook Jun 06 '21 at 14:08
-
Have you tried a different kernel (press shift if "grub" is not appearing), go to 'Advanced options', and select a different kernel. I've tried to fix my machine with boot-repair tool with no avail https://paste.ubuntu.com/p/hC6Sxr5Vv8/ – morhook Jun 06 '21 at 14:15
2 Answers
The question is pretty generic, but I'll post what happened to me on my Dell XPS 15 9550 (it has a non-contiguous RAM when loading the ramdisk). When selecting in "Advanced options for Ubuntu" on grub, selecting a kernel (or even recovery mode) after
Loading Linux 5.11.0-18-generic ...
Loading initial ramdisk ...
it stopped printing anything.
I could fix this fixed by making the size of the initial ramdisk
smaller.
There are two options, but in both you'll need to be able to boot up to rescue it. Try older kernels on the Grub menu or create a bootable USB and enter the machine with chroot (follow this guide https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd if you don't know what a chroot is)
Make image smaller reconfiguring initramfs
Edit /etc/initramfs-tools/initramfs.conf
(with root user) and find
MODULES=most
replace it with
MODULES=dep
After this run
sudo update-initramfs -u
Reference for this last idea: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1931024 (thanks to https://askubuntu.com/users/1283631/rupert-everton )
Disable NVIDIA drivers altogether
Uninstalling all "nvidia" DKMS drivers:
sudo apt remove nvidia-driver-* --purge
sudo apt autoremove --purge

- 1,610
- 14
- 23
-
how did you get to the screen to run those apt commands? I sm not able to get into the recovery mode – Colin D Jul 21 '21 at 19:07
-
@ColinD I could boot up from Grub with "Advanced options" and selecting another kernel (that initrd image was still smaller than 100Mb). If you don't have any working kernel, you might need to create a PEN USB live installer to enter your hard drive (probably with a chroot) and fix this. – morhook Jul 27 '21 at 15:52
-
thanks for the info. my symptoms were that I was booting up and about 95% of the time I didn't even get a dell logo on a dell precision 7540 after upgrading to ubuntu 21.04. in the 5% it would get to grub but then wouldn't go past that with the "Loading initial ramdisk" error. I actually sent my laptop in to the dell repair center and they replaced my motherboard and it works now...no os reinstall was done so ubuntu 21 working now...kind of crazy. still not sure if ubuntu 21.04 bricked it or not but it works fine now, running ubuntu 21.04 after getting back from repair center – Colin D Jul 27 '21 at 16:26
-
interestingly my above description sounds very similar to https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1931024/comments/2 ...really weird issue. no OS reinstall was done by repair center for me so not sure if anything else was changed like this...nothing was reported by them at least – Colin D Jul 27 '21 at 16:29
Can't add a comment to @morhook 's answer so I'll have to make a new one:
I also had the same problem where initrd.img was too large and I solved it by switching MODULES=most
to MODULES=dep
with a live ubuntu installer.
See this bug report: https://bugs.launchpad.net/bugs/1931024

- 31
- 4
-
Weird you couldn't comment on my answer. Thanks for finding this!!! I've finally enabled my NVIDIA drivers with your trick. I'll update my answer with your way of rebuilding the initramfs. – morhook Jul 27 '21 at 15:50