Why zfs need to scan whole fs while I attach a HDD to mirror.
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sat Oct 13 13:59:34 UTC 2012
On Wed, Oct 10, 2012 at 10:16:28AM +0900, Wanpeng Qian wrote:
> Hi guys
>
> my zpool is config as follow:
>
> 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
>
> recently, I replace mirror-3, from two 2T to two 3T.
>
> first I detach one hdd, and attach new hdd to that mirror.
>
> after attach, zfs starting resilvering as expect.
> but zfs will scan whole fs to resiver new hdd.
>
> 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:
>
> 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
>
> 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.
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20121013/6ca639c6/attachment.sig>
More information about the freebsd-fs
mailing list