Bug 147560

Summary: [zfs] [boot] Booting 8.1-PRERELEASE raidz system take ages
Product: Base System Reporter: Krzysztof Dajka <alteriks>
Component: kernAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugmeister: mfc-stable10?
bugmeister: mfc-stable9?
bugmeister: mfc-stable8?
Priority: Normal    
Version: 8.1-PRERELEASE   
Hardware: Any   
OS: Any   

Description Krzysztof Dajka 2010-06-06 13:40:04 UTC
I'm booting from usb memory stick with updated bootcode.
Bootstraping process:

 BTX loader 1.00 BTX version is 1.01
 Console: internal video/keyboard
 BIOS drive C: is disk0
 BIOS drive D: is disk1
 BIOS drive E: is disk2
 BIOS drive F: is disk3
 |
It freezes in this state for over 40 seconds and after that boots normally. I have even tried booting over pxe, I created 1M file  

I have following raidz configuration:

$  gpart show                       
=>       34  976773101  ada0  GPT  (466G)
         34  976773101     1  freebsd-zfs  (466G)

=>       34  976773101  ada1  GPT  (466G)
         34  976773101     1  freebsd-zfs  (466G)

=>       34  976773101  ada2  GPT  (466G)
         34  976773101     1  freebsd-zfs  (466G)

=>   34  60733  da0  GPT  (30M)
     34    128    1  freebsd-boot  (64K)
    162  60605       - free -  (30M)

$  zpool status
  pool: zroot
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scrub: none requested
config:

        NAME           STATE     READ WRITE CKSUM
        zroot          ONLINE       0     0     0
          raidz1       ONLINE       0     0     0
            gpt/disk0  ONLINE       0     0     0
            gpt/disk1  ONLINE       0     0     0
            gpt/disk2  ONLINE       0     0     0

How-To-Repeat: Update to 8.1-PRERELEASE, update bootcode
Comment 1 Krzysztof Dajka 2010-06-08 20:33:12 UTC
I have done few test and narrowed problem to probing usb devices. I have
taken following steps:

1) I prepared installed bootcode to 3 devices
- 512MB Kingston flash drive
- 32MB SD Card
- 1MB file (created with dd, mounted with mdconfig, added gpt partition and
freebsd-boot slice) booted over pxe
2) All devices had newest bootcode, booting from every device was terrible
slow, but sd card was significantly slower than others.
3) I played with my zpool
# zpool offline zroot gpt/disk2
4) reboot
5) I booted with every device. Booting from both devices connected to usb
bus, was slow. Booting over pxe from 1MB 'drive' with bootcode was very fast
as it should be.
6) Booting over pxe with any device attached to usb bus was again slow!
Comment 2 Andriy Gapon freebsd_committer freebsd_triage 2010-10-08 10:37:58 UTC
Responsible Changed
From-To: freebsd-amd64->freebsd-bugs

This is a generic zfs boot problem resulting from how the code 
finds disks for zfs pools. 
Not sure if we can do any better here.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2010-10-08 11:28:51 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

apparently ZFS-specific.
Comment 4 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-08-06 05:35:08 UTC
State Changed
From-To: open->patched

Patched in head/ with r239068.
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2012-11-19 13:12:52 UTC
Responsible Changed
From-To: freebsd-fs->ae

Take it.
Comment 6 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-06-02 03:54:41 UTC
This problem should be fixed in head/, stable/10 and stable/9.