Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2013 08:01:59 +1000
From:      Peter Jeremy <peter@rulingia.com>
To:        Kirk Richard Holz <krh@kirkholz.com.au>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Trying to recover 2-element zfs striped (raid0) filesystem
Message-ID:  <20130726220159.GI86483@server.rulingia.com>
In-Reply-To: <1b756c89576eb509d1197c4d9ab66fea@kirkholz.com>
References:  <1b756c89576eb509d1197c4d9ab66fea@kirkholz.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--/NkBOFFp2J2Af1nK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2013-Jul-26 01:33:01 -0700, Kirk Richard Holz <krh@kirkholz.com.au> wrot=
e:
>The partition table of one of the two disks in a zfs striped (raid0)=20
>array has been corrupted.

Once you recover the partition table for ada3, ZFS should be OK (as
long as you haven't written too much to the pool).  If zShare is your
boot device, I strongly recommend booting off alternative media.
Ideally, you should take full physical copies of both disks.

If you are unable to remember the partition layout, you should be able
to recover it by looking for the ZFS vdev labels:  Each ZFS vdev has
4 256KiB labels - 2 at the start of the partition and 2 at the end of
the partition so locating those will identify the start and end of the
partition - if you used the entire disk for ZFS, they will be close
to the start & end of the disk and "hd /dev/ada3|less" should be
enough to find the first label.  The first label on all my vdevs begins:

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |..............=
=2E.|
*
00003fd0  00 00 00 00 00 00 00 00  11 7a 0c b1 7a da 10 02  |.........z..z.=
=2E.|
00003fe0  3f 2a 6e 7f 80 8f f4 97  fc ce aa 58 16 9f 90 af  |?*n........X..=
=2E.|
00003ff0  8b b4 6d ff 57 ea d1 cb  ab 5f 46 0d db 92 c6 6e  |..m.W...._F...=
=2En|
00004000  01 01 00 00 00 00 00 00  00 00 00 01 00 00 00 24  |..............=
=2E$|
00004010  00 00 00 20 00 00 00 07  76 65 72 73 69 6f 6e 00  |... ....versio=
n.|
00004020  00 00 00 08 00 00 00 01  00 00 00 00 00 00 13 88  |..............=
=2E.|
00004030  00 00 00 24 00 00 00 20  00 00 00 04 6e 61 6d 65  |...$... ....na=
me|

If you look at the output of "zdb -C zShare", the 'asize' value is the
usable size of the vdev in bytes - the physical size is a slightly
larger (~4.5MB for me) but the labels are at the end of the physical
partition.

For more details, see the ZFS On-Disk Specification (ondiskformat0822.pdf)

--=20
Peter Jeremy

--/NkBOFFp2J2Af1nK
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iEYEARECAAYFAlHy8dcACgkQ/opHv/APuIfvQQCfYsdZGPiPS0o+/HQ5fJIBl415
s0IAoIHWbhiBzZyKRv9Nvvl1GhTIDEpx
=WlyL
-----END PGP SIGNATURE-----

--/NkBOFFp2J2Af1nK--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130726220159.GI86483>