Add BTRFS file system checking and notifications

Suppress possible errors
This commit is contained in:
bergware
2016-12-18 08:02:39 +01:00
parent cbf552d6d3
commit bfc6485bd4
+2 -2
View File
@@ -240,14 +240,14 @@ foreach ($disks as $disk) {
$item = 'pool';
if ($name=='cache' && $disk['fsType']=='btrfs') {
$attr = 'missing';
if (exec("/sbin/btrfs filesystem show {$disk['uuid']}|grep -c 'missing'")>0) {
if (exec("/sbin/btrfs filesystem show {$disk['uuid']} 2>/dev/null|grep -c 'missing'")>0) {
if (empty($saved[$item][$attr])) {
exec("$notify -e \"unRAID $text message\" -s \"Warning [$server] - Cache pool BTRFS missing device(s)\" -d \"$info\" -i \"warning\"");
$saved[$item][$attr] = 1;
}
} elseif (isset($saved[$item][$attr])) unset($saved[$item][$attr]);
$attr = 'profile';
if (exec("/sbin/btrfs filesystem df /mnt/cache|grep -c '^Data'")>1) {
if (exec("/sbin/btrfs filesystem df /mnt/cache 2>/dev/null|grep -c '^Data'")>1) {
if (empty($saved[$item][$attr])) {
exec("$notify -e \"unRAID $text message\" -s \"Warning [$server] - Cache pool BTRFS too many profiles\" -d \"$info\" -i \"warning\"");
$saved[$item][$attr] = 1;