geohei
August 22nd, 2013, 07:18 AM
I did quite some fiddling around UEFI and efibootmgr, but one of the things I missed is the "link" between the bootmanager (grubx64.efi) and the partition the system resides.
Example (yes, I know ... 2 ESPs - for testing!):
...
Command (? for help): p
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7B0E6510-D248-42E6-BB41-8F1545A740AA
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 38072941 sectors (18.2 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB EF00 EFI System - Windows
2 206848 468991 128.0 MiB 0C01 Microsoft reserved part
3 468992 210184191 100.0 GiB 0700 Basic data partition
4 210184192 315041791 50.0 GiB 0700 Basic data partition
5 315041792 315246591 100.0 MiB EF00 EFI System - Ubuntu
6 315246592 420104191 50.0 GiB 0700 Ubuntu
7 420104192 462047231 20.0 GiB 8200 Linux swap
To make an entry into UEFI boot manager, I use:
efibootmgr -c -d /dev/sda -p 5 -l "\EFI\ubuntu\grubx64.efi" -L "Ubuntu"
How does grubx64.efi (located in sda5) know that it should continue to boot in sda6 (which resides the Linux on an ext4 filesystem)?
Example (yes, I know ... 2 ESPs - for testing!):
...
Command (? for help): p
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7B0E6510-D248-42E6-BB41-8F1545A740AA
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 38072941 sectors (18.2 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB EF00 EFI System - Windows
2 206848 468991 128.0 MiB 0C01 Microsoft reserved part
3 468992 210184191 100.0 GiB 0700 Basic data partition
4 210184192 315041791 50.0 GiB 0700 Basic data partition
5 315041792 315246591 100.0 MiB EF00 EFI System - Ubuntu
6 315246592 420104191 50.0 GiB 0700 Ubuntu
7 420104192 462047231 20.0 GiB 8200 Linux swap
To make an entry into UEFI boot manager, I use:
efibootmgr -c -d /dev/sda -p 5 -l "\EFI\ubuntu\grubx64.efi" -L "Ubuntu"
How does grubx64.efi (located in sda5) know that it should continue to boot in sda6 (which resides the Linux on an ext4 filesystem)?