Grub2 with gpt/bios - definition the install place

My system has only bios - not uefi - and 5 big hdd. All of there has gpt partition table. On 2 of them I has installed opensuse (leap and tumbleweed). On these systems you can definition where grub be installed (write in file /etc/default/grub_installdevice). In my constellation is it /dev/sda and /dev/sdc. The system wich I want to boot, I select with F8-Key - select the boot-medium by bios-function.

Now I installed Fedora 32 at some partitions of /dev/sdd.
For this use I defined a bios_boot partition at /dev/sda1 and then the other ones (boot, root, usr, home). The normal installation process need more then 10 minutes to end the step “installation of grub2” - with the result, that the new system can’t boot.
Then I boot a live system, remounted the system in a “chroot”. So I could install grub2 manually with the command:
grub2-install --force /dev/sdd

How I can tell this to the fedora-system (scribe to what config-file), so that the next updates with the post-install-scripts can find the correct grub2-place and -install-command?

Hi heitei:

I think the Fedora system runs something like “grub2-probe /” to determine which drive the first-stage boot loader should chain load to. If you run that command manually from within the booted Fedora system, does it return the correct result? It may pass some additional switches to the grub2-probe command. I’m going from memory. The result of the command is stored in the “root” variable which is embedded in the “core” image that is written to the start of the disk (I think. Again, this is all from memory).

Hi glb:
Thanks for your answer.
I tested your commandline

grub2-probe /

The results are:

[~]$ grub2-probe /
ext2

grub2-probe -d /dev/sdd
grub2-probe: Fehler: …/grub-core/kern/fs.c:120:Unbekanntes Dateisystem.

grub2-probe --target=bios_hints -d /dev/sdd
hd3

Here I write the result of

“gdisk -l /dev/sdd”:

Number Start (sector) End (sector) Size Code Name
1 2048 22527 10.0 MiB EF02
2 22528 1046527 500.0 MiB 8300
3 1046528 105904127 50.0 GiB 8300
4 105904128 210761727 50.0 GiB 8300
5 210761728 294647807 40.0 GiB 8300
8 403601408 445546495 20.0 GiB 8200 primary
9 445546496 571383807 60.0 GiB 8300 primary
10 571383808 1200537599 300.0 GiB 8300 primary
11 1200537600 5860532223 2.2 TiB 8E00 primary

Nr 1 is type EF02 - thats must be right!?

Now I don’t know what can I do more!

hd3 probably maps to sdd (numbering starts at zero with grub). If grub2-probe --target=bios_hints / returns hd3, then that should mean that grub2-install will update the correct drive when the post-install scripts are run.

Thanks a lot for your knowledge. I hope that the scripts use the option

–force or – recheck

to install grub2. The original installer has’nt this done, because the installed system can’t boot.

You should be able to customize the installation by modifying or adding to what is under /etc/grub.d. You have to really know what you are doing to modify those files though. Explaining all of it would be too much to write here. Sorry. The first thing to do is just try it as it is and hope that it works. Good luck! :slightly_smiling_face:

1 Like

I looked to the files that you mean, if I booted F32 in the next days again.
In this time is the OS Leap my - and my wifes :wink: - allday system. F32 I would test now as alternative.

A good night and very nice next days
heitei

Hi @glb,
I looked today at the files and there not exist a point to write the grub-installation place.
But today I maked a software update with a actual kernel and the automatic find the right install-place and used the correct install-option for bios with gpt and bios_boot/bios_grub partition.

All is fine and other user don’t must see a problem with the kernel/grub updates.
Only the first installation make it not right.

Thanks a lot for your help.