Page 1 of 1

Virtual Solaris ZFS raw disks  Topic is solved

Posted: 15 Mar 2012, 01:54
by AmitDeshwar

I'm running a Solaris 11 VM (using Vmware Workstation) on a Win7 host. It looks like I may have accidentally "initialized" my ZFS disks in Windows (which were being accessed as raw drives from the solaris VM). Now, in Solaris the disks simply report "cannot open" and format cannot see the geometry of the disks.
Does this sound like an MBR issue?
Does TestDisk fix ZFS partitions?


Re: Virtual Solaris ZFS raw disks

Posted: 16 Mar 2012, 07:35
by cgrenier
TestDisk can locate partitions using ZFS filesystem but it doesn't know how to find the filesystem size. So in pratice, you have to manually add (using 'a') after Quick Search or Deeper Search each ZFS partition using the beginning found by TestDisk and use for the partition end the location of the next partition minus one sector.

Re: Virtual Solaris ZFS raw disks

Posted: 19 Mar 2012, 15:06
by AmitDeshwar
Okay, that's good news that it can properly detect them.
As additional information, these disks are part of a RAIDZ configuration, with the whole disk being used by ZFS. Quick search finds the following partition:

Code: Select all

 2 P Whole disk                                          0      0  1  121601   80 63 1953525168
I tried using the write command, but it gave an error about write_sun_part not being implemented.
Does that mean I should manually add a partition with identical information (start at 0, end at 121601, type "whole disk") and then write that?

Re: Virtual Solaris ZFS raw disks

Posted: 23 Mar 2012, 02:48
by AmitDeshwar
Even after manually adding the partition I still received the "write_sun_part" error.
What should I do?

Re: Virtual Solaris ZFS raw disks

Posted: 24 Mar 2012, 05:22
by AmitDeshwar
In case anyone has the same problem as me in the future:
I managed to fix the problem using dd.
After examining the disks, it appeared that the Windows initialization only overwrote the MBR and left the rest of the GPT intact. Luckily in disks that use GPT, the MBR doesn't contain anything useful or unique to the disks/partitions.
I fixed the problem by copying the MBR from one of my remaining good disks to the "bad" disks. This allowed solaris to recognize them properly.
To copy the MBR from a good disk to a file:
dd if=/dev/dsk/GOODDISK of=./gooddisk.dd bs=512 count=1
To copy the MBR on disk to the bad disk:
dd if=./gooddisk.dd of=/dev/dsk/BADDISK bs=512 count=1
I've attached a zip file containing the MBR I copied over in case all of your disks have been wiped. Remember to unzip before copying!!!!

Re: Virtual Solaris ZFS raw disks

Posted: 24 Mar 2012, 07:20
by Fiona
Thank you for your feedback! :)
I'll set your topic as solved.