From: Dietmar Maurer Date: Sat, 24 Dec 2016 09:55:31 +0000 (+0100) Subject: storage_migrate: use bs=4k to copy images with dd X-Git-Url: https://git.proxmox.com/?p=pve-storage.git;a=commitdiff_plain;h=46f114a53fd2948ff9b2262cb2d4de50f6b9434e storage_migrate: use bs=4k to copy images with dd The default block size is 512 bytes, and is quite slow. We do not want to use blocks bigger than 4k, because we want to detect empty blocks (sparse). --- diff --git a/PVE/Storage.pm b/PVE/Storage.pm index a904f4e..71b699c 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -613,11 +613,11 @@ sub storage_migrate { eval { if ($tcfg->{type} eq 'lvmthin') { - run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}", - "dd", 'conv=sparse', "of=$dst"]]); + run_command([["dd", "if=$src", "bs=4k"],["/usr/bin/ssh", "root\@${target_host}", + "dd", 'conv=sparse', "of=$dst", "bs=4k"]]); } else { - run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}", - "dd", "of=$dst"]]); + run_command([["dd", "if=$src", "bs=4k"],["/usr/bin/ssh", "root\@${target_host}", + "dd", "of=$dst", "bs=4k"]]); } }; if (my $err = $@) {