[pve-devel] [PATCH container] fix #3917: Ignore fstrim failure in pct fstrim

Markus Frank m.frank at proxmox.com
Fri Mar 11 12:59:57 CET 2022


With "noerr => 1" the function does not abort, when one of the
mountpoints is not fstrim compatible like zfs (has its own trim).
I do not think it is necessary to warn or error, because fstrim 
tells when something is not trimmable and aborts.

Signed-off-by: Markus Frank <m.frank at proxmox.com>
---
 src/PVE/CLI/pct.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 462917b..23793ee 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -792,7 +792,7 @@ __PACKAGE__->register_method ({
 		$path = $mp->{mp};
 		return if $param->{'ignore-mountpoints'} && $name =~ /^mp\d+/;
 		my $cmd = ["fstrim", "-v", "$rootdir$path"];
-		PVE::Tools::run_command($cmd);
+		PVE::Tools::run_command($cmd, noerr => 1);
 	    });
 	};
 	warn $@ if $@;
-- 
2.30.2






More information about the pve-devel mailing list