From owner-freebsd-fs@FreeBSD.ORG Thu Apr 22 15:11:25 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC90106564A for ; Thu, 22 Apr 2010 15:11:25 +0000 (UTC) (envelope-from nowak@xpam.de) Received: from mail.csp-systems.de (mail.csp-systems.de [83.246.83.230]) by mx1.freebsd.org (Postfix) with ESMTP id DA4178FC21 for ; Thu, 22 Apr 2010 15:11:24 +0000 (UTC) Received: by mail.csp-systems.de (Postfix, from userid 602) id 27407693B4D; Thu, 22 Apr 2010 17:11:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.csp-systems.de X-Spam-Level: **** X-Spam-Status: No, score=4.3 required=6.0 tests=AWL, BAYES_00, FH_DATE_PAST_20XX, MISSING_HEADERS,RDNS_NONE autolearn=no version=3.2.5 Received: from master.sinuspl.net (unknown [83.246.67.202]) by mail.csp-systems.de (Postfix) with ESMTP id 8294069001E for ; Thu, 22 Apr 2010 17:11:18 +0200 (CEST) Received: by master.sinuspl.net (Postfix, from userid 8) id 2A98B1080336; Thu, 22 Apr 2010 17:11:18 +0200 (CEST) Received: from [172.19.191.2] (088156221125.bialystok.vectranet.pl [88.156.221.125]) by master.sinuspl.net (Postfix) with ESMTPA id BFBDE10802D7 for ; Thu, 22 Apr 2010 17:11:17 +0200 (CEST) Message-ID: <4BD0670A.8070205@xpam.de> Date: Thu, 22 Apr 2010 17:11:06 +0200 From: Adam Nowacki User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 CC: freebsd-fs@freebsd.org References: <201004221441.PAA07296@wratting.cam.lispworks.com> In-Reply-To: <201004221441.PAA07296@wratting.cam.lispworks.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: zfs: unexpected resilver of old disk when attaching a new mirror disk X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2010 15:11:25 -0000 My best guess is metadata updates to refer to the 2nd disk. I've seen same behavior when replacing a bad disk in 10 disk raidz2 pool. No data was affected. Martin Simmons wrote: > 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 > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > >