Actual Engineering
TL;DR: turns out you have to run grub-install
after grub-mkconfig
if you’re on UEFI.
This forum post summarizes the entire solution.
The wiki did say that, I just didn’t read it lol.
This minecraft theme for GRUB made the rounds a while back on HN and I gave it a go. I cloned the repository, glanced at the install script, and then ran it as root. But when I rebooted, I saw the default white-outline list menu instead of Mojang’s finest work yet. The archwiki grub article told me I probably didn’t regenerate the config files. I ran grub-mkconfig -o /boot/grub/grub.cfg
, rebooted, and got thrown into the UEFI settings.
Thankfully I kept the windows bootloader around and so I still had access to Windows 10. ESL did recently get a new --mount
flag but it works on entire disks. The linux partition is on the same disk as the mounted windows flag. I had to use a live usb installation. My USB port is still broken and I’ve been living off elite keyboard skills and a USB-C adapter when needed to compensate for my lack of a mouse.
Figure 1: The 4GB USB on the left. The USB-C adapter on the right.
I found this sad thing in my bag and flashed it with an arch iso. Because my laptop still had a broken USB port, I used a usb-c adapter to connect. The entire point of this blog post is how this 8 year old, half-broken usb stick came in useful. After all this time, my hoarder mentality finally paid off.
Figure 2: Look at this.
Hold the escape key to show the UEFI quick boot menu. Choose the USB disk. After a long wait, you’re now on a system running off the USB disk.
Use lsblk -f
to find partitions on disk. On my systems the output was /dev/nvme0n1p<number>
where <number>
was the partition number. There were two partitions, the ext4 partition that housed my home directory and linux files, and vfat where the efi partition was stored.
Mount ext4 partition to /mnt on the USB disk root (for me, mount /dev/nvme0n1p6 /mnt
). Mount the vfat efi partition onto /mnt/boot (mount /dev/nvme0n1p1 /mnt/boot
). We’re somewhat copying the typical arch boot process and setting up our installation for chroot.
Before chrooting into the installation, the environment has iwctl
. You can use that to connect to the internet and later reinstall linux with pacman.
Do arch-chroot /mnt
. This sets up environment variables for grub-mkconfig
and grub-install
to later work, and for any other assumptions made by the archwiki page on GRUB.
I’m now a root user in my own Linux installation. Find the grub settings and undo whatever you did there, regenerate configs, then (and this is the part that I missed) reinstall grub into efi partition with grub-install
. See this section of the grub article on archwiki for the exact command. Here, esp is /boot
For good measure if you setup wifi you can also do pacman -S linux
to make sure nothing else broke.
Exit the chroot, reboot, and hopefully your bootloader should be back alive. In conclusion, I need to get a new cable and an actual USB stick.