Using MD5sum to verify the integrity of copied files
search cancel

Using MD5sum to verify the integrity of copied files

book

Article ID: 344339

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides details about using MD5sum to verify the integrity of files that you have copied over a network, or between local disks.


Environment

VMware vSphere ESXi 8.0.x
VMware vCenter Server 8.0.x
VMware ESXi 6.5.x
VMware vCenter Server 7.0.x
VMware ESXi 6.7.x
VMware vSphere ESXi 7.x
VMware vCenter Server 6.x

Resolution

To use MD5sum to verify the integrity of copied files:
  1. On the server you are copying files from, create an MD5 digest for each of the files you want to verify the integrity of. You can create an MD5 value for just one file, or for many files at a time. To collect all the digests and put them into a text file, run the following command from the ESX service console:

    # md5sum * > files.md5
  2. When you have copied over the files to your destination server, copy the .md5 file into the same directory that contains the files that you want to verify the integrity of, and run the following command to check the files that are listed in the .md5 file:

    # md5sum -c files.md5

    If you see output similar to the following, then the MD5 digest on the destination matches that of the source:

    server-flat.vmdk OK
    server.vmdk OK
    server.vmx OK


    If you see output similar to the following, then the MD5 digest on the destination does not match that of the source, which indicate corruption during the file transfer:

    server-flat.vmdk FAILED
    md5sum: WARNING: 1 of 1 computed checksums did NOT match
Alternatively, you can compare the MD5 digest manually running these commands on both the source and destination of the copy:
  • To create an MD5 value for one file, run the following command:

    # md5sum server.vmx
    d41d8cd98f00b204e9800998ecf8427e server.vmx
  • To create an MD5 value for all files in the current directory, run the following command:

    # md5sum *
    d41d8cd98f00b204e9800998ecf8427e server-flat.vmdk
    d41d8cd98f00b204e9800998ecf8427e server.vmdk
    d41d8cd98f00b204e9800998ecf8427e server.vmx

Note: For more information, see Using MD5 Checksums.