From nobody Mon Aug 15 16:55:46 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M60lp6rfrz4ZTB3 for ; Mon, 15 Aug 2022 16:55:50 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M60lp02DZz3wYW; Mon, 15 Aug 2022 16:55:49 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id a51536c5; Mon, 15 Aug 2022 16:55:47 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 5e5bfb83 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 15 Aug 2022 16:55:47 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-E6C51BB4-32DC-4764-977E-79E905C6B41A Content-Transfer-Encoding: 7bit List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: ZFS: cannot import zroot: I/O error From: Michael Gmelin In-Reply-To: <7B040730-5115-4BC9-A45A-53FA2145810C@me.com> Date: Mon, 15 Aug 2022 18:55:46 +0200 Cc: FreeBSD User , FreeBSD CURRENT Message-Id: <59A72011-3EEC-4A16-B328-977C7C27CB18@freebsd.org> References: <7B040730-5115-4BC9-A45A-53FA2145810C@me.com> To: Toomas Soome X-Mailer: iPhone Mail (19G71) X-Rspamd-Queue-Id: 4M60lp02DZz3wYW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 213.239.217.29 is neither permitted nor denied by domain of grembo@freebsd.org) smtp.mailfrom=grembo@freebsd.org X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FREEMAIL_TO(0.00)[me.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[grembo]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_SOFTFAIL(0.00)[~all]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail-E6C51BB4-32DC-4764-977E-79E905C6B41A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On 15. Aug 2022, at 18:22, Toomas Soome wrote: >=20 > =EF=BB=BF >=20 >> On 15. Aug 2022, at 18:01, FreeBSD User wrote: >>=20 >> Hello, >>=20 >> I'm running a FreeBSD 13.1-RELENG-p1 zroot-based guest in a VirtualBox 4.= 1.24/26 (do not know >> exactly). The host is a special system based on Linux und VirtualBox and I= have no chances to >> configure the VBox. >>=20 >> Somehow the VBox crashed and hung up the complete computer, so I had to c= old start it after >> approx. 30 minutes of waiting. After that, rhe virtual drive and its ZFS f= ilesystem was >> wrecked, shwing a stream of=20 >>=20 >> zio_read error: 5 >> ZFS: i/o error - all block copies unavailable >>=20 >> After a quick search I found some advices howto try fixing, last an longe= st one was=20 >>=20 >> zpool import -fFX -N -R /alternate/path zroot >>=20 >> which took approx 20 minutes - with no success. >>=20 >> There are some valuable data on the partition, which are all backed up, b= ut it would take its >> time to restore everything, so I'd like to ask whether there is any cance= to "repair" the >> mysterious damage. >>=20 >> I'm able to boot off from an USB flash drive =E2=80=A6 >>=20 >=20 > This happens when vbox is telling zfs that data is written on disk, but is= actually still in caches=E2=80=A6 So yea, the standard answer could be =E2=80= =9Crestore from backup=E2=80=9D, but it also may help to use ability to reve= rt TXG (it does drop data!). See also https://gist.github.com/mkhon/34d979c= 78077a20648456272d7f2cc15 >=20 While it might not help the requester with the problem at hand, this situati= on can be prevented (or at least made less likely) by disabling "IgnoreFlush= " - depending on the virtual device emulated this could be something like: VBoxManage setextradata VM-name "VBoxInternal/Devices/ahci/0/LUN#[0]/C= onfig/IgnoreFlush" 0 or VBoxManage setextradata VM-name "VBoxInternal/Devices/piix3ide/0/LUN#[x]= /Config/IgnoreFlush" 0 See also: https://www.virtualbox.org/manual/ch12.html#ts_ide-sata-flush It=E2=80=99s highly recommended for ZFS in case your VM isn=E2=80=99t a thro= waway CI thing. Best Michael --Apple-Mail-E6C51BB4-32DC-4764-977E-79E905C6B41A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On 15. Aug 2022, at 18= :22, Toomas Soome <tsoome@me.com> wrote:

=EF=BB=BF

On 15. Aug 2022, at 1= 8:01, FreeBSD User <= freebsd@walstatt-de.de> wrote:

Hello,

I= 'm running a FreeBSD 13.1-RELENG-p1 zroot-based guest in a VirtualBox 4.1.24= /26 (do not know
exactly). The host is a special system based o= n Linux und VirtualBox and I have no chances to
configure the V= Box.

Somehow the VBox crashed and hung up the c= omplete computer, so I had to cold start it after
approx. 30 m= inutes of waiting. After that, rhe virtual drive and its ZFS filesystem was<= br class=3D"">wrecked, shwing a stream of

zio_= read error: 5
ZFS: i/o error - all block copies unavailable
After a quick search I found some advices howto t= ry fixing, last an longest one was

zpool impor= t -fFX -N -R /alternate/path zroot

which took a= pprox 20 minutes - with no success.

There are s= ome valuable data on the partition, which are all backed up, but it would ta= ke its
time to restore everything, so I'd like to ask whether t= here is any cance to "repair" the
mysterious damage.

I'm able to boot off from an USB flash drive =E2=80=A6


=
This happens when vbox is telling zfs that data is written on disk, but= is actually still in caches=E2=80=A6 So yea, the standard answer could be =E2= =80=9Crestore from backup=E2=80=9D, but it also may help to use ability to r= evert TXG (it does drop data!).  See also https://gist.g= ithub.com/mkhon/34d979c78077a20648456272d7f2cc15


While it might not help the requester with th= e problem at hand, this situation can be prevented (or at least made less li= kely) by disabling "IgnoreFlush" - depending on the virtual device emulated t= his could be something like:

    VBoxManage setextrad= ata VM-name   "VBoxInternal/Devices/ahci/0/LUN#[0]/Config/Ignore= Flush" 0

or

    V= BoxManage setextradata VM-name "VBoxInternal/Devices/piix3ide/0/LUN#[x]/Conf= ig/IgnoreFlush" 0


It=E2= =80=99s highly recommended for ZFS in case your VM isn=E2=80=99t a throwaway= CI thing.

Best
Michael


= --Apple-Mail-E6C51BB4-32DC-4764-977E-79E905C6B41A--