Vmware Workstation Specific Virtual Disk

Vmware Workstation Specific Virtual Disk

I got this error while defragmenting a VM on VMware Workstation 15:

The specific virtual disk needs repair

The fix is one command. Before you run it, back up the disk, because a repair can fail and leave the file in a worse state. VMware Communities posts advise a backup first.

The fix on Windows

  1. Power the VM off.
  2. Copy the .vmdk files somewhere safe.
  3. Open a command prompt.
  4. Go to the Workstation install folder, C:\Program Files (x86)\VMware\VMware Workstation.
  5. Note the .vmdk path from the error message.
  6. Run:
vmware-vdiskmanager.exe -R "path of the vmdk file"

Broadcom’s knowledge base article 329347, Repairing a virtual disk in Workstation, covers Workstation Pro 15.x and gives this form on Windows:

vmware-vdiskmanager.exe -R "D:\Virtual Machine\Windows 7\virtualdisk.vmdk"

The fix on Linux

The same article gives the Linux form:

/usr/bin/vmware-vdiskmanager -R PATH-TO-VMDK

I used Windows. I have not run the Linux form.

What success looks like

My output, with my disk as the example, was:

The virtual disk, "D:\VMWare\Ubuntu\Ubuntu-000001.vmdk", was corrupted and has been successfully repaired.

Split disks and snapshots

If the VM uses a split disk, target the base .vmdk, not a slice such as a -s001 file. In my example the file is named Ubuntu-000001.vmdk. The -000001 suffix usually marks a snapshot disk.

The -e switch checks the disk chain. Run it if you have snapshots and want to see whether the chain is intact before or after a repair. I have not run it.

When the repair does not work

Results vary. Some users report that the disk cannot be repaired on Workstation 15.5. Many users cite an alternative, which is to copy the disk into a new one:

vmware-vdiskmanager.exe -r source.vmdk target.vmdk

The lowercase -r is a different switch from the uppercase -R above. This is a user-cited workaround and not a documented step, so treat it as one.

Where the error comes from

The error appeared when I defragmented the VM. Defragmenting a disk is also something vdiskmanager does with -d. So the error may come from the defragment inside Workstation, not from the guest operating system’s own defragmenter. Check vmware-vdiskmanager help on your build to see which switches it lists.

I do not know the cause of the corruption. Defragmenting may have exposed an existing problem or caused one. I found nothing that settles that, and I would not guess.

Checklist

  • VM powered off.
  • Disk files backed up.
  • Command run from the Workstation install folder.
  • Path taken from the error message.
  • Split disks: base .vmdk only.
  • Success: a message that the disk was repaired.
  • Failure: try the copy with -r, or restore from the backup.

Subscribe to Just another Geek

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe