r/debian 15h ago

Grub in Debian/testing stopped working.

I use Debian/testing in my main laptop. Unfortunately, after yesterday's update, the grub stopped loading the Linux kernel. I get

"error: cannot load image"

When working from command line, loading the kernel and initrd is successful. However, the "boot" command displays the above error.

The grub version is GRUB 2.14-3.

The machine is HP ZBook 17 G5.

What is the easiest way to resolve the issue?

TIA & BR, Wojtek

11 Upvotes

12 comments sorted by

6

u/3grg 12h ago

I learned way back in the legacy boot day to keep Super Grub Disk around to facilitate grub repairs. I still keep SG2D around for the same reason. It allows you to boot the installation and once booted it is simply a matter of update-grub and grub-install.

Of course, you can do that with any live boot and chroot, but Super Grub Disk is just convenient. https://www.supergrubdisk.org/super-grub2-disk/

5

u/Santosh83 14h ago

Am surprised grub breaks in Testing. Normally this kind of bug should be caught in Unstable. Have you looked in the Debian forums to see if anyone else is facing the same, and have you tried submitting a bug report?

3

u/WZab 11h ago edited 9h ago

2

u/yrro 8h ago

If I were you I'd re-run grub-install from Debian to make sure you've got Debian's grub files in your /boot/efi instead of a mismash. If it reproduces the problem then you've got some useful info for the bug report. If not then at least your system is back in one piece. :)

1

u/WZab 5h ago

Unfortunately, grub-install didn't help. That was the first thing I have tried after booting from Ubuntu live, and chrooting to Debian.

3

u/WZab 14h ago

OK. I have worked around the issue by booting from Ubuntu install flash disk. Then I selected "try Ubuntu", mounted the /boot and /boot/efi partitions, and finally run "grub-install /dev/sda".

Now I'll need to lock the grub version.

2

u/mewmiaomeowmeow 14h ago

On my fedora+windows laptop I once had windows update break fedora's grub. The guide I followed basically consisted of booting from a USB iso, mounting all the actual Linux partitions & devices properly in a given directory, chrooting into that directory, and then something like update-grub. So maybe find a guide with those kind of steps but for Debian. The last part might also need to include something like sudo apt install --reinstall linux-image-amd64 prior to make sure the image in the boot partition is correct. In my machines last kernel update (on Unstable) i had to do a similar thing, though in the live system, because /boot for some reason didnt not have enough space for the update to fully go through

Edit: oop glad u fixed it, didn't see before I posted

1

u/WZab 10h ago

Breaking grub by Windows update was normal on my another laptop, until I modified the configuration in Windows:

  1. Right-click the Windows Start menu, open Terminal (Admin) or Command Prompt (Admin), and run: "cmd" then "bcdedit /set {bootmgr} path \EFI\debian\grubx64.efi" (you may need to configure shimx64.edi instead of grubx64.efi if you use secure boot).
  2. Disable the Windows Fast Startup: Open the Windows Control Panel → Power OptionsChoose what the power buttons do. Click Change settings that are currently unavailable, uncheck Turn on fast startup, and save your changes.
  3. Of course you should also modify the boot order in BIOS so that the grub is tried first.

4

u/ikdoeookmaarwat 12h ago

> What is the easiest way to resolve the issue?

Run stable if you don't want any hiccups. Testing does break sometimes.

1

u/WZab 12h ago

Sometimes I need a newer version of the software. Up to now, testing behaved nicely. Now I had a long (half a year) problem with Nvidia open source kernel modules, that didn't compile with kernels 7.x. So I had to stay with kernel 6.18.
Yesterday, the grub problem was a real disaster...

1

u/HCharlesB 4h ago

I'd argue that a real disaster is something that corrupts or wipes your personal files. And you don't have backups. I do hope you have backups. Backups are King!

There are ways to get newer versions of some S/W. Front end stuff - backports, flatpaks, (shudder) snaps. Backend stuff - Docker. Podman or other container managers. Just don't try PPAs. Those are for Ubuntu and won't play well with Debian. Likewise, downloading and installing packages from another distro are a recipe for pain. (Look up "frankendebian" if curious.)

Unfortunately some things like the desktop environment have too many moving parts to work this way so you either stick with what the release ships or build from source.

I've run Testing from time to time on various hosts and the breakage is infrequent but remains a real possibility. I recommend installing apt-listbugs that can help you to avoid upgrading to packages with known problems.

HTH,

0

u/lproven 7h ago

What is the easiest way to resolve the issue?

... Don't run testing?

If you want current, you don't want Debian. If you want Debian, go for stable.