Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2022 18:55:46 +0200
From:      Michael Gmelin <grembo@freebsd.org>
To:        Toomas Soome <tsoome@me.com>
Cc:        FreeBSD User <freebsd@walstatt-de.de>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: ZFS: cannot import zroot: I/O error
Message-ID:  <59A72011-3EEC-4A16-B328-977C7C27CB18@freebsd.org>
In-Reply-To: <7B040730-5115-4BC9-A45A-53FA2145810C@me.com>
References:  <7B040730-5115-4BC9-A45A-53FA2145810C@me.com>

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

--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 <tsoome@me.com> wrote:
>=20
> =EF=BB=BF
>=20
>> On 15. Aug 2022, at 18:01, FreeBSD User <freebsd@walstatt-de.de> 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

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><br><blockquote type=3D"cite">On 15. Aug 2022, at 18=
:22, Toomas Soome &lt;tsoome@me.com&gt; wrote:<br><br></blockquote></div><bl=
ockquote type=3D"cite"><div dir=3D"ltr">=EF=BB=BF<meta http-equiv=3D"Content=
-Type" content=3D"text/html; charset=3Dutf-8"><br class=3D""><div><br class=3D=
""><blockquote type=3D"cite" class=3D""><div class=3D"">On 15. Aug 2022, at 1=
8:01, FreeBSD User &lt;<a href=3D"mailto:freebsd@walstatt-de.de" class=3D"">=
freebsd@walstatt-de.de</a>&gt; wrote:</div><br class=3D"Apple-interchange-ne=
wline"><div class=3D""><div class=3D"">Hello,<br class=3D""><br class=3D"">I=
'm running a FreeBSD 13.1-RELENG-p1 zroot-based guest in a VirtualBox 4.1.24=
/26 (do not know<br class=3D"">exactly). The host is a special system based o=
n Linux und VirtualBox and I have no chances to<br class=3D"">configure the V=
Box.<br class=3D""><br class=3D"">Somehow the VBox crashed and hung up the c=
omplete computer, so I had to cold start it after<br class=3D"">approx. 30 m=
inutes of waiting. After that, rhe virtual drive and its ZFS filesystem was<=
br class=3D"">wrecked, shwing a stream of <br class=3D""><br class=3D"">zio_=
read error: 5<br class=3D"">ZFS: i/o error - all block copies unavailable<br=
 class=3D""><br class=3D"">After a quick search I found some advices howto t=
ry fixing, last an longest one was <br class=3D""><br class=3D"">zpool impor=
t -fFX -N -R /alternate/path zroot<br class=3D""><br class=3D"">which took a=
pprox 20 minutes - with no success.<br class=3D""><br class=3D"">There are s=
ome valuable data on the partition, which are all backed up, but it would ta=
ke its<br class=3D"">time to restore everything, so I'd like to ask whether t=
here is any cance to "repair" the<br class=3D"">mysterious damage.<br class=3D=
""><br class=3D"">I'm able to boot off from an USB flash drive =E2=80=A6<br c=
lass=3D""><br class=3D""></div></div></blockquote><div><br class=3D""></div>=
<div>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!). &nbsp;See also&nbsp;<a href=3D"https://gist.=
github.com/mkhon/34d979c78077a20648456272d7f2cc15" class=3D"">https://gist.g=
ithub.com/mkhon/34d979c78077a20648456272d7f2cc15</a></div><div><br></div></d=
iv></div></blockquote><br><div>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:</div><div><span style=3D"caret-color: rgb(0, 0,=
 0); color: rgb(0, 0, 0);"><br></span></div><div>&nbsp; &nbsp;&nbsp;<span st=
yle=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">VBoxManage setextrad=
ata VM-name</span><span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0,=
 0);">&nbsp;</span>&nbsp; "VBoxInternal/Devices/ahci/0/LUN#[0]/Config/Ignore=
Flush" 0</div><div><br></div><div>or</div><div><br></div><div>&nbsp; &nbsp; V=
BoxManage setextradata VM-name "VBoxInternal/Devices/piix3ide/0/LUN#[x]/Conf=
ig/IgnoreFlush" 0</div><div><br></div><div>See also:&nbsp;<a href=3D"https:/=
/www.virtualbox.org/manual/ch12.html#ts_ide-sata-flush">https://www.virtualb=
ox.org/manual/ch12.html#ts_ide-sata-flush</a></div><div><br></div><div>It=E2=
=80=99s highly recommended for ZFS in case your VM isn=E2=80=99t a throwaway=
 CI thing.</div><div><br></div><div>Best</div><div>Michael</div><div><br></d=
iv><div><br></div></body></html>=

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59A72011-3EEC-4A16-B328-977C7C27CB18>