Help repairing Grub

Hi!

Im unable to repair grub after it work.

Im Runnnig RockyLinux 9 on a VPS. All data seems to be still here just grub broke.

Here is how the VM starts now:

Sadly for some reason the keyboard doesnt work here, but I started into a RockyLinux 9.2 ISO and went to the troubleshooting/rescue mode. There I selected the “Continue” option:

As per some guides and what I saw here I did the follwogin:

The terminal said to run the follwing command to run from the local drive or something, so I did.
→ run chroot /mnt/sysroot

lsblk:
sda

  • sda1 512M
  • sda2 2T

sda is my drive on the Server → /dev/sda1 is my boot partition
→ Run comand
grub2-install /dev/sda1

Result:
grub2-install: warning: File system ext2 doesn’t support embedding. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.

grub2-install: error: will not proceed with blocklists.

I have no idea what this means, so I tried
grub2-mkconfig /dev/sda1

Long list of things Im too slow to screenshot for, but at the end it says “Done” and I cant see any error.

Reboot → Back to beginning.

I sill have lots of data on the Server without a Backup so If the solution is a reinstall I still need to get my data off. Can I install openSSH Server for that and backup my data via filezilla/sftp?

PS: I can only post one pciture as a new user, so only the picture in the beginning survived.

So, it was working before and now it doesn’t? What was the last thing you did before it broke?

Hi!

I wanted to expand my drive (sda2) but it wasnt possible because of mbr so I used gdisk to convert it to gtp. (NO errors) I restarted and the error was here.
(Sorry forgot to mention that before)

I expected grub to break - i read so much, but I expected for the repair to be easier.

And another update:
I was able to start into grub and have my keyboard work. But while troubleshooting it turns out that I dont have the kernel rpm file on the boot folder…
I also cant download it from ISO apparently because the file system mounts as read-only for some reason.

Currently running a check on the file system and trying to mount ot afterwards specficially with rw permission
( mount -o rw /dev/mapper/hk-root /mnt )

Jesus christ.

That was (from what I can tell) actually it: Whenever I tried to run the commands for grub2 they seemed to work (mostly) but didnt actualyl affect anything, because the partition was mounted but was read-only.

after a lot of back and forth and having to use lazy unmount (because unmounting didnt work for some reason) and remounting the boot aprtition (sda) with the above command explicitly as rw i was able to finally get the kernel rpm file.

I booted to emergency mode in RockyLinux and after a restart U ended up in grub again. So still a bit to repair but ill report back if I need more help.

Nevermind I still cant boot in normal mode, just in this weird emergency mode but I also cant seem to repair grub from this emergency mode since the grub2-install and grub2-mkconfig commands dont run because the “dev” directory is not mounted…

Still help would be apprecaited

I think I have the same issue as in here:

Except i cant really see a solution there and I have 0 idea what dracut is. But anyway, running the commands
dnf install kernel
dnf reinstall kernel

dont put the neccessary files in /boot directory. That one always just keeps the 2 fodlers grub2 and loader without adding the vmlinuz and initramfs files.

Once you convert a disk to gpt the bios then attempts to boot in UEFI mode as GPT and UEFI are co-dependent. Grub2-install does nothing now because there are no reserved tracks for it.
Here’s a link to a post on fedoraforum that I created documenting the steps to take to convert a msdos disk to GPT

Convert MSDOS Disk to GPT
which I performed on my original Rocky9 install a couple years ago. It should give you and idea of what needs to be done, the how may be more complicated.

I dont knwow enought to disagree but I solved it and it works for now. At least I got a grub menue when rebooting.

So I think the best most condensed form of solving this issue without the BS:

  • Add the systemrescue ISO and start from it

  • When at the boot options select the option let systemrescue find bootable OS and boot to your OS

  • I assume this step was neeccary because i did the mbr to gpt thing:

  • run rm -f /etc/machine-id /var/lib/dbus/machine-id

  • and run systemd-machine-id-setup

    • apparently the dnf install kernel did not work because the device ID was different
  • run dnf reinstall kernel-core

  • dnf reinstall kernel

  • run ls /boot

    • now there should be the vmlinuz and img… files here
  • reboot → Grub menue is back

  • maybe you also need to rerun the grub2-install and grub2-mkconfig commands, but I didnt need to after the dnf instsall kernel command

Now the system still does not fully start - or at least i get disconnected onsce the boot starts after the grub menue.

So I will look into what you wrote there too!

Well Im stuck. I can make it boot to the system in emergency mode but not for real and manually recreating the boot partition which seems to be the problem does not work.

So im just gonna backup everything reinstall and reupload.the data…