Difference between revisions of "Btrfs Maintenance"
Views
Actions
Namespaces
Variants
Tools
(Starting point) |
(1st steps) |
||
Line 5: | Line 5: | ||
<!-- Example titles --> | <!-- Example titles --> | ||
= Btrfs Maintenance = | |||
== Btrfs needs no maintenance == | |||
This even may be true, when: | |||
* You always keep 10% of your volume unallocated | |||
I do not say "free", because free does mean nothing with btrfs. The value you have to watch most is "unallocated" ! | |||
==== Why this is wrong ==== | ==== Why this is wrong ==== | ||
Every filesystem needs some maintenance. | |||
Some filesystems do an automatic chkfs at every XX. mount | |||
Others need the user to do a chkfs manually. On most you have to watch not to fill them to 100%. Some reserve 5% for root. | |||
Some filesystems need to be defragmented. Others do not. | |||
'''Every filesystem has its own needs and tools !''' | |||
== Automatic maintenance == | |||
Btrfs does some maintenance automatically. | |||
=== Is the Volume in a clean state === | |||
At mount btrfs tests wether the volume is in a clean stat. | |||
==== not clean ==== | |||
If the computer suddenly loses power, transactions may not or only partially be written to the volume. Btrfs attempts to bring the volume to a clean state by removing the last (uncompleted) action. This may mean losing the last changes you made before turning off. But you gain a clean file system that doesn't need to be repaired. | |||
==== error ==== | |||
The filesystem will be mounted readonly | |||
==== clean ==== | |||
btrfs will mount the subvolume read write. | |||
<!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting --> | <!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting --> | ||
Revision as of 16:44, 26 January 2023
Btrfs Maintenance
Btrfs needs no maintenance
This even may be true, when:
- You always keep 10% of your volume unallocated
I do not say "free", because free does mean nothing with btrfs. The value you have to watch most is "unallocated" !
Why this is wrong
Every filesystem needs some maintenance.
Some filesystems do an automatic chkfs at every XX. mount Others need the user to do a chkfs manually. On most you have to watch not to fill them to 100%. Some reserve 5% for root. Some filesystems need to be defragmented. Others do not.
Every filesystem has its own needs and tools !
Automatic maintenance
Btrfs does some maintenance automatically.
Is the Volume in a clean state
At mount btrfs tests wether the volume is in a clean stat.
not clean
If the computer suddenly loses power, transactions may not or only partially be written to the volume. Btrfs attempts to bring the volume to a clean state by removing the last (uncompleted) action. This may mean losing the last changes you made before turning off. But you gain a clean file system that doesn't need to be repaired.
error
The filesystem will be mounted readonly
clean
btrfs will mount the subvolume read write.
Example codes should be here.
See Also
Btrfs Learn basics about btrfs