Bug 171805

Summary: Delay during gptzfsboot
Product: Base System Reporter: Karli Sjöberg <Karli.Sjoberg>
Component: miscAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Karli Sjöberg 2012-09-20 08:00:24 UTC
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; that´s 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

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.
How-To-Repeat: Install FreeBSD-9.0-RELEASE with boot on ZFS
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-09-20 08:17:46 UTC
On 20.09.2012 10:50, Karli Sjöberg 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
Comment 2 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-10-17 16:36:57 UTC
Responsible Changed
From-To: freebsd-bugs->ae

Take.
Comment 3 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-11-19 13:07:35 UTC
State Changed
From-To: open->closed

Fixed with r243243. Thanks!