From ccd43fefc1a18a28d36d9e79d0b95691dc87fad4 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:22:29 +0100 Subject: [PATCH] Keep trimming when pct fstrim fails on one container pct fstrim exits 255 when the container is locked, for example while a backup runs ("CT is locked (backup)"). Under errexit the command substitution ended the whole run there, before the output check below it and before the remaining containers, and telemetry filed it as "DPKG: Fatal internal error". Print the result and go on instead. --- tools/pve/fstrim.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pve/fstrim.sh b/tools/pve/fstrim.sh index b63b4267c..baf8daf36 100644 --- a/tools/pve/fstrim.sh +++ b/tools/pve/fstrim.sh @@ -118,7 +118,8 @@ function trim_container() { fi local fstrim_output - fstrim_output=$(pct fstrim "$container" 2>&1) + # pct fstrim fails on a locked CT (e.g. a running backup); report it and go on. + fstrim_output=$(pct fstrim "$container" 2>&1) || true if echo "$fstrim_output" | grep -qi "not supported"; then echo -e "${RD}fstrim isnt supported on this storage!${CL}" elif echo "$fstrim_output" | grep -Eq '([0-9]+(\.[0-9]+)?\s*[KMGT]?B)'; then