> On 15. Aug 2022, at 18:22, Toomas Soome <tso...@me.com> wrote:
> 
> 
> 
>> On 15. Aug 2022, at 18:01, FreeBSD User <free...@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


Reply via email to