I don't know if booting from a GPT mass storage device is still of interest and still an issue for others, but I set up such a system a few months ago and just had to rescue my prior install (after an upgrade from Stretch to Buster), and thought I'd share a sketch of what I did.
CAUTION: Everything I've read suggests that hybrid GPT/MBR drives could be unreliable, and I have no reason not to believe that. This has worked for me, in a non-critical application, but take care in using it for mission-critical systems.
I'm running a 3B+ booting off a 4TB WD USB3 drive. I used gdisk to set up the system using the instruction for creating a hybrid GPT/MBR drive from here: https://wiki.gentoo.org/wiki/Hybrid_partition_table
. I created partitions to look like this:
Code: Select all
[email protected]:/home/hdtodd# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
BSD: not present
APM: not present
Found valid GPT with hybrid MBR; using GPT.
Command (? for help): p
Disk /dev/sda: 7813969920 sectors, 3.6 TiB
Model: easystore 25FA
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 654D47AA-24BB-4FAC-A75D-22EAB4DF2C29
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 7813969886
Partitions will be aligned on 2048-sector boundaries
Total free space is 10173 sectors (5.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 8192 507903 244.0 MiB 0700 Microsoft basic data
2 507904 65634303 31.1 GiB 8300 Linux filesystem
3 65634304 68706303 1.5 GiB 8200
4 68706304 7813967871 3.6 TiB 8300
Command (? for help): q
In "recovery" mode, I created the MBR table with this:
Code: Select all
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 1
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): n
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 07): 0c
Set the bootable flag? (Y/N): y
Unused partition space(s) found. Use one to protect more partitions? (Y/N): n
Recovery/transformation command (? for help): o
Disk size is 7813969920 sectors (3.6 TiB)
MBR disk identifier: 0x00000000
Number Boot Start Sector End Sector Status Code
1 * 8192 507903 primary 0x0C
2 1 8191 primary 0xEE
Note that I added just the first partition (FAT32) to the MBR tables. I didn't explore other options.
The upgrade from Stretch to Buster worked just fine, but the original install had only a 43MB partition for /BOOT, and the system warned me that it was nearly out of space. So I used gparted to shrink /dev/sda2 by 200MB on the front end and added that 200MB to /dev/sda1, and after that, the system wouldn't boot. It appears that using any partitioning tools other than gdisk to work with partitions destroys the hybrid tables, and you need to reconstruct them with the instructions above (the partition contents were preserved and booted just fine after the hybrid tables were reconstructed).
So I went through the process of creating the hybrid GPT/MBR partition tables as described above, and the system again boots just fine.
I've been using this Pi drive as an Apple Time Machine network backup system. Slow as molasses, but usable after the first save (on a 256GB system). Hoping that performance will improve when I attach the drive to a Pi-4, 4GB system this Fall. But at this point, at least, I have a system that has functioned for several months, and it has survived the Stretch --> Buster upgrade.