Difference between revisions of "Btrfs"

1,673 bytes added ,  2 years ago
out of space problem
(included status)
(out of space problem)
Line 185: Line 185:
= Btrfs maintenance =
= Btrfs maintenance =
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance.  
Btrfs needs maintenace like every filesystem. The more you use advanced features of btrfs, the more you have to watch for the right maintenance.  
=== fragmentation ===
=== Fragmentation ===
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). When the files are only written to, or are only read seldom, '''don't worry'''.
Files on btrfs tend to get somewhat fragmented, when they are appended or changed often. If you use a mechanical disk with slow seeks, it may be advisable to defragment some heavy used files from time to time (like once in a month). When the files are only written to, or are only read seldom, '''don't worry'''.
==== databases ====
==== Databases ====
It may be good to defragment a database if there is a ''noticeable'' slowdown when using it.
It may be good to defragment a database if there is a ''noticeable'' slowdown when using it.
==== logfiles ====
==== Logfiles ====
It may be good to defragment a logfile, if there is a ''noticeable'' slowdown when booting your system.
It may be good to defragment a logfile, if there is a ''noticeable'' slowdown when booting your system.


Line 201: Line 201:
=== merging chunks ===
=== merging chunks ===
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (> 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.
As you use your volume, you will be creating some files, deleting some, modifying some. Then some parts of the chunks are empty. But this is not a coherent space that can be easily reused. Usually this is not a problem for btrfs and will be cleaned up automatically over time. However, if space is scarce (> 80% full), it is advisable to merge free areas together. This can be done by using balance with a filter.


=== after removing a device ===
=== after removing a device ===
Line 238: Line 237:


btrfs filesystem scrub ...
btrfs filesystem scrub ...
= Solving Problems =
== Out of space ==
==== You should avoid to get out of space with btrfs! ====
Don't be stingy on storage space when creating a btrfs volume. A btrfs volume should normally only be 80% full. Then it is advisable to adjust the volume. In an emergency, 90% are okay too. But that is neither advantageous for the Btrfs volume nor for an SSD. And don't forget to include the number of snapshots you want in the bill. Manjaro is a rolling release distribution. There will be a lot of changes over time.
=== Get out of jail ===
This said, there is an '''easy way out'''. Give btrfs more space ;-)
* '''add a partition''' (for example a extern USB-Stick with 8GB) to the btrfs-volume with btrfs devive add
* From now on this usb-partition belongs to your volume! Do not boot without it. '''Do not reboot''' at all in this stage! This stick has to stay until btrfs device remove has completed.
* look for old snapshots you don´t need, remove them '''now'''
* '''or delete some files''' you do not need
* Do this until your disk will be not more then 95% full
Do not get confused if btrfs does not immediately display the vacant space. After the next step (balance) it will become visible.
* '''balance''' your volume with a filter(!)
* '''remove the added partition''' from the volume with btrfs device remove
* This will take some time ! '''Do not reboot until this step is complete'''.
* Now you may remove the USB-Stick.
=== Stay out of jail ===
* Think about how to extend the btrfs volume to '''double size'''
* seek if there is a program filling your disk
* look for snapshots !
* don’t forget to remove old snapshots (best done automatically)


= Btrfs options =
= Btrfs options =
translator
987

edits