From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 13 14:00:21 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE9951065701 for ; Tue, 13 Sep 2011 14:00:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 931D28FC1E for ; Tue, 13 Sep 2011 14:00:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8DE0Kc1035054 for ; Tue, 13 Sep 2011 14:00:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8DE0Kkp035053; Tue, 13 Sep 2011 14:00:20 GMT (envelope-from gnats) Resent-Date: Tue, 13 Sep 2011 14:00:20 GMT Resent-Message-Id: <201109131400.p8DE0Kkp035053@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Peter Maloney Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A675A1065670 for ; Tue, 13 Sep 2011 13:50:22 +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 7C9578FC13 for ; Tue, 13 Sep 2011 13:50:22 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p8DDoLZ1073246 for ; Tue, 13 Sep 2011 13:50:21 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p8DDoLmS073245; Tue, 13 Sep 2011 13:50:21 GMT (envelope-from nobody) Message-Id: <201109131350.p8DDoLmS073245@red.freebsd.org> Date: Tue, 13 Sep 2011 13:50:21 GMT From: Peter Maloney To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/160706: zfs bootloader fails when a non-root vdev exists on a slice before the root slice X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2011 14:00:21 -0000 >Number: 160706 >Category: misc >Synopsis: zfs bootloader fails when a non-root vdev exists on a slice before the root slice >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 13 14:00:20 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Peter Maloney >Release: >Organization: Brockmann Consult >Environment: FreeBSD 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: zfs bootloader fails when a non-root vdev exists on a slice before the root slice >How-To-Repeat: gpart create -s gpt da0 gpart add -b 34 -s 64k -t freebsd-boot da0 gpart add -s 512M -t freebsd-swap -l swap0 da0 gpart add -s 4G -t freebsd-zfs -l log0 da0 gpart add -s 170G -t freebsd-zfs -l cache0 da0 gpart add -t freebsd-zfs -l root0 da0 gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 da0 zpool create zroot mirror gpt/root0 gpt/root1 glabel label da1 tank1d1 .. glabel label da tankd zpool create tank \ raidz2 label/tank1d1 label/tank1d2 ... \ raidz2 ... At this point the system works fine. And survives rebooting. zpool add tank cache gpt/cache0 gpt/cache1 zpool add tank log mirror gpt/log0 gpt/log1 Now if you boot the system, you get an screen looking like: ========================= - FreeBSD/x86 boot Default: tank:/boot/kernel/kernel boot: | FreeBSD/x86 boot Default: tank:/boot/kernel/kernel boot: _ ========================= I have screenshots (which I plan to attach to this report if such a button appears after submitting it). And a note about the screenshots, the shell looks broken as a side effect of editing the installer iso file. I only added scripts and the mps driver to it. And the same problem happens without my changes in FreeBSD-8.2-RELEASE and FreeBSD-8.2-STABLE-201105. FYI: I used mirrors, and installed FreeBSD using this guide, and added things such as the cache and log slices. http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror >Fix: Fix unknown... Probably a source code change is needed somewhere in sys/boot/zfs. Possibilities could be: - retry the same loop/scan again skipping failed zfs pools - skip zfs vdevs/pools that have no /boot directory - skip log and cache vdevs (which I guess would be only a workaround and specific to my case) Workaround: Make sure your bootable system is the first zfs slice on your boot disk. eg. gpart add -b 34 -s 64k -t freebsd-boot da0 gpart add -s 512M -t freebsd-swap -l swap0 da0 gpart add -s 80G -t freebsd-zfs -l root0 da0 gpart add -s 4G -t freebsd-zfs -l log0 da0 gpart add -t freebsd-zfs -l cache0 da0 (where root0 is the zfs root slice) >Release-Note: >Audit-Trail: >Unformatted: