Hard Disk Backup Restore Test

All there is to test is to check that the MD5 checksums of the source and backup files are the same.

  • Attach the external USB drive.

  • Right-click the X: drive and select Unlock Drive.

  • Type the password and click Unlock.

  • Enter the following commands at a PowerShell Command Prompt.

    net use A: \\SMRU-HyperV01\Archive$ /Persistent:No              # Archive$ share
    net use Q: \\TBHFWS-IT02\VirtualBox$ /Persistent:No             # VirtualBox$ share
    net use V: \\TBHFWS-IT01\VirtualBox$ /Persistent:No             # VirtualBox$ share
    net use W: \\SMRU-HyperV01\Windows$ /Persistent:No              # Window$ share
    # Find largest file.
    $LargeFiles = Get-ChildItem -File -Path "X:\" -Recurse |
        Select-Object -Property Length, FullName |
        Sort-Object -Descending -Property Length |
        Select -First 5
    $LargeFiles
    # Get the original source file name.
    $SourceFile = $LargeFiles[0].FullName -replace "^.", "A"        # Archive$ share
    $SourceFile = $LargeFiles[0].FullName -replace "^.", "Q"        # VirtualBox$ share
    $SourceFile = $LargeFiles[0].FullName -replace "^.", "V"        # VirtualBox$ share
    $SourceFile = $LargeFiles[0].FullName -replace "^.", "W"        # Windows$ share
    $SourceFile
    # Get the backup file name.
    $BackupFile = $LargeFiles[0].FullName
    $BackupFile
    # Calculate MD5 checksums.
    Get-FileHash -Algorithm MD5 -Path $SourceFile
    Get-FileHash -Algorithm MD5 -Path $BackupFile
  • Eject the X: drive.