Skip to content

Instantly share code, notes, and snippets.

@lanefu
Created August 6, 2020 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanefu/98d5799a6f8ca0bbba0ef03fa0225ffd to your computer and use it in GitHub Desktop.
Save lanefu/98d5799a6f8ca0bbba0ef03fa0225ffd to your computer and use it in GitHub Desktop.
btrfs progressive balance
#!/bin/bash
diskpath=/
echo before
btrfs filesystem usage ${diskpath}
for i in 0 5 10 15 20 25 30 40 50 60 70 80 90 100
do
echo "${0}: Running with ${i}%"
btrfs filesystem usage ${diskpath}
sudo btrfs balance start -dusage=$i -musage=$i ${diskpath}
done
echo after
btrfs filesystem usage ${diskpath}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment