Difference between revisions of "Btrfs"

m
→‎volume: Check spelling
m (→‎volume: Check spelling)
Line 45: Line 45:
= Parts of Btrfs =
= Parts of Btrfs =


== volume ==
== Volume ==
A pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID.  
A pool of raw storage. Consists of one or more devices. The size of the volume will be the addition of all included devices, unless you use RAID.  


If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UID).
If you do use more then one device, please also read the section about RAID. You are able to add/remove devices at any time. With adding/removing devices it is also possible to move a volume from one device to another (without changing the UID).


Usually you do not mount the btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume itself.Then you are able to change the volume layout. All (writable)subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.
Usually you do not mount the Btrfs volume itself, but you mount subvolumes. There may be times when it is practical to mount the Btrfs volume itself.Then you are able to change the volume layout. All (writeable) subvolumes inside a volume are movable inside the volume with mv. Moving subvolumes will not touch the data, but change the volume layout in an instant.


When not otherwise specified, additionall devices are handeled as a '''B'''unch '''o'''f '''D'''isks. this mean
When not otherwise specified, additional devices are handled as '''J'''ust a '''B'''unch '''o'''f '''D'''isks (JBOD); this means
{{Info|In most cases it is advisable to use only one Btrfs volume}}  
{{Info|In most cases it is advisable to use only one Btrfs volume}}  
=== subvolume ===
=== subvolume ===


=== snapshot ===
=== snapshot ===
A snapshot looks nearly the same as a subvolume. But snapshots really are "readonly photographs of a subvolume". While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.
A snapshot looks nearly the same as a subvolume. But snapshots really are "read-only photographs of a subvolume". While the subvolume changes with time. The snapshot is frozen in the state of the subvolume at the time you made it.
A snapshot is readonly. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. {{BoxWarning|where to place snapshots|When creating snapshots you have to watch out for the volume layout in use}}
A snapshot is read-only. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. {{BoxWarning|where to place snapshots|When creating snapshots you have to watch out for the volume layout in use}}


Taking a snapshot is '''very fast''', and '''nearly priceless'''. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additional all created or modified files since the last snapshot and so on. If you don´t release(delete) any snapshot you will eventually run out of space soon(disk full)
Taking a snapshot is '''very fast''', and '''nearly priceless'''. After the snapshot is taken, all future writes will go as in CoW usual. But none of the space occupied by files in the snapshot will be reusable. As you write more and more new files the filesystem will grow because it can not reuse the files in the snapshot. A new snapshot will freeze additional all created or modified files since the last snapshot and so on. If you don´t release(delete) any snapshot you will eventually run out of space soon(disk full)


Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. But to free some space, Btrfs has to test for every file in the snapshot, wehter it is in use, or it is not. If it is not, the space of this file/version will be freed.(This is greatly simplified) Therefore it is '''costly to remove snapshots'''. And btrfs will do this work in the background. You may notice this, because when you delete a snaphot there will be '''no immediate gain in freed space'''. After a while you will notice that some space was freed.  
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. But to free some space, Btrfs has to test for every file in the snapshot, whether it is in use, or it is not. If it is not, the space of this file/version will be freed.(This is greatly simplified) Therefore it is '''costly to remove snapshots'''. And Btrfs will do this work in the background. You may notice this, because when you delete a snapshot there will be '''no immediate gain in freed space'''. After a while you will notice that some space was freed.  


Snapshots (if regularly made) may be used for:
Snapshots (if regularly made) may be used for:
Line 87: Line 87:


=== quotas ===
=== quotas ===
Quota support in Btrfs is implemented at subvolume level.
Quota support in Btrfs is implemented at the subvolume level.


For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]
For more info see [https://btrfs.wiki.kernel.org/index.php/Quota_support Quota_support@btrfs.kernel.org]
Moderators, translator
286

edits