At long last - reflink is done
Added 2019-08-21 17:28:01 +0000 UTCFor 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? :)
2019-10-03 14:43:29 +0000 UTCOK, I *assumed* so, but figured it good to verify. :)
Phil Stracchino
2019-08-22 00:24:30 +0000 UTCThe metadata is all extents, not per block - but it is block granularity copy on write, so yes.
Kent Overstreet
2019-08-22 00:14:14 +0000 UTCOne 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
2019-08-22 00:02:33 +0000 UTCYEAH! Great work there! Keep up with it! I'm rooting for this file system! I wish I had time to actually code it
brunoais
2019-08-21 20:38:48 +0000 UTCAwesome. 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
2019-08-21 19:13:38 +0000 UTC