Difference between revisions of "Btrfs"

Warning included
(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 Write! (Btrfs)===
Copy on write is a "new" concept. This means the file system will try to '''never''' write over existing data. '''How is this possible?'''
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
* Management of space is complex
* there are 2 sorts of pages
* 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
* 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
* 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
* 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?
** 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
** 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
** Only the newly written data may be partly damaged
** the metadata may also 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
** 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
** 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
** Snapshots
** RAID
** RAID
** volume management
** Volume management
** compression
** Compression
** encryption (maybe some time in the future)
** 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! =
translator
987

edits