VMware Communities
rharder
Contributor
Contributor

Resource Busy when using raw disk access for SpinRite on my Mac

I'm trying to run SpinRite on my Mac (as I posted here) but this time with VMWare Fusion instead of VirtualBox to see if it's faster. Oddly I only get about 1MB/sec throughput (ugh) using VirtualBox.

I am able to create a raw disk vmdk file with vmware-rawdiskCreator (using these instructions) in both IDE and SCSI forms.

I am able to attach the raw disk vmdk file to my virtual machine's vmx file, and it appears in Fusion's graphical settings.

When I turn on the virtual machine, my Mac's internal hard drive "Macintosh HD" properly unmounts, and OS X prompts me for my password to gain access to /dev/disk0.

Then I get the following error:

Cannot open the disk '/Users/rob/Documents/VMWare-raw-disk0-ide.vmdk' or one of the snapshot disks it depends on.

Reason: Resource busy.

Screen shot 2011-03-11 at 8.52.30 AM.png

This happens even if I...

  • Use the SCSI version
  • Change owner with "sudo chown rob /dev/disk0"
  • Unmount "Macintosh HD" manually first.

The log lines leading up to the error are these and do not reveal anything to me:

Mar 11 09:00:57.495: vmfusion| /vm/#f6eecc3f6bf7ccba/: VMHSVMCbPower: Setting state of VM to powerOn with option soft
Mar 11 09:00:57.496: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: VMHS: Exec()'ing /Library/Application Support/VMware Fusion/vmware-vmx.
Mar 11 09:00:57.629: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Mounting virtual machine paths on connection: /db/connection/#3fb/.
Mar 11 09:00:57.662: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Mount VM completion for vm.
Mar 11 09:00:57.664: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Mount VM Complete: OK
Mar 11 09:01:14.447: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Disconnect check in progress.

And after I dismiss the dialog, it adds these:

Mar 11 09:01:26.920: vmfusion| vmdbPipe_Streams Couldn't read: OVL_STATUS_EOF

Mar 11 09:01:27.263: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: VMX status has been set.

Mar 11 09:01:27.263: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Disconnect check in progress.

Mar 11 09:01:27.263: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Unmounting the vm.

Mar 11 09:01:27.264: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: VMDB unmount initiated.

Mar 11 09:01:27.264: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Unmounting VM complete.

Mar 11 09:01:27.264: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Pending unmount, deferring cleanup of "/vm/#f6eecc3f6bf7ccba/vmx/execState/req/#3fa/".

Mar 11 09:01:27.309: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Mount state values have changed.

Mar 11 09:01:27.310: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Mount state values have changed.

Mar 11 09:01:27.310: vmfusion| /Users/rob/Documents/Virtual Machines.localized/SpinriteVM.vmwarevm/SpinriteVM.vmx: Reloading config state.

Mar 11 09:01:27.347: vmfusion| VMHS: Transitioned vmx/execState/val to poweredOff

Mar 11 09:01:30.356: vmfusion| Setting power state poweredOff (reported)

I would appreciate any suggestions on how to resolve this before trying to contact VMWare support (or maybe this is VMWare support).

-Rob

Reply
0 Kudos
15 Replies
WoodyZ
Immortal
Immortal

I just booted my MBP from a FireWire Drive containing a CCC Image of the Macintosh HD and manually unmounted the Macintosh HD and then used vmware-rawdiskCreator to create an IDE virtual hard drive and then created a MS-DOS Virtual Machine taking the defaults and then closing VMware Fusion I then added the Macintosh HD - Raw Disk.vmdk to the MS-DOS.vmx file.  I then started VMware Fusion and the MS-DOS Virtual Machine booting from a ISO Image containing SpinRite and proceeded to test the Macintosh HD without any issues.

So it does work as expected to.

What version of VMware Fusion are you using?

Archive (Compress) and attach a copy of the Raw Disk .vmdk file, both files, and any vmware.log files for that Virtual Machine and attach the .zip file to a reply.

Reply
0 Kudos
rharder
Contributor
Contributor

OK, well you're giving me hope.

Here's the exact command I used for the disk creation:

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 1 vmware-raw-disk0-ide ide

And attached are the raw disk files and vmx file.

Thanks for comparing.

-Rob

Reply
0 Kudos
rharder
Contributor
Contributor

Oh, and I'm using Fusion v3.1.2 on OS X 10.6.

Reply
0 Kudos
WoodyZ
Immortal
Immortal

In a Terminal what is the output of the following command?

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0
Reply
0 Kudos
WoodyZ
Immortal
Immortal

Here's the exact command I used for the disk creation:

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 1 vmware-raw-disk0-ide ide

You should probably be using create /dev/disk0 2 in command line of vmware-rawdiskCreator.

Also in the SpinriteVM.vmx file you have ide0:0.fileName = "SpinriteVM.vmdk" why?  I assume you're booting from the SpinRite-bootable.iso and that "SpinriteVM.vmdk" is a normal file based virtual hard disk not one pointing to a Raw Disk correct?  If yes you should remove it and use ide0:0.fileName = "vmware-raw-disk0-ide.vmdk" instead.  Additionally you should change: guestOS = "other" to guestOS = "dos"

Reply
0 Kudos
rharder
Contributor
Contributor

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0

Yields

Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1 1953525167 BIOS EE Unknown

I made the changes to the vmx file (attached is the new one). Yes, the spinrite.vmdk file was a dummy HD that was auto generated.

When I run create with a "2", I get the following:

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 2 vmware-raw-disk0-ide ide

Unable to determine partition start sector(s).

Would you mind posting your vmx and vmdk file? I wonder what else I'm missing.
-Rob

Reply
0 Kudos
WoodyZ
Immortal
Immortal

Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1 1953525167 BIOS EE Unknown

Okay then using 1 is correct and I have a Boot Camp partition and when another partition is introduced 1 shows as EFI and 2 shows as the HFS+ volume however in your case you 1 is the only choice you could have made.

Reply
0 Kudos
rharder
Contributor
Contributor

I'd be curious to see what the output is from vmware-rawdiskCreator create on your system. It seems odd that my one entry is "unknown."

Also if you could post your vmx and/or vmdk, that would be much appreciated. Thanks.

-Rob

Reply
0 Kudos
WoodyZ
Immortal
Immortal

What you're seeing is normal and seeing mine will not really help as my HDD is partitioned differently then yours is however. ...

Computer:~ WKZ$ /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0
Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1     409639 BIOS EE Unknown
2     409640  211901096 BIOS AF HFS+
3  212572880  626699568 BIOS AF HFS+
4  839534592  137238528 BIOS  7 HPFS/NTFS
Computer:~ WKZ$

1 = EFI partition.

2 = Mac OS X partition.

3 = User Data partition.

4 = Boot Camp partition.

The default before I repartitioned it looked like:

Computer:~ WKZ$ /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk0
Nr      Start       Size Type Id Sytem                  
-- ---------- ---------- ---- -- ------------------------
1          1  976773167 BIOS EE Unknown
Computer:~ WKZ$

On my MBP booting from a FireWire Drive and unmounting just the Macintosh HD and or unmounting all partitions, SpinRite works with either layout on my system as I used it with both partitioning schemes.

Reply
0 Kudos
rharder
Contributor
Contributor

Still not working for me. I wonder what's causing the hiccough.

In the meantime, I wonder if there's really any point. When running Spinrite under VirtualBox, I get the impression that VB is simply providing block-level control to /dev/disk0, not actually passing on IDE/SATA commands that Spinrite would need. In other words, I'm not sure running Spinrite in a virtual machine does any good since the virtualization layer appears to be masking problems with the drive. I wonder if VMWare is any different.

-Rob

Reply
0 Kudos
chymb
Contributor
Contributor

I had the same problem and found that using the command:

/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk0 fullDevice vmware-raw-disk0-ide ide

worked. Like yours, my disk had only one partition.

Thought I'd post since I found this discussion and no solution elsewhere.

Reply
0 Kudos
WoodyZ
Immortal
Immortal

This thread a bit old (18 months) however the OP actually had no problem making the raw disk .vmdk although using fullDevice is probably better in this case.  He was getting a Resource busy error message.  I tried by example in my first reply to point out that in order to test the internal hard drive as a raw disk .vmdk the system had to be booted from an external drive and run the VM from there in order to have access.  I think I was to busy to notice that he didn't pick up on that and all along was trying to test while running the VM directly on the Host that of which was the hard drive that SpinRite was being run on and it shouldn't be done this way! Smiley Wink  Hence the Resource busy error message and I should have made this more clear back then.

Reply
0 Kudos
chymb
Contributor
Contributor

Hi,

I did wonder whether that was his problem just before I posted what I'd had a problem with, but then I saw that he said that he could unmount Macintosh HD from his Mac's Desktop without a problem, so assumed he'd just not mentioned which device he was booting from.

I recently put a second disk into my machine and I wanted it to be available to my VM when it was running. I had the same error that OP had when attempting to start my VM until I let it have the whole disk instead of just the first (and only) partition.

Reply
0 Kudos
tjsoftworks
Contributor
Contributor

Hi Woody and others,

I thought I was seeing things that previous I thought were impossible ..... Using SpingRite on a Mac.....virtualized .... one user, rharder,  was of a similar mind and asked the question ....

Earlier in this thread the question was asked if the dismounting of a disk from the host and having a guest OS ( i.e. SpinRite ) mount a "raw" full device actually allows the SpinRite OS to speak to the hardware disk so that SpinRite can work at that level. I didn't see an answer and had the same question myself. It was my conceptual understanding that VMWare Fusion is always operation at a virtual level not at the hardware level because it is not a baremetal hypervisor.

I would love to know that I could have a virtualized OS fixing the low level state of a real harddisk as a "background process" by giving the background process ( i.e a Fusion VM guest ) exclusive access to the hardware device. Is VMWare Fusion really able to do this? And if so, I'd love to read more about this use of storage in particular. I'd love to dedicate a couple Mac Cores to a zfs storage system that I would run as attached storage on an overpowered MacPro that I never fully use, mostly idling along at 5-10%. If it is truly possible, I'd love to run SpinRite VM as a hard disk recovery and low level disk formatting "service" on my MacPro.

If I get a "Yes" it is possible then I will ask a continuing flavor of this question of access raw devices:

I have eSATA Adaptor cards, is it possible for Fusion to take over a full card and run the card and it's storage as a VM guest resource?

I have heard rumors about these kinds of things being possible but need some pointers to examples or documentation or even riffs on conceptuallization of how to do these things on Mac hardware.

Thanx for any comments

Terry

Reply
0 Kudos
ColoradoMarmot
Champion
Champion

It's been a while, but I seem to recall that putting a drive in an enclosure and mounting it in a VM would allow this to work.

Truth be told though, I haven't run Spinrite in years.  I just keep two copies of important data on two different drives. When one starts to die, I drive a spike through it or degauss it and throw it in the trash (after making another backup).

I can't even imagine how long spinrite would take on a 3TB disk...wow!

Reply
0 Kudos