From owner-freebsd-current@freebsd.org Fri Sep 4 08:02:01 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 753593DA429 for ; Fri, 4 Sep 2020 08:02:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BjVWW3jmqz4g1c for ; Fri, 4 Sep 2020 08:01:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 54C2D2602B8; Fri, 4 Sep 2020 10:01:57 +0200 (CEST) Subject: Re: suspend/resume versus OpenZFS on USB To: Graham Perrin , FreeBSD Current References: From: Hans Petter Selasky Message-ID: <6824e9f5-0496-a9ba-9cf2-01a6c8b34a4e@selasky.org> Date: Fri, 4 Sep 2020 10:01:30 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BjVWW3jmqz4g1c X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.62 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.99)[-0.994]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.30)[-0.300]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.02)[-1.022]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 08:02:01 -0000 On 2020-09-04 01:42, Graham Perrin wrote: > 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@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@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG > root@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@momh167-gjp4-8570p:~ # zpool import Transcend && zfs load-key > Transcend/VirtualBox > Enter passphrase for 'Transcend/VirtualBox': > root@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: > >         :<0x0> >         :<0x3d> > root@momh167-gjp4-8570p:~ # zpool scrub Transcend > root@momh167-gjp4-8570p:~ # zfs version > zfs-0.8.0-1 > zfs-kmod-0.8.0-1 > root@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@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@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@momh167-gjp4-8570p:~ # du -hs > /Volumes/t500/VirtualBox/Windows/Windows.vdi >  36G    /Volumes/t500/VirtualBox/Windows/Windows.vdi > root@momh167-gjp4-8570p:~ # > We need output from "procstat -akk" to see where ZFS/USB is hanging. --HPS