From owner-freebsd-fs@FreeBSD.ORG Sat Oct 13 13:59:33 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB414B52 for ; Sat, 13 Oct 2012 13:59:33 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AC9448FC08 for ; Sat, 13 Oct 2012 13:59:33 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 682F8ED5; Sat, 13 Oct 2012 15:58:19 +0200 (CEST) Date: Sat, 13 Oct 2012 16:00:10 +0200 From: Pawel Jakub Dawidek To: Wanpeng Qian Subject: Re: Why zfs need to scan whole fs while I attach a HDD to mirror. Message-ID: <20121013140010.GD1383@garage.freebsd.pl> References: <29CDA684DFBE02spf72sa9@rhythm.ocn.ne.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mSxgbZZZvrAyzONB" Content-Disposition: inline In-Reply-To: <29CDA684DFBE02spf72sa9@rhythm.ocn.ne.jp> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2012 13:59:34 -0000 --mSxgbZZZvrAyzONB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 10, 2012 at 10:16:28AM +0900, Wanpeng Qian wrote: > Hi guys >=20 > my zpool is config as follow: >=20 > NAME STATE READ WRITE CKSUM > storage ONLINE 0 0 0 > mirror-0 ONLINE 0 0 0 > da2 ONLINE 0 0 0 > ada2 ONLINE 0 0 0 > mirror-1 ONLINE 0 0 0 > da1 ONLINE 0 0 0 > da4 ONLINE 0 0 0 > mirror-2 ONLINE 0 0 0 > da3 ONLINE 0 0 0 > ada3 ONLINE 0 0 0 > mirror-3 ONLINE 0 0 0 > ada0 ONLINE 0 0 0 > ada1 ONLINE 0 0 0 > cache > da5 ONLINE 0 0 0 >=20 > recently, I replace mirror-3, from two 2T to two 3T. >=20 > first I detach one hdd, and attach new hdd to that mirror. >=20 > after attach, zfs starting resilvering as expect. > but zfs will scan whole fs to resiver new hdd. >=20 > I think that is not necessery. only copy one disk data to new one > is enough. scan the whole fs will spend a lot of time as follow: >=20 > scan: resilver in progress since Wed Oct 10 07:12:52 2012 > 1.20T scanned out of 6.48T at 121M/s, 12h39m to go > 308G resilvered, 18.60% done >=20 > does this function correctly? ZFS doesn't use separate block-level mirroring. It has to scan entire file system to see which data is stored on mirror-3 exactly. This has pros and cons of course. Huge advantage of this method is that if your pool is not very full, it will take less time to copy only the live data. Block-level mirroring would blindly copy entire disk. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --mSxgbZZZvrAyzONB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlB5c+kACgkQForvXbEpPzQSTACgrawIDkAtPTvu9eD9qV1VCpOk mnkAn1gSFVRRc2eqfYtaw6XoDRKKbMoI =ixTP -----END PGP SIGNATURE----- --mSxgbZZZvrAyzONB--