translator
1,001
edits
(Warning included) |
(Warning included) |
||
Line 193: | Line 193: | ||
This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely. | This does protect the file system itself, but not the files in it. Because a file may be overwritten in place, and then the old file is lost, and the new one may not have been written completely. | ||
=== | === Copy on Write! (Btrfs)=== | ||
Copy on | 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" | * Files are appended at the end of a "data page" | ||
* Metadata is appended at a "metadata page" | * Metadata is appended at a "metadata page" | ||
Line 201: | Line 201: | ||
* Deleting a file does not write/clean its data, but writes metadata, that marks this file as deleted | * 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 "data page", then writes the metadata for this file | * Overwriting a file does first append the new file to the "data page", then writes the metadata for this file | ||
* 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 | * there are checksums for data and metadata | ||
==== downsides ==== | ==== downsides ==== | ||
* | * Management of space is complex | ||
* | * There are 2 sorts of pages | ||
* | * There has to be a clean-up-process who makes the space of deleted files reusable, so that the disk does not run out of free pages | ||
* | * It must be avoided to write data unnecessarily, because then the clean-up would also be very expensive | ||
==== chances ==== | ==== chances ==== | ||
* | * It is possible to detect nearly any corruption because of the checksums | ||
** | ** When the power is lost, or the disk is disconnected, all old data is save. WHY? | ||
** | ** Every bit of "old" data from before the power loss or the disconnection is present because it is NOT overwritten | ||
** | ** Only the newly written data may be partly damaged | ||
** | ** The metadata may also be partly damaged | ||
** | ** When mounting the volume it is possible by analysing checksums and metadata to find the point in the file system where all was good | ||
** | ** Btrfs will automatically roll back to this point, then it can mount the file system writeable | ||
* CoW is a sound foundation to build upon | * CoW is a sound foundation to build upon | ||
** | ** Snapshots | ||
** RAID | ** RAID | ||
** | ** Volume management | ||
** | ** Compression | ||
** | ** Encryption (maybe some time in the future) | ||
{{BoxWarning|Don´t disable CoW in Btrfs|It is possible to disable CoW in Btrfs. But then you '''loose all benefits''' of Btrfs. It won´t even make checksums. If you don't like CoW, then you better use another filesystem}} | |||
= Use the Forum! = | = Use the Forum! = |