Skip to content

Instantly share code, notes, and snippets.

@arm2arm
Created April 6, 2021 15:59
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arm2arm/a3c61958472fbed2e0c9ea4800146534 to your computer and use it in GitHub Desktop.
Save arm2arm/a3c61958472fbed2e0c9ea4800146534 to your computer and use it in GitHub Desktop.
rebalance zfs for the cold data
# If you change some settings in the zfs dataset you should rebalance it in order to store data with this current settings.
# Usage:
# zfs set recordsize=1M data/archive
# sh ./rebalance_zfs.sh /data/archive| parallel -P 16 --eta
mypath=$1
find $mypath -type f | xargs -d '\n' -I{} echo "rsync -a --inplace \"{}\" \"{}.abcdef\";unlink \"{}\";mv \"{}.abcdef\" \"{}\" "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment