if the -a option isn't passed, -H might report a failing disk as
'PASSED' even when the disk might be in a corrupted state.

Signed-off-by: Oguz Bektas <o.bek...@proxmox.com>
---
 PVE/Diskmanage.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 64bb813..d3c3365 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -95,8 +95,9 @@ sub get_smart_data {
            or die "failed to get nvme controller device for $disk\n");
     }
 
-    my $cmd = [$SMARTCTL, '-H'];
-    push @$cmd, '-A', '-f', 'brief' if !$healthonly;
+    my $cmd = [$SMARTCTL];
+    push @$cmd, '-H' if $healthonly;
+    push @$cmd, '-a', '-A', '-f', 'brief' if !$healthonly;
     push @$cmd, $disk;
 
     eval {
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to