311 points · by frankjr · 2y ago · 113 comments
https://github.com/maharmstone/btrfs?tab=readme-ov-file#dona...
When in Rome do as the Romans do. Maybe we should only run windows virtualized :)
See his other repo, he appears to be working on that. https://github.com/maharmstone/quibble
I mean, they can't admit to reading it. But that source code is out there since the leak isn't it?
It'd be so fracking sweet to see filesystems follow this pattern. If we could re-use the file system logic, but apply it to windows or fuse or Linux or wasm linearly-addressed-storage, that would allow such intensely cool forms of portability/reuse & bending/hacking.
https://sans-io.readthedocs.io/
I did it for one of my Rust projects back in 2018 https://github.com/Arnavion/k8s-openapi/commit/9a4fbb718b119... , and it's older than that in Python land.
Cory Benfield - Building Protocol Libraries The Right Way https://youtu.be/7cC3_jGwl_U
But isn't this just good old inversion of control, modularity with maybe some inspiration from Functional Programming. Or even more generally, good Software architecture and engineering?
Anyway, I'm very happy to see this, the more code is architected this way, the better for all our industry.
Not to join in too much on the "but we already had this!" bandwagon ... but actually to join in the bandwagon - we had these sorts of patterns in C 20 years ago. I worked with a TLS implementation like this sometime around 2005.
Either you work with buffer-in/buffer-out types of scenario, or you register callbacks to do the real IO.
It's a great pattern and means that you can do stuff like change transport mechanism, or put in proxying, or whatever you want really, without having to change the library.
With embedded C stuff it was also relatively common to handle memory allocation this way - buy in a library that does whatever proprietrary thing you need from a vendor, then register your custom allocator with it so when it needed heap memory, you could provide that in line with whatever platform restrictions you had going.
Wonder how well it scales to larger applications. Ie is there a codesize where io-less becomes too difficult? Perhaps performance concerns? Hmm
Also, quite the opposite, it's *easier* to design a library this way because it's strictly less code the library needs to contain. Specifically in Rust it also has the advantage that the library becomes agnostic to sync vs async I/O since that's handled by the library user. Correspondingly, it is slightly harder for the library user to use such a library, but it's usually just a matter of writing a tiny generic wrapper around the network socket type to connect it to the library functions.
ReactOS is supposed to be API-compatible with Windows, so that's not too surprising.
WinBtrfs – A Windows driver for the next-generation Linux filesystem Btrfs - https://news.ycombinator.com/item?id=15177002 - Sept 2017 (100 comments)
WinBtrfs v0.7 - https://news.ycombinator.com/item?id=12794214 - Oct 2016 (1 comment)
Anyone contemplating use and rattled about data corruption etc on btrfs partitions and drives, focus on mount options in README
1. use `Ignore` for (arch)linux system partition 2. use `Readonly` for everything else
That being said, I never faced cpu spikes/corruption using the driver on 20TB external HDD with complete btrfs zstd:2 compression mount
The author answers all the questions I've had - and much more!
Winbtrfs only says the raid5 mode is one of the features, but doesn't really address how well it works. The questions in a related issue (https://github.com/maharmstone/btrfs/issues/293) have been closed without real answers. I wouldn't risk raid 5/6 on it without getting good answers about the status / testing from the developers first.
I’m not taking anything away from the effort that has gone into producing this. Just being realistic about the amount of effort that is required to create a production ready file system driver.
I recall reading somewhere recently, that the Linux btrfs developer intends to fix these edge cases through a on-disk layout change (IIRC, adding one more btree to the filesystem). So unless this driver already has that on-disk layout change, it's unlikely that these edge cases have been addressed.
Here's some Arch documentation about it, basically you just create a btrfs on top of multiple devices and it works (to some extent with raid5/raid6 as well): https://wiki.archlinux.org/title/Btrfs#Multi-device_file_sys... . Raid1 apparently works fine.
So if you want raid5/6, deploying on top of md is the better option.
This could be the first FS that just-works across nix, Mac and windows since fat.
Anyone using this long term or in production who can comment on how it's been working?
I see TRIM is supported. Is RETRIM also (or whatever is needed during drive optimization to release areas that didn't get TRIMmed the first time due to a full command queue).
Could this serve as an effective NTFS replacement with data parity for those who don't like ReFS?
How mature is it compared to ZFS on Windows?
I don’t use it often, but when I do I don’t even notice it. It’s as if Windows could just natively read btrfs all along. This was without any “advanced” usage beyond simply accessing, modifying, or deleting files.
"Win OpenZFS driver and WinBtrfs driver dont play well with each other"
From what I’ve heard, BTRFS has a crazy long list of defects where it’ll lock up or corrupt data if you so much as look at it wrong.[1]
Using something that is unreliable at best on its native OS shoehorned into Windows is madness. Fun for a lark, sure, but I would never ever entrust this combination with any actual data.
[1] “It works for me on my two disk mirror” is an anecdote, not data.
While that statement might well be correct that the quote is in fact an anecdote, the following is also an anecdote: ‘From what I’ve heard, BTRFS has a crazy long list of defects where it’ll lock up or corrupt data if you so much as look at it wrong.’
For me I decided to not touch it anymore after that experience. I'm sure there is a name for that bias but I don't care. Got burned badly. Lots of people had probably similar experiences and that's were that coming from. Reading the mailing list archives at that time might also be useful to convince yourself that it was more than anecdote.
The list cannot be crazy long if Synology uses it for their NASes.
Synology uses a hybrid BTRFS+mdadm arrangement specifically to deal with reliability problems with BTRFS RAID: https://kb.synology.com/en-us/DSM/tutorial/What_was_the_RAID...
https://kb.synology.com/tr-tr/DSM/help/ActiveBackup/activeba...
One example: If you (accidentally or on purpose) attach a ReFS disk or LUN to a newer Windows version, it will be silently upgraded to a new ReFS version without any feedback (or chance to prevent it) for the user. No way of attaching the disk on an older Windows version afterwards. But that is not the real problem. The real problem is that the upgrade runs as a separate (user-space) process. If this process crashes or your PC crashes or reboots while it runs, your data is gone. There is no feedback how long it still has to run (we've seen multiple days on large volumes)
So yeah, maybe avoid ReFS for a few more years...
That is rather useful in backup systems.
XFS also supports reflinks amongst other things and is way older than ReFS and hence considered out of beta (which ReFS isn't, by me)
I don't trust data to RefS yet - its a fun project that will no doubt prove itself one day. For now, Windows boxes run NTFS and Linux runs ext4 or XFS.
Also if you turn on data checksums, my understanding is it will delete any file that gets a corrupted sector. And you can only override this behavior on a per-file basis. Unless this changed very recently?
https://www.microsoft.com/en-us/windows/business/compare-win...
For what it’s worth, regular Windows 10 & 11 Pro (and other editions maybe?) have supported reading and writing ReFS this whole time. It’s just the option to create a new volume that’s been disabled.
I tried ReFS when it first came out and it was terribly slow (with data parity on), and Storage Spaces was obscure to set up and manage. Has the landscape improved?
In practice it works out pretty decently in my experience using it with windows 10 daily for a while, with a few caveats:
1. You need a stable usb connection
2. You need a usb drive enclosure with a controller chip that is stable/doesn’t overheat
3. Your drive should be powerless resistant. Unfortunately there’s no resource I know of that evaluates power loss handing. Some drives will have a bad time having power suddenly cut. I’ve had good experience with Intel enterprise sata SSD’s and NVMe drives in a Dockcase with capacitor. If your drive stops showing up, a power cycle might help: https://dfarq.homeip.net/fix-dead-ssd/
4. Have automatic backups setup.
Very useful for performance testing and hardware firmware updates that are windows only.
When switching between computers, I’ll often have to boot, windows gets confused and then reboot. After that it works.
However, I have no experience trying to make use of WinBTRFS or the separate bootloader project, which is apparently currently broken since a few months ago.
Ventoy booting a windows VHD file might also be a decent option
I've got a testing install of Windows on my main hard drive that boots from VHDX for these reasons
Hardware RAID is worth the money when uptime and performance are important. I've seen good RAID cards keep a server running where native direct SATA would have brought the server down.
The advantages were always theoretical and the disadvantages were always real. It caused way more problems than it solved or prevented, and the problems are worse because you are essentially powerless to address them.
With software raid you have the control to address problems even when you fall off the happy path, and infinite flexibility wrt hardware and emergency recovery.
In macro, hardware raid is less reliable, not more. Performance is no better than a draw, not better.
With software RAID, you can just plug the disks into other servers without those kinds of problems.
I think this is no longer true. Software RAID is now better in almost every way, including performance.
I would love to see that the new version works with fewer problems.
The chocolatey package for WinBtrfs: https://community.chocolatey.org/packages/winbtrfs
ZFS seems to be the most cross-platform of the modern filesystems. Although there's a Paragon driver for APFS for Windows and a FOSS driver for native Linux APFS as well as one for FUSE.
Personally, I keep track of bcachefs which got merged in Linux 6.7. But it won't be cross-platform.
... is:
"The COW filesystem for Linux that won't eat your data".
This is, IMHO, a dig at Btrfs, which is famous for recovery problems. Btrfs doens't have a working reliable `fsck` replacement or a working `df` command which gives reliable results.
So, bcachefs aims to be better than Btrfs and that's a low bar to clear.
It's "better" than ZFS because it's GPL and designed to do the same as ZFS but be integrated into the Linux kernel, which ZFS can't be because its license doesn't allow it.
For this it merely needs to equal ZFS' features and functions, not exceed them.
When is the year of the btrfs file system coming?
The issue is that btrfs still does not run perfectly rock solid on raid other than 0 and 1.
Plus it's compression and performance is still far off what alternatives can provide (but this is also getting better).