The case for BCacheFS inclusion in PVE

alexskysilk

Distinguished Member
Oct 16, 2015
3,052
1,235
243
Chatsworth, CA
www.skysilk.com
PVE has (and continues to have) a large presence in the homelab/self hosting crowd. The Primary filesystem option employed for single host applications was and is ZFS, due to its robust featureset and code maturity. Yet ZFS's core structural geometry—fixed virtual device (vdev) layouts, rigid pool topologies, and bolt-on workarounds like RAIDZ expansion or special vdevs—shows strain when modern single-node servers mix NVMe, SATA SSDs, and high-capacity hard drives. Btrfs aimed for a Linux-native copy-on-write alternative with features like in-place defragmentation and out-of-band deduplication, and supports more RAID levels than striped mirrors alone, but its multi-device parity modes have long carried reliability caveats that keep serious storage users away from RAID5/6 on critical data.

Bcachefs offers a fundamentally different single-node model. Using B-tree allocation, per-path replication or erasure coding (EC), multi-tier caching and promotion/demotion, and flexible disk pooling, it lets a single namespace adapt to mixed drive capacities and speeds without forcing rigid vdev boundaries. Consider a single PVE host with two NVMe drives, two SATA SSDs, and eight hard drives. With ZFS today, you typically split storage across distinct pools or vdevs—such as mirrored NVMe or SSDs for virtual disks and RAIDZ2 on the hard drives for bulk data- and you must accept fixed vdev sizing rules. With bcachefs, you can keep a unified namespace where virtual machine subvolumes use replication with fast NVMe/SSD tiering while bulk media or backup subvolumes use erasure coding backed by HDDs and flash caching, all within one storage pool.

BCacheFS design criteria seems to be purpose made for single node PVE. Its actually more flexible and capable then ceph as long as the failiure domain remains lower then host- BUT it is not yet a turnkey, zero-quirk replacement for ZFS on live virtual disks. Out-of-tree kernel status (following its removal from mainline Linux in 6.18), background tiering and erasure-coding overhead under heavy VM I/O, and snapshot, subvolume, and discard/TRIM edge cases still require thorough validation. Still, out-of-tree status did not stop ZFS from becoming standard on PVE; Proxmox's own willingness to integrate and test ZFS helped mature it into a reliable hypervisor option. Adopting bcachefs as a supported PVE storage backend—starting as an experimental target and hardening it against real hypervisor workloads—is the clearest path to turning its architectural promise into peak single-node storage.
 
  • Like
Reactions: Gavino
My biggest issue with CoW filesystems is in relation to dirty bitmaps. QEMU keeps its persistent dirty bitmap in the qcow2 v3 disk image file. You shouldn't run qcow2 on a CoW FS like ZFS because of write amplification from CoW on CoW. So for my ZFS-based VMs I use are "raw" format, and the dirty bitmap for that is not persistent - every reboot I have to do another full backup of the VM (which sucks). So I only use ZFS for "small" (sub 100GB) VMs, and anything bigger I put on a ext4 RAID array and use qcow2 so that the dirty bitmap persists between reboots.

BTRFS and BcacheFS have "nocow" modes which would probably allow one to run qcow2 disk images, but then I think you give up checksums, scrubs and in-line compression. I don't know how well tested those modes are. BcacheFS is the better of the two for its much better multi-disk support.

I don't know what's technically possible, but would love for QEMU devs to work with Kent Overstreet to have a "raw" disk format for BcacheFS, but where the dirty bitmap has support at the filesystem level so that it survives reboots, and with checksumming and compression all supported by the FS. That would be an absolute game-changer.
 
My biggest issue with CoW filesystems is in relation to dirty bitmaps. QEMU keeps its persistent dirty bitmap in the qcow2 v3 disk image file. You shouldn't run qcow2 on a CoW FS like ZFS because of write amplification from CoW on CoW.
I dont think anyone wants to do this on any filesystem. FWIW I dont think neither PVE nor PBS use the persistent dirty bitmap feature for anything.

every reboot I have to do another full backup of the VM (which sucks).
Complain to the devs. I imagine their thinking is something to the effect of a guest interruption is a rare event, and full read/delta reconstruct is a fair tradeoff. Better yet- if you're using a CoW filesystem you have a superior mechanism for this anyway- snapshot based differentials. and on that subject- this is actually a place where bcachefs is behind as the snapshot send/receive functionality isnt built yet.
BTRFS and BcacheFS have "nocow" modes
BTRFS does. BCacheFS doesnt.

but then I think you give up checksums, scrubs and in-line compression.
Correct.

I don't know what's technically possible, but would love for QEMU devs to work with Kent Overstreet to have a "raw" disk format for BcacheFS, but where the dirty bitmap has support at the filesystem level so that it survives reboots, and with checksumming and compression all supported by the FS. That would be an absolute game-changer.
I think your evaluation of the "problem" is massively overblown. The workarounds (both PBS and snapshots) mean that this isnt a missing feature- its just the difference between the occasional faster differential copy ON QCOW2 which no one would use if they could help it for the reasons you yourself mentioned- no checksums, scrubs and in-line compression. Its also slower.

