[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grub on BIOS/GPT
From: |
Andrei Borzenkov |
Subject: |
Re: Grub on BIOS/GPT |
Date: |
Mon, 21 Feb 2022 07:42:52 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 21.02.2022 01:53, David Ventura wrote:
> Hi
> I'm trying to boot grub on a BIOS/GPT combination and am currently stuck.
> I've created a test disk image with the following GPT partition (and
> protective MBR):
>
>
> Found valid GPT with protective MBR; using GPT.
> Disk hdd-grub.raw: 131072 sectors, 64.0 MiB
> Sector size (logical): 512 bytes
> Disk identifier (GUID): 488005E7-D3AF-4B71-AEE6-F54B497A63FC
> Partition table holds up to 128 entries
> Main partition table begins at sector 2 and ends at sector 33
> First usable sector is 34, last usable sector is 131038
> Partitions will be aligned on 2048-sector boundaries
> Total free space is 2014 sectors (1007.0 KiB)
>
> Number Start (sector) End (sector) Size Code Name
> 1 2048 4095 1024.0 KiB EF02 BIOS boot partition
> 2 4096 65535 30.0 MiB EF00 EFI system partition
> 3 65536 131038 32.0 MiB 8300 Linux filesystem
>
> On this disk image, I've applied the boot.img MBR like so:
>
> dd if=/usr/lib/grub/i386-pc/boot.img of=hdd-grub.raw bs=440
> count=1 conv=notrunc
> which successfully shows a "GRUB" prompt on BIOS.
>
> The only thing I've done after this, is to apply the core.img on the
> exact BIOS boot partition offset:
>
> dd if=core.img of=hdd-grub.raw bs=512 seek=2048 conv=notrunc
>
> However, nothing different happens (the only thing I see is, still,
> "GRUB" and a flashing cursor).
> To be clear, I am _not_ seeing the emergency shell.
>
> The core image I've generated with this command:
> grub-mkimage -O i386-pc -o ./core.img -p '(hd0,gpt3)/boot/grub'
> biosdisk part_msdos xfs part_gpt
>
> I've tried embedding an early config and actually populating
> (hd0,gpt3)/boot/grub/grub.cfg out of desperation but that did not
> help.
>
> What am I doing wrong?
>
You do not use grub-install.
core.img location is stored in both boot.img by grub.install. What you
see is boot.img which attempts to load and execute garbage so system hangs.
- Grub on BIOS/GPT, David Ventura, 2022/02/20
- Re: Grub on BIOS/GPT,
Andrei Borzenkov <=