Hi. I'd have to chime in. ;-)

There are at least 4 ways of workarounds, including yours (1).

  1: Offset GPT entry in PMBR. (First posted by Chris Torek.)
  2: Mimic ESP [use 0xEF instead of 0xEE] (Need patch for loader.)
  3: Use UEFI loader. (Currently clean root-on-ZFS is NOT supported)
  4: Use MBR instead of GPT. (No large disk support)

My first solution was 2, but the patched loader possibly misbehave if
separate ESP (EFI System Partition) exists. (Hybrid MBR case, not

I've tested 3 only with memstick.img built with head. Not with actual
HDD installation. (ThinkPad T420)

The important thing is that some problematic computers other than
Lenovo's can require the way other than 1. And some won't need anything
above, but setting active flag with gpart.

So, as you already mentioned, these workarounds should be optional.
Ideally, prepare options for gpart, and menus for bsdinstall to choose

Please see also my related page[1]. It includes loader patch for 2 (but
not separate files). Newer entry on top.

As I'm using solution 1 currently, the patch isn't tested for a long
time. I'm testing if it's applicable to stable/10 or not (no build
test), and now applicable with fuzz.


On Sun, 12 Jul 2015 02:02:51 -0400
Allan Jude <allanj...@freebsd.org> wrote:

> On 2015-07-12 01:49, Allan Jude wrote:
> > I have spent my weekend researching why my Lenovo X220s refuse to boot
> > from GPT partitioned disks.
> > 
> > Based on this mailing list post:
> > https://lists.freebsd.org/pipermail/freebsd-i386/2013-March/010437.html
> > 
> > I have written a patch for gpart to change the way the PMBR is created.
> > 
> > Instead of writing the 0xee partition in the first slot (offset 0), it
> > writes it to the 2nd slot (offset 1).
> > 
> > This resolves the issue on my Lenovo X220s, and the installed image
> > boots fine on my T530, and various other non-lenovo amd64 machines at my
> > house.
> > 
> > If others could please test this image (it is a pre-installed system, so
> > just dd it to a memory stick, and see if it boots. Can be safely done
> > without touching your disks), that would be most helpful.
> > 
> > compressed (193 MiB):
> > http://www.allanjude.com/bsd/lenovofix_20150704-r285132.img.xz
> > 
> > uncompressed (1 GiB):
> > http://www.allanjude.com/bsd/lenovofix_20150704-r285132.img
> > 
> > 
> I forgot to include the link to the patch as well:
> http://www.allanjude.com/bsd/lenovofix_gpart.patch
> I will most likely make this patch optional, behind a flag to the 'gpart
> create -s gpt' command, to avoid potentially breaking existing working
> systems, but if using offset 1 works on all other hardware, having it as
> the default would be nice.
> Another option would be to make a separate standalone program to modify
> the pMBR for Lenovo machines, rather than modifying gpart.
> Thoughts?
> -- 
> Allan Jude

Tomoaki AOKI    junch...@dec.sakura.ne.jp
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to