From owner-freebsd-fs@FreeBSD.ORG Sun Dec 6 12:26:12 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15FDC1065676 for ; Sun, 6 Dec 2009 12:26:12 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5188FC14 for ; Sun, 6 Dec 2009 12:26:11 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 277A045E35; Sun, 6 Dec 2009 13:26:09 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8517E45C89; Sun, 6 Dec 2009 13:26:03 +0100 (CET) Date: Sun, 6 Dec 2009 13:26:03 +0100 From: Pawel Jakub Dawidek To: Josh Carter Message-ID: <20091206122603.GD2339@garage.freebsd.pl> References: <20091205170400.GM73250@gremlin.foo.is> <8555674.871260033069220.JavaMail.root@zimbra> <20091205184112.GP73250@gremlin.foo.is> <5da0588e0912051052p25fb743ele098ed9cb9de8fa0@mail.gmail.com> <20091205190641.GQ73250@gremlin.foo.is> <20091205191526.GR73250@gremlin.foo.is> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wchHw8dVAp53YPj8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs@freebsd.org Subject: Re: ZFS and reordering drives X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 12:26:12 -0000 --wchHw8dVAp53YPj8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 05, 2009 at 07:25:56PM -0700, Josh Carter wrote: > FWIW, I've hit drive re-ordering problems several times on FreeBSD and Op= enSolaris (most of those due to me doing abusive things to the system on pu= rpose). In all cases a "zfs export [pool]" and "zfs import [pool]" fixed th= e issue. I'm not sure exactly what ZFS is doing, but even across reboots it= appears to remember the configuration it used to see, and insist on seeing= it again. An export/import forces ZFS to forget what it knows and look at = what's on the drives. The history of how ZFS on FreeBSD handles drives reordering is a bit long, but to make it short it now does the following: Search component by its name and guid stored in metadata. If guid doesn't match or there is no such device, go through all devices (GEOM providers) in the system and find one with matching guid. This should work this way for a long time now, but there was a small bug, which I fixed yesterday, where guid wasn't checked if name matched. It should work fine now in HEAD. In my opinion in Solaris it is less reliable now than it is in FreeBSD. When Solaris cannot find device by name it tries by its serial number. FreeBSD did that too in the past, but not all devices have serial numbers and sometimes it is hard to tell serial number (what serial number does partition have?). That's why when FreeBSD finds out that device under remembered name has different guid, etc. it will read all devices in the system. This is of course is more expensive than searching by serial number, but this happens were rarely (how often device names change?), so it is better to use more expensive, but more reliable mechanism. When pool is imported in the system, ZFS stores some info about it in /boot/zfs/zpool.cache file (components names too), so after reboot it can quickly decide which pools are imported and which GEOM providers are part of those pools. If there are problems with stored components names, it will fallback to expensive search as described above. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --wchHw8dVAp53YPj8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLG6LbForvXbEpPzQRAsYWAKCxarCQuk0czbrvERFehpxI5ctmSQCgy7qi SJgcGpK4FFOWGkvvTVFz+ZE= =EKx9 -----END PGP SIGNATURE----- --wchHw8dVAp53YPj8--