From owner-freebsd-stable@freebsd.org Sat Mar 3 00:23:21 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86D57F30B58; Sat, 3 Mar 2018 00:23:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20DD281E18; Sat, 3 Mar 2018 00:23:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2607F1610E; Sat, 3 Mar 2018 01:23:13 +0100 (CET) From: Dimitry Andric Message-Id: <5CFC89E9-57BE-4CB7-9C55-0D3CCF1E8D3D@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_41898BBB-F224-4F3D-81EA-7822D32F4A99"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: zfs problems after rebuilding system Date: Sat, 3 Mar 2018 01:23:12 +0100 In-Reply-To: Cc: tech-lists , FreeBSD Filesystems , FreeBSD Stable To: Freddie Cash References: <21c64a2d-b9f9-24c8-88ec-ff1210891f60@zyxst.net> <1dc2b8ef-2914-8182-e2b0-ac637e6b2095@zyxst.net> <65372449-53f1-8002-981a-e20f4a592e26@zyxst.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:23:21 -0000 --Apple-Mail=_41898BBB-F224-4F3D-81EA-7822D32F4A99 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 3 Mar 2018, at 01:09, Freddie Cash wrote: > > You said it's an external USB drive, correct? Could it be a race condition > during the boot process where the USB mass storage driver hasn't detected > the drive yet when /etc/rc.d/zfs is run? > > As a test, add a "sleep 30" in that script before the "zfs mount -a" call > and reboot. Indeed. I have had the following for a few years now, due to USB drives with ZFS pools: --- /usr/src/etc/rc.d/zfs 2016-11-08 10:21:29.820131000 +0100 +++ /etc/rc.d/zfs 2016-11-08 12:49:52.971161000 +0100 @@ -25,6 +25,8 @@ zfs_start_main() { + echo "Sleeping for 10 seconds to let USB devices settle..." + sleep 10 zfs mount -va zfs share -a if [ ! -r /etc/zfs/exports ]; then For some reason, USB3 (xhci) controllers can take a very, very long time to correctly attach mass storage devices: I usually see many timeouts before they finally get detected. After that, the devices always work just fine, though. Whether this is due to some sort of BIOS handover trouble, or due to cheap and/or crappy USB-to-SATA bridges (even with brand WD and Seagate disks!), I have no idea. I attempted to debug it at some point, but a well-placed "sleep 10" was an acceptable workaround... :) -Dimitry --Apple-Mail=_41898BBB-F224-4F3D-81EA-7822D32F4A99 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWpnq8AAKCRCwXqMKLiCW ozfDAKCIzixRre/XkhsHgqalf0xmgsyqEwCg+zQprqqW9NH26RJTbf5Esgnt2s4= =TcLW -----END PGP SIGNATURE----- --Apple-Mail=_41898BBB-F224-4F3D-81EA-7822D32F4A99--