Date: Fri, 3 Feb 2012 13:16:49 +1100 From: Peter Jeremy <peterjeremy@acm.org> To: freebsd-fs@freebsd.org Subject: ZFS boot problems revisited Message-ID: <20120203021649.GA87521@server.vk2pj.dyndns.org>
next in thread | raw e-mail | index | archive | help
--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 <vfsname>:[<path>]. 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120203021649.GA87521>
