Difference between revisions of "Btrfs"

m
kleine korrekturen
m (added link to readthedocs)
m (kleine korrekturen)
Line 114: Line 114:
Sometimes it is desired to have other '''special snapshot strategies''' (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.
Sometimes it is desired to have other '''special snapshot strategies''' (or no snapshots at all) for some parts of the filesystem. If you need this, make another subvolume.


== snapshot ==
== Snapshot ==


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 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 read-only. Therefore it is guaranteed not to change. In a snapshot you will find all files of the subvolume frozen in time. A snapshot is not a substitute for a backup! {{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. A snapshot is not a substitute for a backup! {{BoxWarning|Where to place snapshots|When creating snapshots you have to watch out for the volume layout in use}}


Snapshots (if regularly made) may be used for:
Snapshots (if regularly made) may be used for:
Line 134: Line 134:
=== Taking snapshots ===
=== Taking snapshots ===


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 additionaly 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 additionally 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)


=== Releasing snapshots ===
=== Releasing snapshots ===


Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. 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.
Deleting a snapshot does not delete any files that are actually in use by other snapshots or the subvolume they where taken from. 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 become free.(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 free space'''. After a while you will notice that some space has become free.


Don´t forget to remove snapshots, or you will get in '''"out of space" -trouble soon'''. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.
Don´t forget to remove snapshots, or you will get in '''"out of space" -trouble soon'''. Btrfs needs some free space to manage its work. If your volume is more then 80% full you have to think(fast) what to do.
Line 148: Line 148:


If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.
If you need to roll back into a snapshot you have to replace the actual subvolume by the chosen snapshot.
# '''Make a snapshot''' of the actual subvolume (for later reference)
# '''Make a snapshot(ro)''' of the actual subvolume (for later reference)
# '''Delete the subvolume''' out of its actual place
# '''Delete the subvolume''' out of its actual place
# '''Create a new subvolume''' out of the snapshot chosen for rollback
# '''Create a new subvolume(rw)''' out of the snapshot chosen for rollback
# Make this new subvolume the default (optional)
# Make this new subvolume the default (optional)
# '''Don't forget''' to remove the snapshot you made in a few days
# '''Don't forget''' to remove the snapshot you made in a few days
translator
1,001

edits