Translations:Btrfs/122/en
Copy on Write! (Btrfs)
Copy on Write is a "new" concept. It means the file system will try to never write over existing data. How is this even possible?
- Files are appended at the end of a "data page"
- Metadata is appended at a "metadata page"
- Inside a page nothing is ever overwritten
- When a page is full the file system will use the next free page
- Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted
- Overwriting a file does first append the new file to the actual "data page", then appends the metadata for this file to the "metadata page".
- Changing small parts of a file will write only the new parts, then link the rest to the old file
- there are checksums for data and metadata