Merged scrub and balance loops
I could not think of a good reason why I separated these, and it takes less time if they are in the same loop, so I merged them together
This commit is contained in:
parent
433dc2d9e7
commit
2952b54717
1 changed files with 2 additions and 9 deletions
|
@ -13,27 +13,20 @@ done
|
|||
PARTITIONS=($(echo ${PARTITIONS[@]} | tr ' ' '\n' | sort -u | tr '\n' ' '))
|
||||
|
||||
# Reallocate blocks that are less than 95% used
|
||||
# Scrub all partitions
|
||||
for i in ${PARTITIONS[@]}; do
|
||||
{
|
||||
echo "Starting balance on $i"
|
||||
btrfs balance start -dusage=95 "$i"
|
||||
echo "Finished balance on $i"
|
||||
} &
|
||||
done
|
||||
|
||||
# Wait for balance operations to finish
|
||||
wait
|
||||
|
||||
# Scrub all partitions
|
||||
for i in ${PARTITIONS[@]}; do
|
||||
{
|
||||
echo "Starting scrub on $i"
|
||||
btrfs scrub start -B "$i"
|
||||
echo "Finished scrub on $i"
|
||||
} &
|
||||
done
|
||||
|
||||
# Wait for scrub operations to finish
|
||||
# Wait for all operations to finish
|
||||
wait
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue