Difference between revisions of "Btrfs"

m
m (→‎btrfsck: Check spelling)
m (→‎additional Information: Check Spelling)
Line 154: Line 154:
<small>Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.</small>
<small>Please be aware that the information on this page is a simplified version of the reality. Is is written to make the reader understand a little of these complex things. To get an in depth understanding it will be neccesary to read further at btrfs.wiki.kernel.org or other places.</small>


= additional Information =
= Additional Information =
=== why not btrfs ? ===
=== Why not btrfs ? ===
A lot of people say: "'''I don't use btrfs because''' it is experimental and is '''not stable'''. You can´t use it in production. It is not safe!".
A lot of people say: "'''I don't use btrfs because''' it is experimental and is '''not stable'''. You can´t use it in production. It is not safe!".


==== not stable ? ====
==== Not stable ? ====
The status of btrfs was experimental for a long time, but the the core functionality is considered '''good enough for daily use'''. <small>(from kernel.org)</small>
The status of btrfs was experimental for a long time, but the the core functionality is considered '''good enough for daily use'''. <small>(from kernel.org)</small>


If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give btrfs a chance, you have to look for newer statements. Maybe even look at btrfs.wiki.kernel.org there sure is the best information regarding btrfs
If you see statements declaring Btrfs as not stable, please look for the date of them. Some seem to date from 10 years ago. So if you want to give Btrfs a chance, you have to look for newer statements. Maybe even look at [https://btrfs.wiki.kernel.org Btrfs Kernel Wiki] as that sure is the best information regarding Btrfs


==== experimental ? ====
==== Experimental ? ====
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.<small>(from kernel.org)</small>
Btrfs is feature-rich! There are new features being implemented and these should be considered experimental for a few releases when the bugs get ironed out when number of brave users help stabilizing it.<small>(from kernel.org)</small>


Some features are '''not implemented yet'''. Others are only '''partly implemented'''. Some are '''experimental''' and not suggested for production use. As is always the case in Linux-land ''you'' decide what to use, and so you are responsible for your own decisions.
Some features are '''not implemented yet'''. Others are only '''partly implemented'''. Some are '''experimental''' and not suggested for production use. As is always the case in Linux-land ''you'' decide what to use, and so you are responsible for your own decisions.


==== not usable for production ? ====
==== Not usable for production ? ====
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem  
* [https://btrfs.wiki.kernel.org/index.php/Getting_started#Distro_support Distro support] for Btrfs as main filesystem  
* Some firms do use btrfs in production@wiki.btrfs.kernel.org
* Some companies do use Btrfs in production@wiki.btrfs.kernel.org
* Some manufacturers do deploy devices where btrfs is used inside
* Some manufacturers do deploy devices where Btrfs is installed by default.


==== difficult to repair ? ====
==== Difficult to repair ? ====
Indeed when you search for the usual ways to repair a file system like FAT or Ext4 then you don't find good information. But this is not because it is difficult to repair btrfs, but because repairing btrfs '''does work very different'''.
Indeed, when you search for the usual ways to repair a file system like FAT or Ext4 then you don't find good information. But this is not because it is difficult to repair Btrfs, but because repairing Btrfs '''does work very differently'''.


== What's this "Copy on Write" ==
== What's this "Copy on Write" ==
When you want to get the most out of using btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. btrfs is not difficult,l but different to some extend.
When you want to get the most out of using Btrfs you do need to know some things about this file system. Then you are able to use it properly and to your advantage. Btrfs is not difficult, but different to some extend.


=== write in place (FAT32) ===
=== Write in place (FAT32) ===
Most file systems did write "in place". This means that some data or metadata will be written "over" the previous data at the same place.  
Most older file systems do write "in place". This means that some data or metadata will be written "over" the previous data at the same place.  


For example this is the case for FAT32 file systems. The '''F'''ile '''A'''llocation '''T'''able is at a fixed place on this file system. When the "FAT" changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as bevor. When the disk is ejected bevor(or while) this data is written, the file system will be corrupted. And the FAT does change a lot.
For example this is the case for FAT32 file systems. The '''F'''ile '''A'''llocation '''T'''able is at a fixed place on this file system. When the "FAT" changes (because a file got bigger and needs more blocks), this new FAT must be written with the new data to the same place as before. When the disk is ejected before (or while) this data is written, the file system will be corrupted. And the FAT does change a lot.


The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.
The danger of corruption is especially big while metadata (like filename, permission, usage of disk space ...) is being written.


=== write to a metadata-log (Ext4) ===
=== Write to a metadata-log (Ext4) ===
There is a solution to this with newer file systems like Ext4. Instead of writing metadata "in place", metadata is written into an "endless" log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.
There is a solution to this with newer file systems like Ext4. Instead of writing metadata "in place", metadata is written into an "endless" log. Then it is not possible to be corrupted while overwritten. This is possible because metadata is only a very small part of the data in a file system.


Line 204: Line 204:
* 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
Moderators, translator
286

edits