From 986303caf305fe7e1044eaa6eb823b0bf3af562d Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Mon, 21 Mar 2016 16:13:14 +0100 Subject: [PATCH] Fix LXC migration from local subvol This patch reconfigured the rsync parameters, so the fs keeps all settings and works recursive. --- PVE/Storage.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index e7ff5a0..415301a 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -461,7 +461,6 @@ sub storage_migrate { run_command(['/bin/cp', $src, $dst]); } else { - run_command(['/usr/bin/ssh', "root\@${target_host}", '/bin/mkdir', '-p', $dirname]); @@ -475,8 +474,15 @@ sub storage_migrate { outfunc => sub {}); } - my $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file', - $src, "[root\@${target_host}]:$dst"]; + my $cmd; + if ($format eq 'subvol') { + $cmd = ['/usr/bin/rsync', '--progress', '-X', '-A', '--numeric-ids', + '-aH', '--delete', '--no-whole-file', '--inplace', + '--one-file-system', "$src/", "[root\@${target_host}]:$dst"]; + } else { + $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file', + $src, "[root\@${target_host}]:$dst"]; + } my $percent = -1;