Fixing Black Screen with Blinking Cursor Before GRUB in Manjaro
It has become a habit of mine to quickly shut down my laptop after a long day of work by using the terminal emulator and running the command:
shutdown -P 0
Boom! The laptop turns off instantly.
I’ve done this many times without any issues—until one day when I tried to continue working and found that my laptop couldn’t access GRUB, getting stuck on a black screen with a blinking cursor. The screen looked something like this:
In this situation, I couldn’t access either Manjaro or Windows 10. Fortunately, I had installed Windows 10 on a different hard drive from Manjaro, and its GRUB was installed on the hard drive containing Manjaro. So, I could simply select the boot option for the Windows 10 hard drive.
Next, I created a Manjaro Live USB. Initially, I used UNetbootin, but my laptop consistently failed to read the Live USB. The same happened with Rufus. After some research on forums, I found that a good software for creating a Live USB on Windows 10 is Etcher. Sure enough, my laptop could boot into the Manjaro Live USB with UEFI options.
In the Manjaro Live USB environment:
- Open the terminal emulator.
- Use root access:
sudo su - Before fixing the bootloader, install the following packages:
pacman -S mtools os-prober modprobe efivarfs efibootmgr dosfstools grub - Check the list of partitions to identify where the Manjaro system is installed:
lsblk -fMy Manjaro system is located at
/dev/sdb2. - Mount the system partition to
/mnt:mount /dev/sdb2 /mntIf the boot partition is separate, mount the boot partition to
/boot:mount /dev/sdb1 /boot - Change the directory to
/mnt:cd /mnt - Mount the following systems to the system directory:
mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev mount -t devpts pts /mnt/dev/pts/ mount -t efivarfs efivarfs /sys/firmware/efi/efivars - Chroot into the mounted environment:
chroot /mnt - Create an EFI folder in the boot partition:
mkdir /boot/efi - Mount the boot partition to the previously created EFI folder:
mount /dev/sdb1 /boot/efi - Install GRUB with the target directory set to
/boot/efi:grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck - Next, update GRUB:
update-grub - Finally, restart your laptop.
However, after restarting, I found that GRUB didn’t display the list of installed operating systems. The screen looked like this:
grub-prompt
At the GRUB prompt, execute the following commands:
grub search.file /etc/manjaro-release root
grub configfile /boot/grub/grub.cfg
Next, the GRUB menu for Manjaro will appear. Select Manjaro, open the terminal emulator, and run:
sudo grub-install /dev/sdb
sudo update-grub
Restart the laptop, and the GRUB menu should return to normal, displaying both Manjaro and Windows 10.
UPDATE
This issue occurred again after a system update:
- Boot using the Live USB according to the mode in use (UEFI or BIOS-legacy).
- Press C on the main Live USB menu screen. Do not enter the Live OS.
- At the GRUB prompt:
grub echo $grub_platformIf the output is pc, then the mode is BIOS-legacy. If the output is efi, then the mode is UEFI. Match the mode selected with the type of Live USB used.
- Type the following commands:
grub search.file /etc/manjaro-release root grub configfile /boot/grub/grub.cfgAfter running the above commands, the Manjaro GRUB menu will appear. Select Manjaro to enter the Manjaro OS.
- Once inside the Manjaro OS, open the terminal emulator and type:
sudo grub-install /dev/sdb sudo update-grubRestart the laptop. Done!
Sources:
Enjoy Reading This Article?
Here are some more articles you might like to read next: