XaiJu
bcachefs
bcachefs

patreon


At long last - reflink is done

For those who aren't familiar with the idea - reflink means using shared, reference counted extents to do "shallow copies" - copies that share data transparently on disk, but are copy on write (unlike hardlinked files).

To use it, just use cp --reflink. It's great for virtual machine images, and you can also use it like snapshots - e.g. "cp -a --reflink foo foo-$(date -I)". It's not as good as real snapshots because creating the pseudo-snapshot isn't atomic and is more expensive than creating a real snapshot would be (we still have to walk and copy all the metadata), but I imagine for a lot of purposes it'll be good enough.

Have fun!

Comments

Yay! Was just reading changelog of Postgres 12. They now have --clone on pg_upgrade which claims to use this feature. They didn't advertise bcachefs there though. I'm running postgres on top of bcache hdd+nvme, for non-critical stuff. Would you recommend switching that into bcachefs? :)

OK, I *assumed* so, but figured it good to verify. :)

Phil Stracchino

The metadata is all extents, not per block - but it is block granularity copy on write, so yes.

Kent Overstreet

One quick question — when you do update the reflinked file, is it block-by-block copy-on-write? Update only one block, copy only one block?

Phil Stracchino

YEAH! Great work there! Keep up with it! I'm rooting for this file system! I wish I had time to actually code it

brunoais

Awesome. I use this a lot when I am on btrfs so for bcachefs to support it too just ticks one more box for me. Keep up the great work. Thanks!

veritanuda

Woohoo! Congratulations!


More Creators