VMware Communities
dan9876
Contributor
Contributor
Jump to solution

Disk Error

I have VMware Workstation 15 running on a ubuntu host.  I have a windows 10 guest.  I had a web cam connected to the guest.  when I unplugged it my laptop went blank.  I did a hard boot and now when I try to open the guest I get the following error:  Unable to change virtual machine power state: The disk '/home/userid/vmware/Windows 10 x 64/Windows 10 x64.vmdk' has one or more internal errors that cannot be fixed. ......................... The specified virtual disk needs repair. Cannot open the disk '/home/........./Windows 10 x64.vmdk' or one of the snapshot disks it depends on.  Module 'Disk' power on failed.

I tried running vmware-vdiskmanager -R '/home/....../Windows  10 x64.vmdk' and it said it is corrupt and connot be repaired.

Any suggestions?

Dan

Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

I fixed the metadata by removing the duplicate pointer, so you may want to do a file system check, and/or check at least the latest files that you've saved, as there may be some data corruption.

The changes I made are:

Offset: old value, new value

00000048: 01 00

0025B6A0: 00 80

0025B6A4: 80 00

0025B6A5: 27 00

0025B6A6: B2 00

0025B6A7: 04 00

0075DEA0: 00 80

0075DEA4: 80 00

0075DEA5: 27 00

0075DEA6: B2 00

0075DEA7: 04 00

You may either patch the existing file using a hex editor, or inject the attached metadata into the .vmdk file. In any case, backup the .vmdk file first (unless already done) !!!

Injecting the fixed metadata should work by running:

dd if=./metadata_fixed_vmdk of=./Windows\ 10\ x64.vmdk bs=512 count=20608 conv=notrunc

André

View solution in original post

Reply
0 Kudos
8 Replies
a_p_
Leadership
Leadership
Jump to solution

I assume that you do not have a recent backup!?

To get an overview, please provide some details:

  • a complete list of files in the VM's folder (run ls -lisa > filelist.txt, and attach the filelist.txt to a reply)
  • the VM's latest vmware.log file

André

Reply
0 Kudos
dan9876
Contributor
Contributor
Jump to solution

Correct I do not have a backup.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

According to the log file, I think that it is possible to fix the .vmdk file. Therefore I need the file's metadata.

The first step is to find out the metadata size. For this extract the first 1536 Bytes from the .vmdk file into a temporary file using e.g. the dd command, and attach the temporary file to a reply post.


André

Reply
0 Kudos
dan9876
Contributor
Contributor
Jump to solution

I hope I did this right: dd if=./Windows\ 10\ x64.vmdk of=./partof_vmdk bs=1 count=1536

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Perfect. According to this header data, the number of sectors (512 Bytes) occupied by metadata is 20,608.

pastedImage_4.png

Please run the following command, and attach the metadata_vmdk file to a reply post.

dd if=./Windows\ 10\ x64.vmdk of=./metadata_vmdk bs=512 count=20608

André

Reply
0 Kudos
dan9876
Contributor
Contributor
Jump to solution

Please see the attached file.

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

I fixed the metadata by removing the duplicate pointer, so you may want to do a file system check, and/or check at least the latest files that you've saved, as there may be some data corruption.

The changes I made are:

Offset: old value, new value

00000048: 01 00

0025B6A0: 00 80

0025B6A4: 80 00

0025B6A5: 27 00

0025B6A6: B2 00

0025B6A7: 04 00

0075DEA0: 00 80

0075DEA4: 80 00

0075DEA5: 27 00

0075DEA6: B2 00

0075DEA7: 04 00

You may either patch the existing file using a hex editor, or inject the attached metadata into the .vmdk file. In any case, backup the .vmdk file first (unless already done) !!!

Injecting the fixed metadata should work by running:

dd if=./metadata_fixed_vmdk of=./Windows\ 10\ x64.vmdk bs=512 count=20608 conv=notrunc

André

Reply
0 Kudos
dan9876
Contributor
Contributor
Jump to solution

You are amazing. That appears to have worked.

Thank you,

Dan

Reply
0 Kudos