From 94c60cf6cd5447721619287728c62aef9f6284b7 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Fri, 2 Oct 2026 16:38:17 +0200 Subject: [PATCH] fix #7183: vzdump: handle mount points with a relative path The path of a mount point does not need to start with a slash, for example a mount point configured with mp0: tank:subvol-999-disk-0,mp=data,size=1G,backup=1 gets mounted at /data in the container when it starts. The backup code however builds its paths by appending the path of the mount point to the root directory, which only works with a leading slash. So such a mount point broke all three backup modes, as it ended up as '/mnt/vzsnap0/.data' instead of '/mnt/vzsnap0/./data' in snapshot and stop mode, and as '/proc//root//.data' in suspend mode. Add the missing leading slash when collecting the mount points for the backup, so that all paths built from it are correct. This also anchors the exclude pattern of such a mount point if it is excluded from the backup, which otherwise matched every file or directory with the same name in suspend mode. Signed-off-by: Michal Fox --- src/PVE/VZDump/LXC.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm index 9bf95af..014d72b 100644 --- a/src/PVE/VZDump/LXC.pm +++ b/src/PVE/VZDump/LXC.pm @@ -157,6 +157,10 @@ sub prepare { next if !$volid || !$mount; + # the path of a mount point is always relative to the root of the container, but it + # does not need to start with a slash, which all the paths built below rely on + $mount = $volume_config->{mp} = "/$mount" if $mount !~ m!^/!; + if (!$included) { my $type = $volume_config->{type}; push @$exclude_dirs, $mount;