From c8bbf5a3f4d0a4667c1b5701c607d323914fd27b Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Thu, 7 Jan 2021 14:43:15 +0100 Subject: [PATCH] Added note about snapshots --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bb787a..b7b8113 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,14 @@ and have a look at difference of the `CAP` value (`SIZE`/`FREE` vs `ALLOC` ratio Due to the working principle of this script, which essentially creates a duplicate file on purpose, deduplication will most definitely prevent it from working as intended. If you use deduplication you probably have to resort to a more expensive rebalancing method that involves additional drives. -### Data selection +### Data selection (cold data) Due to the working principle of this script, it is crucial that you **only run it on data that is not actively accessed**, since the original file will be deleted. +### Snapshots + +If you do a snapshot of the data you want to balance before starting the rebalancing script, keep in mind that ZFS now has to keep track of all of the data in the target directory twice. Once in the snapshot you made, and once for the new copy. This means that you will effectively use double the file size of all files within the target directory. Therefore it is a good idea to process the pool data in badges and remove old snapshots along the way, since you probably will be hitting the capacity limits of your pool at some point during the rebalancing process. + ## Installation Since this is a simple bash script, there is no package. Simply download the script and make it executable: @@ -103,6 +107,12 @@ sudo su ./zfs-inplace-rebalancing.sh --checksum true --passes 1 /pool/path/to/rebalance ``` +To keep track of the balancing progress, you can open another terminal and run: + +``` +watch zpool list -v +``` + ### Things to consider Although this script **does** have a progress output (files as well as percentage) it might be a good idea to try a small subfolder first, or process your pool folder layout in manually selected badges. This can also limit the damage done, if anything bad happens.