Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Mar 2018 01:23:12 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Freddie Cash <fjwcash@gmail.com>
Cc:        tech-lists <tech-lists@zyxst.net>, FreeBSD Filesystems <freebsd-fs@freebsd.org>, FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: zfs problems after rebuilding system
Message-ID:  <5CFC89E9-57BE-4CB7-9C55-0D3CCF1E8D3D@FreeBSD.org>
In-Reply-To: <CAOjFWZ6J7UV_xXxtASqnonS8qatqaSSEqJUKyi9nw%2Bms%2BUg1QQ@mail.gmail.com>
References:  <21c64a2d-b9f9-24c8-88ec-ff1210891f60@zyxst.net> <CAOtMX2jfmh%2BAMccAMcPSRq-DcQgs6wioqSSUHncEfPruD=w_Ag@mail.gmail.com> <1dc2b8ef-2914-8182-e2b0-ac637e6b2095@zyxst.net> <CAOtMX2gHm_UdYzn5J6Lm76r8KakkYMzEcxddFYLqkmGYwkihuQ@mail.gmail.com> <65372449-53f1-8002-981a-e20f4a592e26@zyxst.net> <CAOtMX2g79aqkinu0meBzhLbui7n9H9yiEwxKm6cxpZSaxbWqbg@mail.gmail.com> <f0e9385c-4d62-a68d-ea93-f013bc456b5d@zyxst.net> <CAOjFWZ4Yq4cnWN_qucbN4W-6qtf4NYNzjNKe4QL17DU-Q=N%2B_g@mail.gmail.com> <CAOjFWZ53WaOtCvRtNpsL1OqgE7rDu8jWNEHRVPZ5Z3Q_n1bnqw@mail.gmail.com> <CAOjFWZ6gF3=N8=v3aXQaiG=pd8kmZ-xpvN2jHYj9%2Bh8fCm=rsw@mail.gmail.com> <CAOjFWZ7nPFdKr_G2qHihXdcHUBed7V0uLLHM9=p1PKzJMZNemw@mail.gmail.com> <CAOjFWZ6J7UV_xXxtASqnonS8qatqaSSEqJUKyi9nw%2Bms%2BUg1QQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <fjwcash@gmail.com> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5CFC89E9-57BE-4CB7-9C55-0D3CCF1E8D3D>