@fabian thanks- I think Kent explained the upside better then me :) its been over a year since the last post on that thread, and the filesystem reached stable status. just sayin.
 
Given the release of the kernel.org based 7.3 series of kernels, one could use DKMS and a plugin to add support for bcachefs outside of Proxmox if it was so desired.

This would mirror the efforts we've seen recently for network based storage systems.
 
Oh without a doubt- and you aren't limited to 7.3 either; one could use it without integration for, well, since release.

My suggestion is not only to add a storage plugin (which would be relatively trivial since its virtually the same as the btrfs plugin, and I think someone already did it) but to INCLUDE it with PVE- with all the testing, qualification, and code QC and improvement that entails.

--edit yep; https://forum.proxmox.com/threads/bcachefs-storage-plugin-for-proxmox-ve.185030/#post-870159
 
Last edited:
but to INCLUDE it with PVE- with all the testing, qualification, and code QC and improvement that entails.
Yeah, and for that, I think there would first need to be significant demand from business customers for BScacheFS, because all that testing and QC creates additional work that ultimately someone has to pay for.

For that demand to exist in the first place, BScacheFS would need to prove itself to be a stable and reliable file system in the long term. After all, we're talking about a file system here. This is an area where businesses and vendors tend to be even more conservative than with other technologies, using something that has proven itself over a long time and works reliably and predictably, rather than the latest "cool" thing.

For businesses, reliability and predictability are often more important than achieving a one-percent performance boost or getting some fancy new feature. Just look at how long BTRFS has been around before it slowly started making its way onto production servers and commercial appliances such as Synology. And even today, it only has a moderate share of the overall enterprise storage market.
 
Last edited:
  • Like
Reactions: Johannes S and UdoB
its been over a year since the last post on that thread, and the filesystem reached stable status. just sayin.
Does this mean that's again included in the kernel? Imho it's enough work to maintain the integration of one ouf-of-tree filesystem (ZFS), I don't see any benefit in maintaining two.
 
Yeah, and for that, I think there would first need to be significant demand from business customers for BScacheFS, because all that testing and QC creates additional work that ultimately someone has to pay for.
As I pointed out at the initial post, a large percentage of deployments are NON enterprise. I wholeheartedly agree with your sentiment, and without enterprise (read:potential revenue generating) demand its a hard sell. That said, the Proxmox team did build in BTRFS support despite it having less of a benefit over zfs.

Just look at how long BTRFS has been around before it slowly started making its way onto production servers and commercial appliances such as Synology.
I would argue that Synology doesnt make enterprise aimed products. or that btrfs serves much purpose for that use case. I'd further argue that single host filesystems are no longer suitable for the enterprise at all.

Does this mean that's again included in the kernel? Imho it's enough work to maintain the integration of one ouf-of-tree filesystem (ZFS), I don't see any benefit in maintaining two.
It doesnt. to the contrary; having a dkms loaded filesystem is to the benefit of an integrated product such as PVE since regression is easier to check with an easily removable/insertable component.
 
That said, the Proxmox team did build in BTRFS support despite it having less of a benefit over zfs.
Well, but compared to BCacheFS, it's been around for quite a few years longer and has seen some corporate use, so I'd say it's probably more mature and battle-tested.

I would argue that Synology doesnt make enterprise aimed products. or that btrfs serves much purpose for that use case. I'd further argue that single host filesystems are no longer suitable for the enterprise at all.
Yes, but at least they sell commercial devices with Btrfs. BTW, they also offer larger rack systems aimed at SMEs, many of which are probably roughly in the same ballpark in terms of size as many Proxmox "Enterprise" subscription customers.

But, yeah, by "Enterprise" in this context, I simply mean businesses that pay for Proxmox subscriptions, not necessarily actual enterprises with 10,000+ employees or Fortune 100 companies. ;)

It doesnt. to the contrary; having a dkms loaded filesystem is to the benefit of an integrated product such as PVE since regression is easier to check with an easily removable/insertable component.
That sounds almost a bit like making excuses and trying to sugarcoat things. ;) But yeah, at the end of the day, you don't have to convince me, and I don't really have anything against them officially supporting it either. Quite the opposite, actually: I'm generally all for having more options.

I just wanted to offer a possible explanation as to why BCacheFS might not be a top priority for Proxmox as a company. After all, homelabbers and small companies that don't pay for a subscription aren't exactly the ones who keep the lights on at Proxmox Solutions GmbH, are they? ;)
 
Last edited:
I just wanted to offer a possible explanation as to why BCacheFS might not be a top priority for Proxmox as a company.
I dont think there is an argument to make it a top priority. It doesnt meaningfully solve any problem that exists today. Your point is exactly right; the audience for this is not likely to buy a subscription. My point is that as long as the homelabber audience is a meaningful audience at all, this is a very attractive option- and the intended consequence is that development of the file system would have an additional driver for effective integration with PVE. Full disclosure- I wouldnt actually use this in production anyway, but I'm not the target audience.

That sounds almost a bit like making excuses and trying to sugarcoat things.
zfs is dkms loaded. it works and works well. I dont really see the necessity of kernel inclusion as a driving factor, and was just making the point that it makes integration easier and not harder (regression does not require changing kernels and vice versa.)