suspend/resume versus OpenZFS on USB

From: Graham Perrin <grahamperrin_at_gmail.com>
Date: Fri, 4 Sep 2020 00:42:00 +0100
This week for the first time I toyed with OpenZFS on a USB device: a 
mobile hard disk drive connected to the dock of an HP EliteBook 8570p.

A light test, with the pool imported but not writing to the dataset at 
suspend time.

At resume time (22:31), the device was still physically connected but 
the pool suffered an I/O failure (and the keyboard and trackball on USB 
were unusable).

Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11239]: vdev state changed, 
pool_guid=$8076233369858608335 vdev_guid=$13893535540375859253
Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11243]: pool I/O failure, 
zpool=$Transcend error=$28
Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11247]: pool I/O failure, 
zpool=$Transcend error=$28
Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11251]: pool I/O failure, 
zpool=$Transcend error=$28
Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11255]: pool I/O failure, 
zpool=$Transcend error=$28
Sep  3 22:31:03 momh167-gjp4-8570p ZFS[11259]: catastrophic pool I/O 
failure, zpool=$Transcend

I cleared pool errors (after which the keyboard and trackball became 
usable), exported the pool, physically disconnected the drive, restarted 
the OS, reconnected, imported and – luckily – cleared the remaining 
metadata errors through a scrub.

Please, might something be done to improve suspend/resume reliability 
with storage on USB?

Might I/O failures be less likely if I connect the drive to the notebook 
instead of its dock?

TIA

----

More from /var/log/messages at https://pastebin.com/CqRYbFZm

Other relevant info below.

root_at_momh167-gjp4-8570p:~ # date ; uptime ; uname -v
Thu Sep  3 22:45:07 BST 2020
10:45PM  up 6 mins, 6 users, load averages: 0.20, 0.27, 0.13
FreeBSD 13.0-CURRENT #63 r364768: Tue Aug 25 20:08:23 BST 2020 
root_at_momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG
root_at_momh167-gjp4-8570p:~ # zpool status -v
   pool: copperbowl
  state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
         still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
         the pool may no longer be accessible by software that does not 
support
         the features. See zpool-features(5) for details.
   scan: scrub repaired 0B in 01:39:31 with 0 errors on Thu Sep  3 
01:12:21 2020
config:

         NAME          STATE     READ WRITE CKSUM
         copperbowl    ONLINE       0     0     0
           ada0p4.eli  ONLINE       0     0     0

errors: No known data errors
root_at_momh167-gjp4-8570p:~ # zpool import Transcend && zfs load-key 
Transcend/VirtualBox
Enter passphrase for 'Transcend/VirtualBox':
root_at_momh167-gjp4-8570p:~ # zpool status -v Transcend
   pool: Transcend
  state: ONLINE
status: One or more devices has experienced an error resulting in data
         corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
         entire pool from backup.
    see: https://zfsonlinux.org/msg/ZFS-8000-8A
   scan: scrub repaired 0B in 00:15:33 with 0 errors on Wed Sep  2 
22:38:56 2020
config:

         NAME        STATE     READ WRITE CKSUM
         Transcend   ONLINE       0     0     0
           da0p1     ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

         <metadata>:<0x0>
         <metadata>:<0x3d>
root_at_momh167-gjp4-8570p:~ # zpool scrub Transcend
root_at_momh167-gjp4-8570p:~ # zfs version
zfs-0.8.0-1
zfs-kmod-0.8.0-1
root_at_momh167-gjp4-8570p:~ # zpool status -v Transcend
   pool: Transcend
  state: ONLINE
   scan: scrub repaired 0B in 00:17:53 with 0 errors on Thu Sep  3 
23:03:57 2020
config:

         NAME        STATE     READ WRITE CKSUM
         Transcend   ONLINE       0     0     0
           da0p1     ONLINE       0     0     0

errors: No known data errors
root_at_momh167-gjp4-8570p:~ # zfs get 
compression,compressratio,encryption,used,referenced,mountpoint 
Transcend Transcend/VirtualBox
NAME                  PROPERTY       VALUE SOURCE
Transcend             compression    zstd                      local
Transcend             compressratio  1.70x                     -
Transcend             encryption     off default
Transcend             used           76.4G                     -
Transcend             referenced     76.4G                     -
Transcend             mountpoint     /Volumes/t500             local
Transcend/VirtualBox  compression    zstd inherited from Transcend
Transcend/VirtualBox  compressratio  1.00x                     -
Transcend/VirtualBox  encryption     aes-256-gcm               -
Transcend/VirtualBox  used           200K                      -
Transcend/VirtualBox  referenced     200K                      -
Transcend/VirtualBox  mountpoint     /Volumes/t500/VirtualBox inherited 
from Transcend
root_at_momh167-gjp4-8570p:~ # ls -hl 
/Volumes/t500/VirtualBox/Windows/Windows.vdi
-rw-------  1 grahamperrin  grahamperrin    69G Sep  3 16:58 
/Volumes/t500/VirtualBox/Windows/Windows.vdi
root_at_momh167-gjp4-8570p:~ # du -hs 
/Volumes/t500/VirtualBox/Windows/Windows.vdi
  36G    /Volumes/t500/VirtualBox/Windows/Windows.vdi
root_at_momh167-gjp4-8570p:~ #
Received on Thu Sep 03 2020 - 21:42:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:25 UTC