Cant copy VHD file, possibly corrupt. Please help!

Victor Alves
Victor Alves used Ask the Experts™
on
Hello everybody,
We've a VM with Windows Server 2008 R2 and we want to put this VM into another server. Everytime we try to copy the VHD files, it comes with "Can't Read source file or disk".
A possible solution, as mentioned before in another post (https://www.experts-exchange.com/questions/27661606/Cant-copy-VHD-file-possibly-corrupt.html), "the fix was to mount the vhd as a hard disk, copy everything off, then create a new vhd, copy everything back on. Then rewrite the boot sector".

We gonna try this one, since we've tried everything. But how is this "rewrite the boot sector" works? How can we do that part?

Thank you!
Att, Victor.

Update 1: We are trying to copy the Windows folder from the VHD and we're getting a lot of errors on the way, linked to the permissions.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
We are trying to copy the Windows folder from the VHD and we're getting a lot of errors on the way, linked to the permissions.
Top Expert 2016

Commented:
A vhd (virrtual hard disk) is treated exactly like any other file on your host operating system.  If you can't copy the vhd using the host machine copy commands when the vm is powered off then your host file system is corrupted and you need to run chkdsk on it.

You can't mount the vhd and copy it all to a new vhd unless you run as 'system' i.e. robocopy with the /B (backup mode switch)  you would also want to use /copy:datsou (or use /copyall ).. personally I'd use backup /restore myself.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial