I cannot stress enough: NTFS is not a CoW filesystem, any attempt to add CoW features on top of it will be poorly performant and doomed to fail, because they actually have to copy the old data blocks when you overwrite something. ZFS, btrfs, et al. are not actually copying user-data, because they don't have a concept of "ovewriting a block," every block that is written is written to unallocated regions of the disk; blocks that are not referenced by a dataset or snapshot are then returned to the allocator for later use; at no point is the old data "copied", it's just "not returned to the allocator for reuse."
What btrfs or ZFS mean by "copying" is not the user's data blocks, it's copying filesystem metadata, portions of btrfs' extent tree, or ZFS' block pointer tree. There is a world of difference between volume shadow copy, and an actual CoW filesystem. -- Microsoft knows this, that's why they are working on ReFS. (Of course in typical MSFT fashion they've made a number of critical mistakes: user data checksums are optional, and volume management is not integrated so it can't even use those integrity streams to self-heal corruption. Also last I checked ReFS can't even be used as a bootable Windows volume. -- It's worth pointing out APFS also made the mistake of checksumming metadata but not user data; which in my opinion makes both of them unsuitable as next generation filesystems.)
Unless you just so happen to be writing over an entire block, then there still must be a copy happening. The old data, less the bytes you modified, must be written into the new block along with your changed bytes.
It's not perfect, but it works, the major downsides are:
- Granularity is at the volume level, so you get a lot more block churn in your snapshots. I mitigate this by trying to separate the "OS" volume and "Data" volume to the extent Windows will let me.
- If you're doing any heavy lifting on top of the ZVOL that expects sync writes (e.g: MS SQL) its performance will degrade slightly. Anecdotally I find this to be negligible on my all-flash pool. Besides they sell SQL Server for Linux now ;-).
- NTFS is unaware of the snapshots, so your snapshots will be of a dirty state if the guest is running. AFAIK there's nothing like `xfs_freeze/unfreeze` that can be done in the guest to make these snapshots atomic. That being said NTFS' chkdsk is quite mature, and I've never observed this to be an issue in practice.
As far as I know Ubuntu ships with ZFS kernel module.
Unfortunately, as you undoubtedly know, ZFS support on Linux will always be a problem due to licensing.
As far as I know native encryption is not yet stable in ZFS.
Sure, and the first thing every WIN virus does is deletes the shadow copies.
What's really cool about serialized snapshots is that once native encryption support lands in ZFSonLinux you'll be able to send encrypted volumes over the wire. The data blocks don't have to be decrypted to be serialized or checked for integrity, so you don't even need the decryption key to do incremental sends! You can send your backups to an untrusted remote pool that never has to have knowledge of the decryption key!
(You can also serialize snapshots to files, which is useful for say writing them to detachable media to sneakernet them. If you want to do incremental sends though the receiver does have to be an actual zpool.)
Some other helpful hints would be using something like `mbuffer`[2] on the sender & receiver. This is handy for spinning rust pools, so that your disks don't have to wait on the network before seeking to the next blocks to be sent.
Also ZFS lets you delegate permissions so you can manage filesystems as normal users, I'd recommend doing this so you don't have to login as root on the remote pool to receive the snapshots.[3] In my case I ran into this early on because I have `PermitRootLogin no` on all my boxes.
[1]: https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux... [2]: https://dan.langille.org/2014/05/03/zfs-send-on-freebsd-over... [3]: https://dan.langille.org/2015/02/16/zfs-send-zfs-receive-as-...
Besides, msft makes money by selling SaaS. There's no financial incentive to protecting consumer data since the EULA indemnifies the company for any damages caused by their products.
You could literally remove my entire root directory and at worst you've minorly inconvenienced me: I now have to boot from a USB drive and run `zfs rollback` to the most recent snapshot. I'd be impervious to most ransomware as well: my home directory is filled w/ garbage now? Good thing it can't encrypt my read only snapshots, even with root access. Oh and I can serialize those snapshots across the network at the block level before I nuke the infected machine.
Of course humanity will always invent a bigger idiot, so it's possible a virus could gain root & exec some dangerous ZFS commands, or it's possible some MSFT employee could pass the `-r` flag and recursively delete a dataset & its snapshots in their post-update script. Plus let's not forget that no filesystem in the world will stop you from just zero-filling the drive. Still it's easy for me to imagine a world where I'm completely impervious from ransomware: by way of only being able to delete critical snapshots when a hardware key is present or when my TPM is unlocked.
On the whole it seems to me CoW filesystems are a major step forward in safe-guarding users from accidental deletions. At a minimum they have other benefits (serialized incremental send streams, block level compression & dedup, etc.) that make backups easier to manage. -- Yet I still can't boot from ReFS on Windows.