Commit e89eb607f5579e8391f0ce630c498c11880cba3d
1 parent
3a244ae1
Using same stats command with sudo
Showing
1 changed file
with
2 additions
and
2 deletions
check_btrfs/check_btrfs.sh
@@ -7,7 +7,7 @@ function smart_disks() { | @@ -7,7 +7,7 @@ function smart_disks() { | ||
7 | fi | 7 | fi |
8 | 8 | ||
9 | POOL=$1 | 9 | POOL=$1 |
10 | - DISKS=$(btrfs device stats / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u) | 10 | + DISKS=$(sudo btrfs device stats -c / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u) |
11 | ERR_OUTPUT="" | 11 | ERR_OUTPUT="" |
12 | HIGHEST_RES=0 | 12 | HIGHEST_RES=0 |
13 | for disk in $DISKS; do | 13 | for disk in $DISKS; do |
@@ -50,7 +50,7 @@ function pool_errors() { | @@ -50,7 +50,7 @@ function pool_errors() { | ||
50 | return 3 | 50 | return 3 |
51 | fi | 51 | fi |
52 | 52 | ||
53 | - OUTPUT="$(btrfs device stats -c $1)" | 53 | + OUTPUT="$(sudo btrfs device stats -c $1)" |
54 | STATUS=$? | 54 | STATUS=$? |
55 | 55 | ||
56 | if [[ $STATUS != 0 ]]; then | 56 | if [[ $STATUS != 0 ]]; then |