From e83f7b40959f014a9df3f437d8c4206416e6ad0d Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Wed, 8 Jun 2016 13:42:53 +0200 Subject: [PATCH] fix for storage migrate remove the sparse parameter from dd. This destroy the lvm volume. also remove the free_disk this will later be done. --- PVE/Storage.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 2952b05..bb35b32 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -558,15 +558,17 @@ sub storage_migrate { $target_volname, int($size/1024)]); eval { - run_command([["dd", "if=$src"], - ["/usr/bin/ssh", "root\@${target_host}", "-C", + if ($tcfg->{type} eq 'lvmthin') { + run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}", "-C", "dd", 'conv=sparse', "of=$dst"]]); + } else { + run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}", "-C", + "dd", "of=$dst"]]); + } }; if (my $err = $@) { run_command(['/usr/bin/ssh', "root\@${target_host}", 'pvesm', 'free', $target_volid]); - } else { - vdisk_free($cfg, $volid); } } else { die "$errstr - migrate from source type '$scfg->{type}' to '$tcfg->{type}' not implemented\n";