thenonsense Posted December 5, 2019 Share Posted December 5, 2019 Hi all, I'm trying to understand something about Btrfs and how it tracks its multiple copies of files. I have a couple scenarios and I'm tryting to understand how COW resolves with them: A file is put onto the file system by User A. User B updates the file. What differentiates User A from User B? How is data chosen (original vs updated) to present to User A or B? What about User C, who has seen neither original nor updated variant? A library, or video game, or even a git repo is put onto the file system. That library / game / repo receives an update 2 weeks later. Large amounts of edits may be made, so does this rapidly consume storage? A file is updated/deleted by User A. How does that file get updated/deleted in the original, so that User B either sees the new version or no file at all? I'd appreciate if someone could explain to me some of these items or point me in a direction that helps to explain. I've been over wikipedia a couple times, and devouring stackoverflow, but I'm still not seeing clear answers to my questions, likely out of not understanding the answers. Quote Link to comment
JorgeB Posted December 6, 2019 Share Posted December 6, 2019 Not sure what you are asking exactly, for that purpose a COW filesystem works as any other, once a file is modified any user will only see the new version of that file, only if you have snaphosts (or reflinks) you can access previous versions. Quote Link to comment
thenonsense Posted December 6, 2019 Author Share Posted December 6, 2019 I figured it out. I had expected CoW to be a lot more intensive than it actually is. It's not. Copies of files are implicitly made only when a file is copied and then one of those copies is modified upon. I expected some copy-in-place transactional craziness that versioned files as they were modified, and didn't care if a copy was made previously. I'm confident I'm not explaining my original point of view well, but that's because it was pretty stupid to begin with. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.