TRIM: skip BTRFS devices which do not support trim

This commit is contained in:
bergware
2023-03-22 10:58:00 +01:00
parent 20bdc80a9f
commit 045dcc8699

View File

@@ -79,7 +79,7 @@ foreach ($mounts as $mount) {
if (is_hdd($source)) continue;
write("$target: ... <i class='fa fa-spin fa-circle-o-notch'></i>\r");
$trim = exec("fstrim -v $target 2>/dev/null");
if ($trim) write("$trim on $source\r","\n");
if ($trim) write("$trim on $source\r","\n"); else write("\r");
}
// trim zfs
zfs_trim(true);