]> git.proxmox.com Git - pve-storage.git/commitdiff
storage_migrate: use bs=4k to copy images with dd
authorDietmar Maurer <dietmar@proxmox.com>
Sat, 24 Dec 2016 09:55:31 +0000 (10:55 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 24 Dec 2016 09:55:31 +0000 (10:55 +0100)
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).

PVE/Storage.pm

index a904f4ec84fe18f0191f501dc9d2707815a261a7..71b699c7ce725950a5cb53e3b57e6924a2495ee3 100755 (executable)
@@ -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 = $@) {