Virtual Solaris ZFS raw disks Topic is solved

How to use TestDisk to recover lost partition
Message
Author
AmitDeshwar
Posts: 4
Joined: 14 Mar 2012, 17:42

Virtual Solaris ZFS raw disks  Topic is solved

#1 Postby AmitDeshwar » 15 Mar 2012, 01:54

Hi

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?

Thanks,
Amit

Sponsored links

User avatar
cgrenier
Site Admin
Posts: 3077
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Virtual Solaris ZFS raw disks

#2 Postby cgrenier » 16 Mar 2012, 07:35

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.

AmitDeshwar
Posts: 4
Joined: 14 Mar 2012, 17:42

Re: Virtual Solaris ZFS raw disks

#3 Postby AmitDeshwar » 19 Mar 2012, 15:06

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?

AmitDeshwar
Posts: 4
Joined: 14 Mar 2012, 17:42

Re: Virtual Solaris ZFS raw disks

#4 Postby AmitDeshwar » 23 Mar 2012, 02:48

Even after manually adding the partition I still received the "write_sun_part" error.
What should I do?

AmitDeshwar
Posts: 4
Joined: 14 Mar 2012, 17:42

Re: Virtual Solaris ZFS raw disks

#5 Postby AmitDeshwar » 24 Mar 2012, 05:22

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!!!!
Attachments
c0d0.zip
(148 Bytes) Downloaded 137 times

User avatar
Fiona
Posts: 2839
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Virtual Solaris ZFS raw disks

#6 Postby Fiona » 24 Mar 2012, 07:20

Thank you for your feedback! :)
I'll set your topic as solved.


Return to “Partition Recovery”

Who is online

Users browsing this forum: No registered users and 0 guests