Why zfs need to scan whole fs while I attach a HDD to mirror.

Tom Evans tevans.uk at googlemail.com
Wed Oct 10 11:59:32 UTC 2012


On Wed, Oct 10, 2012 at 2:16 AM, Wanpeng Qian <spf72sa9 at rhythm.ocn.ne.jp> 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.

I think this is your mistake. Detaching a hard drive puts the whole
pool in a DEGRADED state, so it thinks it must scrub the whole pool.

If instead of "detach/attach" you had done "attach/replace/detach",
the pool would never be DEGRADED, and it would not take so long (or
not, this is just speculation).

Cheers

Tom


More information about the freebsd-fs mailing list