From nobody@FreeBSD.org  Thu Sep 20 06:50:28 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14A69106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 06:50:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id F40488FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 06:50:27 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q8K6oR2B003358
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 06:50:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q8K6oRwV003348;
	Thu, 20 Sep 2012 06:50:27 GMT
	(envelope-from nobody)
Message-Id: <201209200650.q8K6oRwV003348@red.freebsd.org>
Date: Thu, 20 Sep 2012 06:50:27 GMT
From: Karli Sjberg <karli.sjoberg@slu.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Delay during gptzfsboot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171805
>Category:       misc
>Synopsis:       Delay during gptzfsboot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ae
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 20 07:00:24 UTC 2012
>Closed-Date:    Mon Nov 19 13:08:27 UTC 2012
>Last-Modified:  Mon Nov 19 13:08:27 UTC 2012
>Originator:     Karli Sjberg
>Release:        9.0
>Organization:
SLU
>Environment:
FreeBSD zfs1-1 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Wed Apr 25 13:27:34 CEST 2012     admin@zfs1-1:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The GPT ZFS-loader was recently changed from probing 4 partitions to 128 for booting, even if the disk only has two partitions... Imagine what this did to storage systems with 50 disks(or more) attached; thats 50*128 of the delay it takes to probe at BTX.

For me, this changed the time to reboot a server to up to 20mins, while the normal time after the fix is more like 2mins. Other users at FreeBSD forums have reported delays over 10+mins as well:
https://forums.freebsd.org/showthread.php?t=31902

>How-To-Repeat:
Install FreeBSD-9.0-RELEASE with boot on ZFS
>Fix:
So, to change back this behavior:

Phase 1.
# sed -i '' 's/128/4/' /sys/boot/zfs/zfs.c

Phase 2.
Rebuild kernel/world

Phase 3.
Profit!

And booting is back to normal. This is something I always have to do with newly installed storage servers with FreeBSD-9.0-RELEASE to get back to a normal reboot time.

>Release-Note:
>Audit-Trail:

From: "Andrey V. Elsukov" <ae@FreeBSD.org>
To: =?KOI8-R?Q?Karli_Sj=F6berg?= <karli.sjoberg@slu.se>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/171805: Delay during gptzfsboot
Date: Thu, 20 Sep 2012 11:17:46 +0400

 On 20.09.2012 10:50, Karli Sjberg wrote:
 > For me, this changed the time to reboot a server to up to 20mins, while the normal time after the
 > fix is more like 2mins. Other users at FreeBSD forums have reported delays over 10+mins as well: 
 > https://forums.freebsd.org/showthread.php?t=31902
 > 
 >> How-To-Repeat:
 > Install FreeBSD-9.0-RELEASE with boot on ZFS
 >> Fix:
 > So, to change back this behavior:
 > 
 > Phase 1. # sed -i '' 's/128/4/' /sys/boot/zfs/zfs.c
 > 
 > Phase 2. Rebuild kernel/world
 > 
 > Phase 3. Profit!
 > 
 > And booting is back to normal. This is something I always have to do with newly installed storage
 > servers with FreeBSD-9.0-RELEASE to get back to a normal reboot time.
 
 Can you try the zfsloader from the 10.0-CURRENT instead?
 For example, this one:
 https://pub.allbsd.org/FreeBSD-snapshots/i386-i386/10.0-HEAD-20120919-JPSNAP/stage/trees/boot/zfsloader
 
 -- 
 WBR, Andrey V. Elsukov
 
Responsible-Changed-From-To: freebsd-bugs->ae 
Responsible-Changed-By: ae 
Responsible-Changed-When: Wed Oct 17 15:36:57 UTC 2012 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171805 
State-Changed-From-To: open->closed 
State-Changed-By: ae 
State-Changed-When: Mon Nov 19 13:07:35 UTC 2012 
State-Changed-Why:  
Fixed with r243243. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171805 
>Unformatted:
