Grub Problem

I recently got a Bosgame brand “Ecolite Series” E2 mini-PC. I try to avoid buying from Amazon, but it was steeply discounted. I put Debian 12 on it initially, but something about the Debian screensaver or inactivity detector caused the mini-PC to be unable to wake up. So I put Arch Linux on it. That solved the unable-to-wake-up problem, but during boot, the E2 stopped at the grub> prompt.

The Debian install is really automated. I have no idea what went on. Everything was awesome, until it wasn’t.

Every time inactivity caused Debian to decide to sleep, I could not wake the E2. The power was on, the LED in the power button stayed illuminated. Mouse wiggles and clicks, keyboard presses and momentary power button presses all failed to wake it. The E2 wasn’t bricked. I could hold the power button down for a long 10 seconds to power it down, then wait through a reboot. This is unacceptable. I tried turning off some Gnome inactivity stuff, but nothing on the web was very definite about this.

My guess is this has something to do with USB devices not waking this hardware from suspend state. There are some random forum postings about this. Apparently E2-specific spin of Windows exists just because of this.

I ended up doing an Arch Linux install on top of the Debian install. The Arch install has you installing a boot loader. Installing boot loaders always scared me a little, probably because of trauma from installing LILO to get Slackware to boot. I therefore rigidly follow the Arch Install instructions. You run this command:

grub-install --target=x86_64-efi --efi-directory=/boot/grub --bootloader-id=GRUB

to get the bootloader and other mystical things installed so your computer will boot.

On reboot, the whole process stopped at a grub> prompt. This is disconcerting. Typing exit and hitting return caused the more familiar Arch Linux grub.cfg menu to show up. Wait 10 seconds or so, and it ends up booting into the newly installed Arch Linux.

I could not get the whole boot process to end at a Linux login: prompt. It always stopped at grub>.

I did a few things:

  • Re-ran the grub-install command from Arch Linux. No luck, stopped at grub> prompt.
  • Repeated pressed “F7” key during boot to get to the AMI BIOS program. Used arrow keys to get to the Boot tab. Besides a USB entry, there were 2 “debian”, 1 “grub” and 1 “windows” entry. Following the on-screen directions to select “grub” caused the E2 mini-PC to boot Arch Linux, but did not set “grub” as the default.
  • Ran the grub install like this: grub-install --target=x86_64-efi --efi-directory=/boot/grub --bootloader-id=debian This is just cargo cult, but I had noticed /boot/grub/EFI/debian/ and /boot/grub/EFI/GRUB/ directories. If the BIOS can’t changed it’s boot default, I can change what’s in the boot default, right? Wrong. Stopped at the grub> prompt.

I noticed that the initial grub> prompt splash screen claimed that the version was something-something-debian-something. Clearly, whatever EFI magic goes on was still using the grub from the earlier Debian install. That’s when I tried to overwrite what was in the debian/ directory with Arch stuff:

grub-install --target=x86_64-efi --efi-directory=/boot/grub --bootloader-id=debian

That did not work, booting still stopped at the grub> prompt.

Finally, I deleted /boot/EFI/debian/ and /boot/grub/EFI/debian/ directories and their contents. This works. The grub> prompt does not come up, and instead the Arch Linux grub.cfg menu shows up. I don’t know which directory /boot/EFI/GRUB/ or /boot/grub/EFI/GRUB gets used. If I had been more methodical and deleted one of the debian/ directories at a time, I might have a better idea. I should also have tried to overwrite the Debian grub installation with:

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=debian

But the E2 mini-PC boots all the way through now, so I’m going to leave it at that.

I still don’t understand EFI booting well enough to fix these sort of problems.

Summary

  1. Installed Debian 12. Seemed to work OK, but as soon as something decided I was inactive, the mini-PC went to sleep or suspended and could not be awakened.
  2. Installed Arch on top of Debian. Installation seemed to work OK, but any reboot left the machine at a grub> prompt.
  3. Typing exit and hitting return at the grub> prompt a few times set the GRUB boot sequence in motion. The screen showed the Arch grub.cfg menu.
  4. During investigation, I noticed that the grub> prompt screen claimed to be a “debian” version. This is weird, I definitely ran grub-install during the Arch installation.
  5. /dev/nvme0n1p1, the EFI partition, is definitely mounted on /boot/. Weirdly, there are /boot/EFI/debian/, /boot/EFI/GRUB/, /boot/grub/EFI/debian/ and /boot/grub/EFI/GRUB/ directories, all with what look like EFI-boot-related files in them.
  6. The mini-PC “boot selector” menu has entries for USB, “debian”, “grub” and “windows”. No matter how I try, I cannot get whatever displays that menu to keep the “grub” entry as default. When I select the “grub” entry, Arch Linux boots, but on the next reboot, it ends up at the grub> prompt. There are hints in stackexchange questions and mini-PC forums that the BIOS (or whatever it is on EFI systems) doesn’t set the default boot correctly.
  7. I tried running grub-install --target=x86_64-efi --efi-directory=/boot/grub --bootloader-id=debian which overwrote the /boot/grub/EFI/debian/ directory contents. This was an effort to get the EFI boot selection of “debian” to boot Arch. No luck, reboots still stopped at the grub> prompt.
  8. Booted into Arch, logged in as root, deleted /boot/EFI/debian/ and contents, and /boot/grub/EFI/debian/ and contents. This worked. A reboot showed the Arch /boot/grub/grub.cfg menu. I had edited out the “quiet” flag from all of the linux lines. There were 3 such lines. After 10 seconds or whatever, grub booted Arch Linux.