blocksize for dd cloning?
By - Independent-Meat-994
If you really want to get into it, you'll have to experiment to find the optimal value. Most people just use something like 1MB, and say "good enough".
Or you can just use `cat` and not worry about it. `cat /dev/sda > /dev/sdb`.
I have never used dd in this way, opting for something like `rsync` or `cp -a` to copy file trees rather than cloning devices. `ddrescue` is supposed to be better than `dd` at handling bad blocks, though, reducing the likelihood of the clone being unusable in case of an IO error during the process.
i seem to recall some benchmark/post ages ago that tested the various blocksizes - I vaguely recall there being a point of no further gains after a specific size. (4mb?) ~~BUT i also vaguely recall that dd might have been changed to use a bigger default than what it used to use, which may mean you dont need the BS option.~~ I think that was some 'dd' variant. I cant find any proof/info where its been changed.
But i would have to suggest doing some googling on the topic. I may be miss-remembering what i think i read at least 3+ years ago.
When in doubt - i would just use a few mb. or even half a mb. Dont go crazy. :)
googling for 'dd blocksize benchmark' has several informative sites.
But some may be a bit out of date.
In general - a move up in BS is a big improvement - but going even more - tends to give less gain.
The above url has a script to test out sizes/speeds.
Last time I ran strace on plain dd the bs default was 512 bytes. This was within the last year, so I think you're right that it was a variant.
4mb? I only use that for raw writing.
Depends on the HDDs i think, and how the controllers respond to the (for example) sata commands. You'll have to expiriment. However it's likely you'll get a lot of performance improvement by using partclone instead since it only reads and writes blocks actually in use rather than everything.