Using dd to duplicate disks

There isn't a way to run MD5 (or any other hashing algorithm) directly with dd.

If you'd like to validate your copy, I'd suggest the following, and visually compare the hashes.

Bash:
$ sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress

$ sudo md5sum /dev/sda
$ sudo md5sum /dev/sdb

for SHA256

Bash:
$ sudo shasum -a 256 /dev/sda
$ sudo shasum -a 256 /dev/sdb