2

Sometimes I copy a lot of data using the

dd if=/dev/sda of=/dev/sdb
command. Recently, that copying made a bug that I have found only accidentally. Which command should I use to compare the original and the copy? The

info diff

apparently does not show that such sort of parameters can be used with the diff command.

2

1 Answer 1

2

assuming source and destination drives are identical size, compare md5sum of source and destination.

md5sum /dev/source
md5sum /dev/dest

this should also work if destination is an image file.

If physical destination drive is larger than physical source drive (or file), you'll need to request MD5SUM of the destination, selecting the same number of blocks as copied.

dd if=/dev/dest bs=n count=n | md5sum

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .