Networknet archive Blog

MD5: Find a corrupted file after a network copy

Originally published Last updated

By Ivan Versluis

Copying a 3 GB Windows Server 2008 R2 image to my central site took almost five hours last night. I had exported the virtual machine as an OVF template and used 7z to split it into 50 MB files for the transfer.

Once the directory was on the storage server, I started extracting the image. That was when the problem appeared:

 image

7-Zip: Data error in %filename%. File is broken

The operation stopped at 23%. All the files were 50 MB, and I could not find one smaller than the others. I had two choices:

  • Copy everything again.
  • Calculate MD5 checksums for the files in the source directory and compare them with the destination.

I chose to compare checksums. On exactfile.com, I found a small console utility called exf.exe and used it to create a digest file for the source folder.

Compare the source and destination

image

The exf.exe –md5sum command took a couple of minutes to generate the digest file. I then copied exf.exe and exactfile.md5 to the destination folder.

 image

After running exf.exe –c extractfile.md5, the MD5 checksum failed for file number 16. The file was the same size as the others: 512000KB.

image

I copied file 016 over the network again and restarted the extraction. It took me about 15 minutes to find the solution and copy the one 50 MB file needed to resolve the problem.

References