Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2010 00:01:36 +0900
From:      DarkSoul <darksoul@darkbsd.org>
To:        freebsd-fs@freebsd.org
Subject:   A way to alter ZFS metadata stored on a drive ?
Message-ID:  <4C73DED0.7070308@darkbsd.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigDA26B68AD8F6B040659463B4
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

I currently am bumping against this bug :
http://bugs.opensolaris.org/view_bug.do?bug_id=3D6782540

Long story short, I had a dead drive on my pool, I tried to replace it
only to have the planned spare drive die on me.

Which led to this :
  pool: prana
 state: DEGRADED
 scrub: none requested
config:

	NAME                        STATE     READ WRITE CKSUM
	prana                       DEGRADED     0     0     0
	  raidz1                    ONLINE       0     0     0
	    ad16                    ONLINE       0     0     0
	    ad30                    ONLINE       0     0     0
	    ad28                    ONLINE       0     0     0
	    ad18                    ONLINE       0     0     0
	    ad14                    ONLINE       0     0     0
	  raidz1                    DEGRADED     0     0     0
	    ada2                    ONLINE       0     0     0
	    ad4                     ONLINE       0     0     0
	    ad6                     ONLINE       0     0     0
	    ad8                     ONLINE       0     0     0
	    replacing               UNAVAIL      0 12.2K     0  insufficient
replicas
	      16391273719868046777  UNAVAIL      0 14.5K     0  was /dev/ada3/ol=
d
	      17286942469715238412  UNAVAIL      0 14.5K     0  was /dev/ada3
	  raidz1                    ONLINE       0     0     0
	    ada3                    ONLINE       0     0     0
	    ada1                    ONLINE       0     0     0
	    ada0                    ONLINE       0     0     0
	    ad32                    ONLINE       0     0     0
	    ad34                    ONLINE       0     0     0
	cache
	  ad12                      ONLINE       0     0     0
	  ad37                      ONLINE       0     0     0

Here is the zdb dump :
prana
    version=3D14
    name=3D'prana'
    state=3D0
    txg=3D3789517
    pool_guid=3D4093564297936254749
    hostname=3D''
    vdev_tree
        type=3D'root'
        id=3D0
        guid=3D4093564297936254749
        children[0]
                type=3D'raidz'
                id=3D0
                guid=3D2955456027802876323
                nparity=3D1
                metaslab_array=3D14
                metaslab_shift=3D36
                ashift=3D9
                asize=3D7501485178880
                is_log=3D0
                children[0]
                        type=3D'disk'
                        id=3D0
                        guid=3D14068763453858628066
                        path=3D'/dev/ad16'
                        whole_disk=3D0
                        DTL=3D706
                children[1]
                        type=3D'disk'
                        id=3D1
                        guid=3D3644994118268583474
                        path=3D'/dev/ad30'
                        whole_disk=3D0
                        DTL=3D4152
                children[2]
                        type=3D'disk'
                        id=3D2
                        guid=3D14192589917373989656
                        path=3D'/dev/ad28'
                        whole_disk=3D0
                        DTL=3D93
                children[3]
                        type=3D'disk'
                        id=3D3
                        guid=3D12279545963786751752
                        path=3D'/dev/ad18'
                        whole_disk=3D0
                        DTL=3D380
                children[4]
                        type=3D'disk'
                        id=3D4
                        guid=3D9980201723692421139
                        path=3D'/dev/ad14'
                        whole_disk=3D0
                        DTL=3D647
        children[1]
                type=3D'raidz'
                id=3D1
                guid=3D1078755695237588414
                nparity=3D1
                metaslab_array=3D175
                metaslab_shift=3D36
                ashift=3D9
                asize=3D7501485178880
                is_log=3D0
                children[0]
                        type=3D'disk'
                        id=3D0
                        guid=3D12900041001921590764
                        path=3D'/dev/ada2'
                        whole_disk=3D0
                        DTL=3D4127
                children[1]
                        type=3D'disk'
                        id=3D1
                        guid=3D7067019390683734240
                        path=3D'/dev/ad4'
                        whole_disk=3D0
                        DTL=3D198
                children[2]
                        type=3D'disk'
                        id=3D2
                        guid=3D783285185901703545
                        path=3D'/dev/ad6'
                        whole_disk=3D0
                        DTL=3D197
                children[3]
                        type=3D'disk'
                        id=3D3
                        guid=3D9688838378677189049
                        path=3D'/dev/ad8'
                        whole_disk=3D0
                        DTL=3D196
                children[4]
                        type=3D'replacing'
                        id=3D4
                        guid=3D500478404305589015
                        whole_disk=3D0
                        children[0]
                                type=3D'disk'
                                id=3D0
                                guid=3D16391273719868046777
                                path=3D'/dev/ada3/old'
                                whole_disk=3D0
                                not_present=3D1
                                DTL=3D195
                        children[1]
                                type=3D'disk'
                                id=3D1
                                guid=3D17286942469715238412
                                path=3D'/dev/ada3'
                                whole_disk=3D0
                                not_present=3D1
                                DTL=3D4146
        children[2]
                type=3D'raidz'
                id=3D2
                guid=3D4090878701271390479
                nparity=3D1
                metaslab_array=3D164
                metaslab_shift=3D36
                ashift=3D9
                asize=3D7501485178880
                is_log=3D0
                children[0]
                        type=3D'disk'
                        id=3D0
                        guid=3D2581994749932752632
                        path=3D'/dev/ada3'
                        whole_disk=3D0
                        DTL=3D394
                children[1]
                        type=3D'disk'
                        id=3D1
                        guid=3D3261576559815570039
                        path=3D'/dev/ada1'
                        whole_disk=3D0
                        DTL=3D393
                children[2]
                        type=3D'disk'
                        id=3D2
                        guid=3D2403801851152895606
                        path=3D'/dev/ada0'
                        whole_disk=3D0
                        DTL=3D4105
                children[3]
                        type=3D'disk'
                        id=3D3
                        guid=3D5795813053837736090
                        path=3D'/dev/ad32'
                        whole_disk=3D0
                        DTL=3D391
                children[4]
                        type=3D'disk'
                        id=3D4
                        guid=3D4547118883658878725
                        path=3D'/dev/ad34'
                        whole_disk=3D0
                        DTL=3D390

I now can't detach/remove/replace the following drive because "no valid
replicas" or because you "can't replace a replacing drive".

I gather the problem would be solved if I had a drive with the proper
ZDB information and GUID to fool the pool, but I am clueless as to how
to generate this information, and it doesn't seem from what the manpage
says, that zdb allows you to modify this information.

Either that, or find a way to remove these bogus devices, or have the
pool "forget" that it must replace a device that does not exist anymore,
with a device that does not exist anymore.

I would gladly welcome any clue as to how the ZDB metadata work and are
stored on the disk, as I can't find written specifications short of
probing the ZFS code itself.

I can provide any information required, such as the first 512K for each
drive (containing the ZDB copies).

Thanks in advance for any help.
--=20
Stephane LAPIE, EPITA SRS, Promo 2005
"Even when they have digital readouts, I can't understand them."
--MegaTokyo


--------------enigDA26B68AD8F6B040659463B4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxz3tYACgkQ24Ql8u6TF2OimACg9g8vHDCE1ndEp7SzB4y3v89O
2bwAoL1zVbjaeH44PLW1mfdVKkHROHDZ
=PUe+
-----END PGP SIGNATURE-----

--------------enigDA26B68AD8F6B040659463B4--



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