Skip to content

Commit

Permalink
Added note about snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel authored Jan 7, 2021
1 parent da3a6cb commit c8bbf5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c8bbf5a

Please sign in to comment.