ZFS / cache=writeback / safe ?

Why shouldn't you prefer the default way of doing things in the software you use? If you don't trust in their choice, why should you run the software at all?
 
i also set the cache to write-back, after a crash i lost some data.
i have proxmox 7. why?
 
Last edited:
i also set the cache to write-back, after a crash i lost some data.
In my understanding that's expected behavior.
The "write-back"-mechanism just tells your application that data has been written - while in fact it is not!
 
  • Like
Reactions: Neobin
i also set the cache to write-back, after a crash i lost some data.
i have proxmox 7. why?

cache=writeback
  • host page cache is used as read & write cache
  • guest disk cache mode is writeback
  • Warning: you can lose data in case of a power failure
  • You need to use the barrier option in your Linux guest's fstab if kernel < 2.6.37 to avoid FS corruption in case of power failure.
This mode causes qemu-kvm to interact with the disk image file or block device with neither O_DSYNC nor O_DIRECT semantics, so the host page cache is used and writes are reported to the guest as completed when placed in the host page cache, and the normal page cache management will handle commitment to the storage device. Additionally, the guest's virtual storage adapter is informed of the writeback cache, so the guest would be expected to send down flush commands as needed to manage data integrity. Analogous to a raid controller with RAM cache.
https://pve.proxmox.com/wiki/Performance_Tweaks#Disk_Cache
 
  • Like
Reactions: wifi75
in fact I have lost data during a power lost, what should I set just so that it does not happen again?
 
Default and recommended is "none" as caching mode for your VMs when using ZFS. ZFS will use its ARC as read cache anyways, so no need to cache the same data multiple times in RAM.
And you can always lose data on an power outage, when not forcing every async write to be handled as a sync write, as your hosts RAM and the RAM cache of all HDDs and consumer SSDs will loose the cached async writes. Thats why you should always run your server with an UPS. They don't cost that much, starting at 50€ for something usable. By far the cheapest option to minimize data loss if you compare that to buying alot of enterprise grade hardware like ECC RAM, enterprise SSDs, redundant PSUs, HW raid with cache and BBU, ... . And don't forget to set up something like NUT, so the server will do a automatic graceful shutdown in case of an power outage.
 
Last edited: