zfs: unexpected resilver of old disk when attaching a new mirror
disk
Martin Simmons
martin at lispworks.com
Thu Apr 22 14:52:28 UTC 2010
When I attach a second disk to a single-disk zpool to make a mirrored pool,
the original disk is partially resilvered. Is that expected? It makes me
worry that some of the good data is being overwritten.
It happens on 8.0-RELEASE (pool version 13) and the 9.0-CURRENT-201004
snapshot (pool version 14). It doesn't happen on Open Solaris snv_111b (also
pool version 14).
My setup commands for the test, making a 64MB zpool containing a 16MB file
are:
dd if=/dev/zero of=/tmp/zdisk0 bs=1m count=64
zpool create ztest /tmp/zdisk0
dd if=/dev/zero of=/ztest/a-file bs=1m count=16
The pool looks as expected:
pool: ztest
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
ztest ONLINE 0 0 0
/tmp/zdisk0 ONLINE 0 0 0
errors: No known data errors
I then attach a second device:
dd if=/dev/zero of=/tmp/zdisk1 bs=1m count=64
zpool attach ztest /tmp/zdisk0 /tmp/zdisk1
and the pool looks like this after a while:
pool: ztest
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Thu Apr 22 00:29:32 2010
config:
NAME STATE READ WRITE CKSUM
ztest ONLINE 0 0 0
mirror ONLINE 0 0 0
/tmp/zdisk0 ONLINE 0 0 0 86K resilvered
/tmp/zdisk1 ONLINE 0 0 0 16.1M resilvered
errors: No known data errors
As expected, /tmp/zdisk1 was resilvered with 16MB of data for /ztest/a-file,
but why was a small amount of /tmp/zdisk0 also resilvered?
The amount varies varies (I've seen up to 220K) but it is never 0. With real
disks constaining 5GB, the amount resilvered on the old disk is up to 70MB and
it increases gradually from 0 as the resilvering of the new disk proceeds.
__Martin
More information about the freebsd-fs
mailing list