From e635afe6ff643860f7ffeb17bb5a09ee6866875e Mon Sep 17 00:00:00 2001 From: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com> Date: Thu, 19 Nov 2026 08:28:32 +0000 Subject: [PATCH] NAS backup: unmount the backup repository after a stopped VM backup backup_stopped_vm() never unmounted the repository, so every backup of a stopped VM left a /tmp/csbackup.* mount on the KVM host. Unmount and remove the mount point once the sizes are printed. A failed unmount is logged and does not fail the completed backup. --- scripts/vm/hypervisor/kvm/nasbackup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/vm/hypervisor/kvm/nasbackup.sh b/scripts/vm/hypervisor/kvm/nasbackup.sh index 8999ede1c019..9f6993064d63 100755 --- a/scripts/vm/hypervisor/kvm/nasbackup.sh +++ b/scripts/vm/hypervisor/kvm/nasbackup.sh @@ -801,6 +801,10 @@ backup_stopped_vm() { sync ls -l --numeric-uid-gid $dest | awk '{print $5}' + + # The backup is complete at this point, so a failed unmount is logged and does not fail it. + umount "$mount_point" 2>>"$logFile" || { log "WARNING: umount of $mount_point failed"; true; } + rmdir "$mount_point" 2>>"$logFile" || { log "WARNING: rmdir of $mount_point failed"; true; } } delete_backup() {