Quantcast
Channel: Linux Device Hacking - uBoot
Viewing all articles
Browse latest Browse all 902

Schizophrenic GPT implementation in first generation Armada 370 u-boot (no replies)

$
0
0
It appears u-boot in my Shuttle KS10 has a weird GPT implementation. When trying to boot from a 4TB disk, I get this:
Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
  Device 0 @ 0 0:
Model: TOSHIBA HDWD240                          Firm: KQ000A   Ser#:         Z9J1S0I9S5HH
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1718295.8 MB = 1678.0 GB (-775897424 x 512)

GPT: last_usable_lba incorrect: 1D1C0BE8E > D1C0BEB0
get_partition_info_efi: *** ERROR: Invalid GPT ***
** Bad partition 1 **
So when detecting the disk it strips bit 32, yielding 0xD1C0BEB0 sectors. But when interpreting the GPT table, it uses the real size, and then complains they differ.
I tried a hybrid MBR, but u-boot is too smart to fall for that. It recognizes the protective MBR, and goes for the GPT table.
When providing both a valid GPT and a valid MBR only describing the boot partition, (the latter can be done by using fdisk -t mbr <device>) u-boot uses the MBR, and loads kernel + initramfs (jay!), but Linux freaks out and won't find any partitions, and so no rootfs.
Remedy: add a 'gpt' to the kernel commandline, to tell it to use GPT when both a valid MBR and a valid GPT table are found.
https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html

Viewing all articles
Browse latest Browse all 902

Trending Articles