Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 2014 19:30:02 GMT
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-fs@FreeBSD.org
Subject:   Re: amd64/186515: Doesn't boot with GPT when # of entries over than 128.
Message-ID:  <201402061930.s16JU2Pi052495@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/186515; it has been noted by GNATS.

From: John Baldwin <jhb@freebsd.org>
To: freebsd-amd64@freebsd.org
Cc: Yeong.Hun@freebsd.org,
 Jo <jyhpsycho@gmail.com>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/186515: Doesn't boot with GPT when # of entries over than 128.
Date: Thu, 6 Feb 2014 13:41:04 -0500

 On Thursday, February 06, 2014 12:43:48 pm Yeong.Hun@freebsd.org, Jo wrote:
 > 
 > >Number:         186515
 > >Category:       amd64
 > >Synopsis:       Doesn't boot with GPT when # of entries over than 128.
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-amd64
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Thu Feb 06 17:50:00 UTC 2014
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Yeong Hun, Jo
 > >Release:        FreeBSD 10.0-RELEASE
 > >Organization:
 > -
 > >Environment:
 > FreeBSD localhost 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 1 
 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  
 amd64
 > >Description:
 > I tried to making USB memory stick using GPT partition table scheme. I 
 usually use 152 entries to aligning 4KB boundary for data disk(start location) 
 and use 156 entries to aligning 4KB boundary for system disk(end location, 
 misalignment of start location is used for boot code and make 4KB aligned root 
 partition). I don't like that some "free" sectors on disk :-)
 > 
 > But, it failed to boot when partition entry count is adjusted to more than 
 128.
 > 
 > * WORKS : 128 entries GPT(1st usable sector = 34) with freebsd-boot 
 partition at sector 34, 40.
 > 
 > * DOESN'T WORK : 152 entries GPT(1st usable sector = 40) with freebsd-boot 
 partition at sector 40, 156 entries GPT(1st usable sector = 41) with freebsd-
 boot partition at sector 41.
 > 
 > 
 > 
 > Yes, There's no problem with default size GPT partition table. "128 entires" 
 - minimum entry count by spec. - seems to be sufficient at most cases. But, 
 that can be arbitrary size and should be supported even that cases. I think 
 there's some issue on gpart or early-stage boot loader(/boot/pmbr).
 > 
 > >How-To-Repeat:
 > * For example, USB disk is da0 here.
 > 
 > # gpart create -s gpt -n 152 da0
 > # gpart add -t freebsd-boot -b 40 -s 32 -i 1 da0
 > # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0
 > 
 > and try to boot USB. It should be show "clockwise" loading screen even no 
 freebsd-ufs partition on USB, but it doesn't show anything and reboot 
 immediately. It(doesn't say anything and reboot) occurs with /boot populated 
 freebsd-ufs partition, too.
 
 Using more entries to pad out the table isn't the normal way to handle 4k 
 alignment.  You can just leave a gap before the start of freebsd-boot.  Having 
 the sectors "free" vs having them contain zero'd GPT entries doesn't really 
 make a difference.  One question is when does the boot break?  Does it make it 
 into the loader and break trying to boot the kernel?  Does it make it into 
 gptboot and break trying to load the loader?
 
 -- 
 John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402061930.s16JU2Pi052495>