[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grub-install into hybrid MBR on GPT disk on legacy BIOS
From: |
jzb |
Subject: |
grub-install into hybrid MBR on GPT disk on legacy BIOS |
Date: |
Sun, 7 Jan 2018 12:52:07 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 SeaMonkey/2.40 |
Hello,
I have an old laptop that is legacy-BIOS only. It has one SATA hard-drive. I
want to use GPT partitioning scheme for my disk for runtime (4.14.5 kernel
with UEFI/GPT support), but it still needs to be bootable from a legacy-only
BIOS that only knows MBR scheme. No other way to boot from that one disk.
All my research shows that this should be supported, but I have to use hybrid
MBR. I've done this. Here's the details:
$ sudo gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: present
Found valid GPT with hybrid MBR; using GPT.
Command (? for help): r
Recovery/transformation command (? for help): p
Disk /dev/sda: 312581808 sectors, 149.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): C2088C9E-A296-422E-AC1E-F9E239258DFE
Partition table holds up to 128 entries
First usable sector is 2048, last usable sector is 312581774
Partitions will be aligned on 2048-sector boundaries
Total free space is 47104 sectors (23.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 2050047 1000.0 MiB EF02
2 2097152 10485759 4.0 GiB 8300
3 10485760 52428799 20.0 GiB 8300 Linux filesystem
4 52428800 312581774 124.0 GiB 8300 Linux filesystem
Recovery/transformation command (? for help): o
Disk size is 312581808 sectors (149.0 GiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 2047 primary 0xEE
2 * 2048 2050047 primary 0xEF
3 2097152 10485759 primary 0x83
4 10485760 52428799 primary 0x83
I have the EE partition first, and there's the EF02 for grub to install into.
I run the grub-install command with appropriate parameters, and there are no
errors. Everything appears fine. When I install with the '-v' option, it
shows, among other things:
(grub-install -v --target=i386-pc /dev/sda
/dev/sda1 is mounted as /boot [ext2 filesystem])
^^^^^^^^^^^^^^^ <- is this okay for hybrid???
...
grub-install: info: setting the root device to `hostdisk//dev/sda,gpt1'.
grub-install: info: saving <2048,0,512>.
grub-install: info: saving <2049,0,512>.
grub-install: info: saving <2050,0,512>.
...
grub-install: info: saving <2145,0,512>.
grub-install: info: saving <2146,0,512>.
grub-install: info: saving <2147,0,512>.
Installation finished. No error reported.
This is all as it should, as far as I can tell, assuming that sector 2048 is
where grub should embed itself (not so sure come to think of it). But then I
go to reboot, and all I get is the
GRUB
printout, and nothing further. Other than that one word, the screen is blank.
Seems the boot-sector code ran, but that's as far as it gets (assuming that's
where 'GRUB' output comes from).
I'm running a self-compiled grub-2.02~beta2 (built on a 32-bit distro., and
/usr/lib/grub/i386-efi and /usr/lib/grub/i386-pc modules are all present) and
have no issues under any other circumstance (legacy-BIOS MBR installs work
fine). This is my first time trying to do a hybrid-MBR, and I _think_ I'm
following the right procedure.
Could someone comment on whether or not I'm missing something or am doing
something wrong? Various internet source suggest that what I'm doing is
supported.
I want a legacy-only BIOS to boot from an MBR (kind of have to...) while the
kernel uses the GPT scheme to address the partitions. I have no problems with
the kernel or its GPT that I can tell. Details above seem to confirm that.
Has anybody else done what I'm trying? BTW, I want the kernel to use the GPT
scheme as that's the only way to get a PARTUUID for the partitions, which I
need for my own purposes. Right now, I can't even get to the grub menu, or
core.img, or whatever comes after the boot-sector code runs, so I'm stuck.
Any help would be appreciated.
Thanks,
John
PS: I've tried this on two different (old) laptops, with different boards and
different BIOSes, and same results, so I'm not sure, but doesn't look like a
BIOS issue, but never can tell...
- grub-install into hybrid MBR on GPT disk on legacy BIOS,
jzb <=