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:

  1. Open the terminal emulator.
  2. Use root access:
    sudo su
    
  3. Before fixing the bootloader, install the following packages:
    pacman -S mtools os-prober modprobe efivarfs efibootmgr dosfstools grub
    
  4. Check the list of partitions to identify where the Manjaro system is installed:
    lsblk -f
    

    My Manjaro system is located at /dev/sdb2.

  5. Mount the system partition to /mnt:
    mount /dev/sdb2 /mnt
    

    If the boot partition is separate, mount the boot partition to /boot:

    mount /dev/sdb1 /boot
    
  6. Change the directory to /mnt:
    cd /mnt
    
  7. 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
    
  8. Chroot into the mounted environment:
    chroot /mnt
    
  9. Create an EFI folder in the boot partition:
    mkdir /boot/efi
    
  10. Mount the boot partition to the previously created EFI folder:
    mount /dev/sdb1 /boot/efi
    
  11. Install GRUB with the target directory set to /boot/efi:
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
    
  12. Next, update GRUB:
    update-grub
    
  13. 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:

  1. Boot using the Live USB according to the mode in use (UEFI or BIOS-legacy).
  2. Press C on the main Live USB menu screen. Do not enter the Live OS.
  3. At the GRUB prompt:
    grub echo $grub_platform
    

    If 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.

  4. Type the following commands:
    grub search.file /etc/manjaro-release root
    grub configfile /boot/grub/grub.cfg
    

    After running the above commands, the Manjaro GRUB menu will appear. Select Manjaro to enter the Manjaro OS.

  5. Once inside the Manjaro OS, open the terminal emulator and type:
    sudo grub-install /dev/sdb
    sudo update-grub
    

    Restart the laptop. Done!

Sources:




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Satu EFI untuk Dua Operating System (Ubuntu 24.04 dan Windows 11) pada dua disk yang berbeda
  • Akses internet ITS melalui myITS-WiFi di Ubuntu
  • Menampilkan Label LaTeX di Matplotlib