tags:

views:

201

answers:

3

We have a smart media card with a linux install on it that we need to duplicate. We created an img with DD and then used dd to write the img back to a couple of new smart media cards. We have compared the MD5 checksum of both the original and the new copies and they are different.

Here is what we used:

dd if=/dev/sdb of=myimage.img

dd if=myimage.img of=/dev/sdb

dd if=/dev/sdb of=newimage.img

Anyone have any ideas of why these come out different?

+1  A: 

The card capacities differ? Running 'ls -l myimage.img newimage.img' might tell you something. Running 'cmp -l myimage.img newimage.img' might tell you something.

Liudvikas Bukys
+1  A: 

If the cards are different sizes, dd'ing the smaller image to a larger card will not "fill it up", and zeros will remain at the end of the card. An image made from this card will be different than the original image.

It's also always possible that data was mis-written, mis-read, or otherwise corrupted in-transit.

Joe Koberg
+1  A: 

If you mounted /dev/sdb in between it would be an answer. If I remember correctly ext2 and ext3 have a "mount counter".

Martin