Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2012 16:00:10 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Wanpeng Qian <spf72sa9@rhythm.ocn.ne.jp>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Why zfs need to scan whole fs while I attach a HDD to mirror.
Message-ID:  <20121013140010.GD1383@garage.freebsd.pl>
In-Reply-To: <29CDA684DFBE02spf72sa9@rhythm.ocn.ne.jp>
References:  <29CDA684DFBE02spf72sa9@rhythm.ocn.ne.jp>

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

--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--



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