3

In :

sudo dd if=/dev/sda bs=64k | pv --size 1.5t | dd of=/dev/sdb

Does the block size for dd go on the left side of this after the input as shown or on the right after the output?

With the pipe viewer size option, is it correct that there is no equals sign before the value? Is it okay to use a decimal value as shown above?

6

A number of issues that might benefit from review.

sudo dd if=/dev/sda bs=64k | pv --size 1.5t | dd of=/dev/sdb

Firstly, you can (vastly) increase the block size and correspondingly increase the throughput. I often use bs=32M. The order of the parameters to dd does not matter, so:

sudo dd if=/dev/sda bs=1M

Next, it doesn't matter whether you specify --size with or without an equals. Long args (those starting with a double dash) usually aren't fussy. However, a quick try out of pv shows that the argument must be an integer. So:

pv --size 1500g

Finally, it would be worth specifying a large (output) buffer for dd, and you'll probably need to run it with root privileges. Because we are using a large buffer it's worth ensuring we have filled it completely before trying to write it out. So you end up with this:

sudo dd of=/dev/sdb bs=1M iflag=fullblock

Putting it all together,

sudo dd if=/dev/sda bs=1M | pv --size 1500g | sudo dd of=/dev/sdb bs=1M iflag=fullblock

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.