Date: Sun, 6 Dec 2009 13:26:03 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Josh Carter <josh@multipart-mixed.com> Cc: freebsd-fs@freebsd.org Subject: Re: ZFS and reordering drives Message-ID: <20091206122603.GD2339@garage.freebsd.pl> In-Reply-To: <CA100C20-5F93-4DCE-B576-474DAEC10747@multipart-mixed.com> 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> <CA100C20-5F93-4DCE-B576-474DAEC10747@multipart-mixed.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091206122603.GD2339>