I had a bit of a scare a couple of days ago. My laptop just came back from (hardware) repairs, and on switching it on, I was dropped into a GRUB shell. I hadn’t updated my laptop or done anything out of the ordinary – I still don’t know why this happened. Here’s how I fixed it.

I was greeted by this message on powering my laptop on.

Realtex PCIe FE Family Controller Series ...
PXE-E61: Media test failure, check cable

PXE-M0F: Exiting PXE ROM

Then it dropped me into the GRUB shell. It was a normal shell, not a rescue shell, so GRUB was able to find my disk. (See the ArchWiki entry on the GRUB shell.) It may be possible to fix this issue through the GRUB shell alone, but that’s not the route I took.

Prepared for the worst, I made an Arch Linux LiveUSB to see if I could retrieve any data. The first thing I noticed on booting with it was that it booted in Legacy mode – which is odd, because mine’s a UEFI system. So I changed those settings in the BIOS (who toggled them?), and booted into the LiveUSB again. lsblk showed the same partitions I made when installing Arch (as well as sdb partitons from the USB drive).

What a relief. Now, I know which partitions I used for EFI and root from my install notes. So then I ran:

# mount /dev/sda2 /mnt
# mkdir /mnt/efi
# mount /dev/sda1 /mnt/efi

I checked the fstab; it was fine and did not require any changes. I entered chroot and redid my GRUB config. (Note that /mnt is equivalent to / in this environment, so /mnt/efi becomes /efi.)

# arch-chroot /mnt
# grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
# grub-mkconfig -o /boot/grub/grub.cfg

I powered off, removed the LiveUSB, and voilà! My laptop booted normally and silently, as it used to.


References:

Other links of interest: