Re: Stuck at grub prompt after reordering partitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 19, 2024 at 9:31 AM Klaus-Peter Schrage via users
<users@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> But, as Felix had proposed in his post, I dived a bit deeper into
> efibootmgr (also new to me up to know), and found out that entries point
> to PARTUUIDs, in my case:
> FedoraHD(3,GPT,1ca6f5eb-cbea-11e9-a525-4ccc6ad8789c,0x24fc9800,0x32000)/\EFI\FEDORA\SHIM.EFI0000424f
> Windows Boot Manager
>   HD(1,GPT,1ca6f5ea-cbea-11e9-a525-4ccc6ad8789c,0x800,0x24c60000)/\EFI\Microsoft\Boot\bootmgfw.efi0000424f
>
> And I found, that two partitions (EFI, Windows) on my third harddisk
> have the same PARUUID:
>
> /dev/sdc1: LABEL="WIN" BLOCK_SIZE="512" UUID="A1C61D016294FB66"
> TYPE="ntfs" PARTUUID="1ca6f5ea-cbea-11e9-a525-4ccc6ad8789c"
> /dev/sdc3: UUID="BEAD-09C3" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI
> System Partition" PARTUUID="1ca6f5eb-cbea-11e9-a525-4ccc6ad8789c"
> I don't know if that really matters ...

I don't think this matters for your Linux boot - no idea if it matters
for your Windows boot.

The basic process is EFI is using its variables (which you can examine
with efibootmgr) to find a device and the file on the device to use
for the boot.  That should be on the *.efi files in
/boot/efi/EFI/fedora/.  That in term should load grub2, which will
then use /boot/efi/EFI/fedora/grub.cfg.  It then uses this to find the
device with /boot/grub2/grub.cfg.

As an example, here are the relevant bits from my system:
[root@fubar ~]# efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0002
Boot0000* fubar HD(1,GPT,166f4bf1-c04a-447e-916a-2b0363cb6504,0x800,0x64000)/\EF
I\fedora\shimx64.efi
Boot0002* Fedora        HD(1,GPT,166f4bf1-c04a-447e-916a-2b0363cb6504,0x800,0x12
c000)/\EFI\fedora\shimx64.efi
Boot0003* Fedora        HD(1,GPT,166f4bf1-c04a-447e-916a-2b0363cb6504,0x800,0x64
000)/\EFI\FEDORA\SHIMX64.EFI

All 3 entries use "HD(1," so we don't need the device UUID, and all 3
have the same UUID and point to the file "\EFI\fedora\shimx64.efi".
This is as expected as the system is single-boot, although I'm not
really sure why I have *two* entries labelled "Fedora".  Anyway...

[root@fubar ~]# blkid | grep -i 166f4bf1-c04a-447e-916a-2b0363cb6504
/dev/nvme0n1p1: SEC_TYPE="msdos" UUID="21AA-D515" BLOCK_SIZE="512" TYPE="vfat" P
ARTLABEL="EFI System Partition" PARTUUID="166f4bf1-c04a-447e-916a-2b0363cb6504"

As expected, the EFI variables are pointing to the EFI partition (via
PARTUUID).  On that partition shimx64.efi will load grub while will
use grub.cfg from the same directory.

[root@fubar ~]# cat /boot/efi/EFI/fedora/grub.cfg
search --no-floppy --fs-uuid --set=dev c5f18a2c-ee16-454e-b85d-6d7f03b86532
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

[ Since you are getting a grub prompt, I think we can assume you are
at least getting this far. ]

The UUID maps to:

[root@fubar ~]# blkid | grep -i c5f18a2c-ee16-454e-b85d-6d7f03b86532
/dev/nvme0n1p2: UUID="c5f18a2c-ee16-454e-b85d-6d7f03b86532" BLOCK_SIZE="512" TYP
E="xfs" PARTLABEL="/boot" PARTUUID="26ff026c-ee27-441f-b6fd-4b38791e5dc8"

So /boot/efi/EFI/fedora/grub.cfg points to the partition with /boot.

--> Confirm your config points to the proper /boot partition.

Now that grub knows how to find /boot, it can find /boot/grub2/grub.cfg.

[root@fubar ~]# grep -- --fs-uuid /boot/grub2/grub.cfg
search --no-floppy --fs-uuid --set=root c5f18a2c-ee16-454e-b85d-6d7f03b86532
search --no-floppy --fs-uuid --set=boot 21AA-D515
[root@fubar ~]# blkid | grep -i c5f18a2c-ee16-454e-b85d-6d7f03b86532
/dev/nvme0n1p2: UUID="c5f18a2c-ee16-454e-b85d-6d7f03b86532" BLOCK_SIZE="512" TYP
E="xfs" PARTLABEL="/boot" PARTUUID="26ff026c-ee27-441f-b6fd-4b38791e5dc8"
[root@fubar ~]# blkid | grep -i 21AA-D515
/dev/nvme0n1p1: SEC_TYPE="msdos" UUID="21AA-D515" BLOCK_SIZE="512" TYPE="vfat" P
ARTLABEL="EFI System Partition" PARTUUID="166f4bf1-c04a-447e-916a-2b0363cb6504"

--set=root has the correct UUID for /boot (in this case it appears
"root" means the root of the grub config).
--set=boot has the correct (device) UUID for the EFI partition.

--> Confirm your entries are correct.  Double-check file system type.
If grub.cfg was created by grub2-mkconfig I would expect them to be
correct.

Now the grub config is going to be system-specific, but if you are
getting this far you should have the grub menu that allows you to
select which kernel/OS to boot.

[ If no grub menu, you are not getting this far. ]

Now grub loads the initramfs, etc.  I *think* if there is a problem at
this point you will get dropped into the dracut shell (as opposed to a
grub shell).

I should also mention that my system is Fedora 38, but until you get
as far as loading initramfs I doubt that matters as long as you have
EFI and grub2.
--
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux