Files
webgui/plugins/dynamix/scripts/btrfs_balance
Tom Mortensen 04ac51eda5 Provide control to initiate btrfs balance on btrfs-formatted array devices and single cache device.
Remove preset btrfs balance options; btrfs-raid1 is default only for initial creation of multi-device pool.
DeviceInfo shows all check/balance/scrub operations but greyed out depending on arry started state.
2017-03-30 09:08:50 -07:00

20 lines
420 B
Bash
Executable File

#!/bin/bash
# btrfs_balance start <dev> <options>
# btrfs_balance status <dev>
# btrfs_balance cancel <dev>
case "$1" in
'start')
options=$3
[[ -z "${options// }" ]] && options="--full-balance"
exec /sbin/btrfs balance start $options $2 &>/dev/null &
;;
'status')
/sbin/btrfs balance status $2
/sbin/btrfs balance status $2 | grep -q running
;;
'cancel')
/sbin/btrfs balance cancel $2 &>/dev/null
;;
esac