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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] > On 15. Aug 2022, at 18:22, Toomas Soome <tsoome@me.com> wrote: > > > >> On 15. Aug 2022, at 18: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 on Linux und VirtualBox and I have no chances to >> configure the VBox. >> >> Somehow the VBox crashed and hung up the complete computer, so I had to cold start it after >> approx. 30 minutes of waiting. After that, rhe virtual drive and its ZFS filesystem was >> 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 try fixing, last an longest one was >> >> zpool import -fFX -N -R /alternate/path zroot >> >> which took approx 20 minutes - with no success. >> >> There are some valuable data on the partition, which are all backed up, but it would take its >> time to restore everything, so I'd like to ask whether there is any cance to "repair" the >> mysterious damage. >> >> I'm able to boot off from an USB flash drive … >> > > This happens when vbox is telling zfs that data is written on disk, but is actually still in caches… So yea, the standard answer could be “restore from backup”, but it also may help to use ability to revert TXG (it does drop data!). See also https://gist.github.com/mkhon/34d979c78077a20648456272d7f2cc15 > While it might not help the requester with the problem at hand, this situation 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]/Config/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’s highly recommended for ZFS in case your VM isn’t a throwaway CI thing. Best Michael [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On 15. Aug 2022, at 18:22, Toomas Soome <tsoome@me.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 15. Aug 2022, at 18:01, FreeBSD User <<a href="mailto:freebsd@walstatt-de.de" class="">freebsd@walstatt-de.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello,<br class=""><br class="">I'm running a FreeBSD 13.1-RELENG-p1 zroot-based guest in a VirtualBox 4.1.24/26 (do not know<br class="">exactly). The host is a special system based on Linux und VirtualBox and I have no chances to<br class="">configure the VBox.<br class=""><br class="">Somehow the VBox crashed and hung up the complete computer, so I had to cold start it after<br class="">approx. 30 minutes of waiting. After that, rhe virtual drive and its ZFS filesystem was<br class="">wrecked, shwing a stream of <br class=""><br class="">zio_read error: 5<br class="">ZFS: i/o error - all block copies unavailable<br class=""><br class="">After a quick search I found some advices howto try fixing, last an longest one was <br class=""><br class="">zpool import -fFX -N -R /alternate/path zroot<br class=""><br class="">which took approx 20 minutes - with no success.<br class=""><br class="">There are some valuable data on the partition, which are all backed up, but it would take its<br class="">time to restore everything, so I'd like to ask whether there is any cance to "repair" the<br class="">mysterious damage.<br class=""><br class="">I'm able to boot off from an USB flash drive …<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>This happens when vbox is telling zfs that data is written on disk, but is actually still in caches… So yea, the standard answer could be “restore from backup”, but it also may help to use ability to revert TXG (it does drop data!). See also <a href="https://gist.github.com/mkhon/34d979c78077a20648456272d7f2cc15" class="">https://gist.github.com/mkhon/34d979c78077a20648456272d7f2cc15</a></div><div><br></div></div></div></blockquote><br><div>While it might not help the requester with the problem at hand, this situation can be prevented (or at least made less likely) by disabling "IgnoreFlush" - depending on the virtual device emulated this could be something like:</div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div> <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">VBoxManage setextradata VM-name</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> </span> "VBoxInternal/Devices/ahci/0/LUN#[0]/Config/IgnoreFlush" 0</div><div><br></div><div>or</div><div><br></div><div> VBoxManage setextradata VM-name "VBoxInternal/Devices/piix3ide/0/LUN#[x]/Config/IgnoreFlush" 0</div><div><br></div><div>See also: <a href="https://www.virtualbox.org/manual/ch12.html#ts_ide-sata-flush">https://www.virtualbox.org/manual/ch12.html#ts_ide-sata-flush</a></div><div><br></div><div>It’s highly recommended for ZFS in case your VM isn’t a throwaway CI thing.</div><div><br></div><div>Best</div><div>Michael</div><div><br></div><div><br></div></body></html>help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59A72011-3EEC-4A16-B328-977C7C27CB18>
