Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian does not boot anymore - only GRUB appears

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
MisterDeeds
Posts: 2
Joined: 2022-06-09 15:09

Debian does not boot anymore - only GRUB appears

#1 Post by MisterDeeds »

Hello together

I unfortunately have the problem with a virtual machine that it no longer boots. Only the message "GRUB GRUB GRUB ..." appears.
Image

Since the machine is currently still running, I can view the partition table. There everything looks correct. I it is so since the update from 11.4 to 11.5, but when I compare other installations, it looks correct.
Image

Does anyone of you know the problem and can help me?

Thank you and best regards

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Debian does not boot anymore - only GRUB appears

#2 Post by Segfault »

I'm not saying I understand, it does not boot but is still running? How is this possible, how do you know it does not boot if it is running?
Anyhow, the first screen may hint the legacy boot sector is damaged, I'd reinstall it.

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Debian does not boot anymore - only GRUB appears

#3 Post by CwF »

Segfault wrote: 2022-09-14 02:06 it does not boot but is still running? How is this possible
No kidding!
Perhaps they mean the host is still running....
...should have a backup of the vm os image.
You can mount the image in a new vm ti fix in parrallel, or the same vm and use a usb fix it thingie to reinstall grub. You could use guestfs and a loop mount on the host to fix it.
So easiest to hardest.

I just don't get people making vm os images so ridiculously huge? You can have multi disk vm's ya know, and the OS can be immutable and tiny. Keep the damn data separate.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian does not boot anymore - only GRUB appears

#4 Post by p.H »

The string "GRUB" is displayed when GRUB boot image, which is normally stored in the MBR, is executed. Then it should load and execute GRUB core image which displays the string "loading". The repeated "GRUB" string means that the boot image is executed in a loop instead.
You can try to reinstall GRUB and see what happens.

Code: Select all

grub-install /dev/sda

bystander
Posts: 1
Joined: 2022-09-18 16:34

Re: Debian does not boot anymore - only GRUB appears

#5 Post by bystander »

I had the same result after upgrading grub-pc but on a physical machine (coincidentally, dom0, but I don’t think virtualization has anything to do with this problem).

The situation was as follows (some of these details I put together after the fact):
The machine booted from the main drive, a SSD. It contained a GPT root partition, which included /boot. The root partition was the only one on the device. It used up all available space. The machine did not use EFI to boot.

The upgrade recommended that it run grub-install on the device. It recommended against installing grub to the partition. I can see now copies of core.img in old backups I had of /boot/grub/i386, so it does seem like grub was previously installed to the partition.

I believe I took the upgrade advice and installed to the device instead – it does explain what happened and how I was able to fix it.

On reboot, the machine initially responded with a grub recovery prompt. I tried to start the machine in the usual way in those circumstances but was met with

Code: Select all

grub error: grub_disk_native_sectors not found
After some attempted recovery/repair steps, I ended up as you did with the same “GRUB GRUB GRUB. . .” scrolling endlessly on the screen.

I believe the problem was installing GRUB to the device. A non-EFI device with a GPT partition must also contain a BIOS boot partition – a separate partition with no file system dedicated to part of the grub code, core.img:
https://en.wikipedia.org/wiki/BIOS_boot_partition

There was no such partition on the device, and no room for one.

I imagine the result on boot was that the part of GRUB in the MBR was set up to hand control to core.img in the (non-existent) BIOS boot partition. Unable to locate core.img, it fell back to a grub recovery prompt, having not found its “native_sectors”.

In hindsight, I might have tried mounting the root partition using Recovery Mode on a Debian install media or chroot on Debian Live, then running

Code: Select all

dpkg-reconfigure grub-pc
and selecting install to partition, just to get the machine up again. I could then have taking the remedial steps below at a more leisurely pace. Not sure if this would have worked though.

Using fdisk and a combination of Live and Recovery Mode, my fix was to:
a) create free space on the device by resizing the root partition
b) add a 1M partition, setting its type to BIOS boot partition (bios-grub in some software)
c) reset the type of the root partition from BIOS boot partition to Linux root partition
d) dpkg-reconfigure grub-pc, selecting install to device to complete the installation.

Just curious - you say the machine won’t boot but that it’s still running so you could view the partition table – huh?

Hmm - this now seems to make four reports in the last three weeks of unbootable after grub-pc upgrade – yours, mine,
viewtopic.php?f=10&t=152505 and viewtopic.php?f=5&t=152850

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Debian does not boot anymore - only GRUB appears

#6 Post by Segfault »

Wouldn't it be easier to use some sane bootloader instead of Grub. Well, Grub allows for automated kernel upgrades. But it is bloated and requires this mentioned partition for its stage files. If you wonder, I use syslinux for legacy boot and I use EFI stub kernels for UEFI boot, no middleman-bootloader at all.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian does not boot anymore - only GRUB appears

#7 Post by p.H »

bystander wrote: 2022-09-19 19:50 I can see now copies of core.img in old backups I had of /boot/grub/i386, so it does seem like grub was previously installed to the partition.
No, that does not mean anything. core.img exists regardless of where GRUB was installed. It is used at boot time only if GRUB uses block lists (unreliable). GRUB uses block lists if installed in a GPT protective MBR without a BIOS boot partition, or in an ext4 partition boot record.
bystander wrote: 2022-09-19 19:50 I believe I took the upgrade advice and installed to the device instead – it does explain what happened and how I was able to fix it.
It wouldn't have worked if installed in the partition boot record either.
bystander wrote: 2022-09-19 19:50 A non-EFI device with a GPT partition must also contain a BIOS boot partition (...) There was no such partition on the device, and no room for one.
A BIOS boot partition needs less than 1MB. There is almost always a 1MB gap at the beginning of the disk between the partition table and the first partition which can be used to create a BIOS boot partition.
bystander wrote: 2022-09-19 19:50 On reboot, the machine initially responded with a grub recovery prompt. I tried to start the machine in the usual way in those circumstances but was met with

Code: Select all

grub error: grub_disk_native_sectors not found
This indicates a version mismatch between the core image and the modules in /boot/grub. It happens mostly when the modules were upgraded but the core image was not.
bystander wrote: 2022-09-19 19:50 I imagine the result on boot was that the part of GRUB in the MBR was set up to hand control to core.img in the (non-existent) BIOS boot partition. Unable to locate core.img, it fell back to a grub recovery prompt, having not found its “native_sectors”.
Nope. The boot image loaded a core image and the core image printed this error when trying to load normal.mod. The boot image can only print short strings such as "GRUB" or "Error".

Post Reply