SpinRite, VMware and Windows 7 or Windows 8

Today, my moderately trusty Windows Home Server HP MediaSmart ex495 started complaining of a disk issue. The built-in repair tools seemed to clear the error code, but when I went to run an error scan using HD Tool Pro, the box locked up.  After a reboot, I saw some SMART errors on the disk.  Time for SpinRite!

SpinRite is a trusted tool for performing hard disk maintenance on magnetic hard drives (not flash drives!).  Typically, one would use SpinRite by creating a boot CD or USB stick and running it on a dedicated PC. While it’s running, you can’t use your PC for anything else. It can take hours to do its job.

My preferred method of running SpinRite is inside a virtual machine on my laptop, using an external USB or eSATA dock to connect the troubled disk. To do this, I’ve created a tiny virtual machine in VMware Workstation 8. When creating it the first time, I booted into the virtual machine’s BIOS to change the order of the boot devices to ensure the ISO is the first boot device. I connect the troubled disk to the VM using the Physical Disk option in VMWare Workstation.

I used this method for some years, until it stopped working after moving to Windows 7. Windows 7 would seem to take a lock on the external disk, and the VM seemed to not be able to connect to the physical disk.

The fix for me is to use the DiskPart command line tool with some specific commands to get Windows to release the physical disk so VMware can use it.

In my case, the disk I needed to operate is Disk 2.

Run an elevated command prompt (as Administrator), then run “diskpart”.  Once in diskpart, issue these commands.

list disk
select disk #
offline disk
attribute disk clear readonly
rescan

That should do it. The next time you boot the VM, it should be able to take ownership of the physical disk.

Edit August 26th, 2013:

I just confirmed this technique continues to work on Windows 8.

Advertisements

Published by

Larry Silverman

Larry Silverman is a father and husband, software developer, small-business owner, DIY tinkerer, occasional musician, continuous learner, free thinker, despiser of yard work and comma abuser.

7 thoughts on “SpinRite, VMware and Windows 7 or Windows 8”

  1. Resolved my question too. I’m guessing I repeat the process but use ‘online disk’ in order to turn it back on for normal operation? Total noob here.

  2. Does this method give you access to smart data? Doesn’t seem to work on virtualbox, maybe because its not supported?

    1. Not sure about SMART data, but a quick google on “spinrite virtualbox” returned this link. In the first comment, there’s mention of SMART data.

      1. aww holy crap, never thought about a physical sata>ide adapter! that’d work. Nice find.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s