Skip to content

Instantly share code, notes, and snippets.

@dominicusin
Last active September 25, 2017 22:30
Show Gist options
  • Save dominicusin/a51a8688929c7ec81f53b79eb398694c to your computer and use it in GitHub Desktop.
Save dominicusin/a51a8688929c7ec81f53b79eb398694c to your computer and use it in GitHub Desktop.
btrfs optimisation
for filesystem in $(mount -t btrfs | awk '{print $3}' )
do
mount -o remount,clear_cache $filesystem
btrfs balance start -v -f --full-balance -dconvert=single,usage=99 -mconvert=single,usage=99 -sconvert=single,usage=99 $filesystem
btrfs filesystem defragment -v -r -czlib -f $filesystem
btrfs scrub start -BdRf $filesystem
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment