zfs problems after rebuilding system

Dimitry Andric dim at FreeBSD.org
Sat Mar 3 00:23:21 UTC 2018


On 3 Mar 2018, at 01:09, Freddie Cash <fjwcash at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20180303/6828170c/attachment.sig>


More information about the freebsd-fs mailing list