From owner-freebsd-fs@FreeBSD.ORG Fri Feb 3 04:21:33 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA19106566B for ; Fri, 3 Feb 2012 04:21:33 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA178FC08 for ; Fri, 3 Feb 2012 04:21:32 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q132Gr2t018049 for ; Fri, 3 Feb 2012 13:16:53 +1100 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q132Goje007152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Feb 2012 13:16:51 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id q132GngV028162 for ; Fri, 3 Feb 2012 13:16:49 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id q132Gnix028161 for freebsd-fs@freebsd.org; Fri, 3 Feb 2012 13:16:49 +1100 (EST) (envelope-from peter) Date: Fri, 3 Feb 2012 13:16:49 +1100 From: Peter Jeremy To: freebsd-fs@freebsd.org Message-ID: <20120203021649.GA87521@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cmJC7u66zC7hs+87" Content-Disposition: inline X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Subject: ZFS boot problems revisited X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 04:21:33 -0000 --cmJC7u66zC7hs+87 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I recently ran into the dreaded "all blocks unavailable" error whilst upgrading to a recent 8-stable with a 3-way mirrored ZFS root. Installing the latest gptzfsboot helped a bit but still reported errors and the boot failed. I was under the impression that the latest boot code had resolved all the problems but it seems there are still some cases it can't cope with. Comparing the code I built with the latest head shows no relevant differences (disabling SSE3 & FP and changing a constant used for RAIDZ parity calculations). Are there any known cases that the boot code still doesn't handle? The failures led me to investigate zfsboottest & zfsboottest.sh. Unfortunately, these tools still have some problems:=20 1) zfsboottest is still built as native dynamic executable. I'm not sure if being dynamic presents a problem (I would hope it didn't) but it should be an i386 executable on amd64. The attached patch changes it to be a static i386 executable. 2) vfs.root.mountfrom is documented (in sys/kern/vfs_mountroot.c in 9.x and later or sys/kern/vfs_mount.c in 8.x and earlier) to take a space-separated list of :[]. zfsboottest.sh expects it to be a bare zpool name. The attached patch adds the "zfs:" prefix but still limits it to a single item. 3) The "you may not be able to boot" message will never appear because it's testing the result of the preceeding "rm -f", rather than the diff (as wanted). The attached patch fixes this. I'm still not confident that the flags used to build zfsboottest are equivalent to those used to build gptzfsboot but will leave that for later investigation. The attached patches are relative to 8-stable CVS but there are no differences to head. --=20 Peter Jeremy --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="zfsboottest.diff" Content-Transfer-Encoding: quoted-printable Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/ncvs/src/tools/tools/zfsboottest/Makefile,v retrieving revision 1.3.2.2 diff -u -r1.3.2.2 Makefile --- Makefile 7 Jan 2012 02:35:00 -0000 1.3.2.2 +++ Makefile 3 Feb 2012 00:18:44 -0000 @@ -17,11 +17,14 @@ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ -Werror -LDFLAGS+=3D-lmd +LDFLAGS+=3D-static +LDADD=3D-lmd =20 .if ${MACHINE_ARCH} =3D=3D "amd64" beforedepend zfsboottest.o: machine CLEANFILES+=3D machine +CFLAGS+=3D-m32 +LDFLAGS+=3D-m32 machine: ln -sf ${.CURDIR}/../../../sys/i386/include machine .endif Index: zfsboottest.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/ncvs/src/tools/tools/zfsboottest/zfsboottest.sh,v retrieving revision 1.1.6.2 diff -u -r1.1.6.2 zfsboottest.sh --- zfsboottest.sh 7 Jan 2012 02:35:00 -0000 1.1.6.2 +++ zfsboottest.sh 3 Feb 2012 00:20:03 -0000 @@ -73,7 +73,7 @@ # or vfs.root.mountfrom variable set in /boot/loader.conf. egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mount= point}/etc/fstab" 2>/dev/null if [ $? -ne 0 ]; then - egrep -q 'vfs.root.mountfrom=3D"?'"${bootfs}"'"?[[:space:]]*$' "${mountpo= int}/boot/loader.conf" 2>/dev/null + egrep -q 'vfs.root.mountfrom=3D"?zfs:'"${bootfs}"'"?[[:space:]]*$' "${mou= ntpoint}/boot/loader.conf" 2>/dev/null if [ $? -ne 0 ]; then echo "To be able to boot from \"${bootfs}\", you need to declare" >&2 echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab= " >&2 @@ -121,7 +121,7 @@ =20 rm -f "${list0}" "${list1}" =20 -if [ $? -ne 0 ]; then +if [ $ec -ne 0 ]; then echo >&2 echo "You may not be able to boot." >&2 exit 1 --HlL+5n6rz5pIUxbD-- --cmJC7u66zC7hs+87 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8rQ5EACgkQ/opHv/APuIe2YwCeOMx9wOZh0QAtHopT6AZ97Ekr H2MAnR9WwGvyS3g9BYXWEkKn/fE/qhM3 =N+1v -----END PGP SIGNATURE----- --cmJC7u66zC7hs+87--