This is an old revision of the document!
IMPORTANT:
do not run with an old kernel! jessie 3.16 is TOO OLD - crashes and rebootloops when balancing!!
install 4.0 from jessie backports https://backports.debian.org/Instructions/
COW is not good for small files like database files:
disable it for a directory:
chattr -R +C /var/lib/mysql
check:
lsattr /var/lib/
balance reorders metadata - use after a lot data has changed or disc was full:
fast:
btrfs fi balance start -dusage=5 /
good:
btrfs bal start -v -dusage=51 /
..watch the process:
btrfs bal stat /
weekly cron “fsck”:
btrfs scrub start -c3 /
defrag and compress:
btrfs fi defrag -v -r -czlib /home/backup
or set mount-option “autodefrag”
remove dups:
duperemove FIXME
If btrfs runs on a md raid or in raid mode, you can disable the metadata duplication for better performance
btrfs bal start -v -f -mconvert=single -sconvert=single /
or re-enable them
btrfs bal start -v -f -mconvert=dup -sconvert=dup /
the computer may get slow and even freeze up! altough df shows free space :-0
only this shows the real free space:
btrfs fi df /home/
see, if the device was full:
btrfs filesystem show
if the device was full, reorder chunks - kind of defrag:
btrfs fi balance start -dusage=5 /home/