From owner-freebsd-geom@FreeBSD.ORG Sat Sep 19 22:48:13 2009 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38200106566B for ; Sat, 19 Sep 2009 22:48:13 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id EBF3E8FC08 for ; Sat, 19 Sep 2009 22:48:12 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1Mp8SB-0002Sn-SX for freebsd-geom@FreeBSD.org; Sun, 20 Sep 2009 02:30:51 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id EFA66B84D for ; Sun, 20 Sep 2009 02:31:00 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 3CCB5B849; Sun, 20 Sep 2009 02:31:22 +0400 (MSD) Date: Sun, 20 Sep 2009 02:31:21 +0400 From: Dmitry Marakasov To: freebsd-geom@FreeBSD.org Message-ID: <20090919223121.GA4601@hades.panopticon> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: gmirror rebuild X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 22:48:13 -0000 Hi! I have 2 HDD configuration, with a similar slice on each HDD dedicated to gmirror: --- % sudo gmirror list Geom name: hades State: DEGRADED Components: 2 Balance: round-robin Slice: 4096 Flags: NONE GenID: 0 SyncID: 2 ID: 3209987644 Providers: 1. Name: mirror/hades Mediasize: 446421491200 (416G) Sectorsize: 512 Mode: r6w5e10 Consumers: 1. Name: ad6s3 Mediasize: 446421491712 (416G) Sectorsize: 512 Mode: r1w1e1 State: SYNCHRONIZING Priority: 0 Flags: DIRTY, SYNCHRONIZING GenID: 0 SyncID: 2 Synchronized: 13% ID: 4192909129 2. Name: ad8s3 Mediasize: 446421491712 (416G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 0 SyncID: 2 ID: 1523468916 --- The mirror itself is BSD partitioned and there are ufs and ufs/journal filesystems on it: --- /dev/mirror/hadesa 989M 326M 584M 36% / /dev/mirror/hadesd 9.7G 404M 8.5G 4% /var /dev/mirror/hadese 9.7G 28K 8.9G 0% /tmp /dev/mirror/hadesf.journal 28G 7.4G 18G 28% /usr /dev/mirror/hadesg.journal 361G 161G 171G 48% /usr/home --- I've just had power outage and the box rebooted, and the mirror seem to be resynced from scratch (visible above). Honestly, I didn't expect that at all, but, well, that seems to be logical actually as I don't want different data to be read from it depending on what disk round-robin choses. However, I still don't like how it behaves. It seems to be copying one disk to another completely, which much worse than fsck after cold reboot, and it somewhat defies the purpose of mirroring, as if the drive fails while resync, I'm screwed. If one drive has bad sectors, they may be zeroed on another one (or am I wrong?). First question: why doesn't it read both drives and sync only differences? - Reading is usually faster - This is good for data safety. For example, the common case with modern crappy HDDs are the sectors which are unreadable not marked as bad by hdd, and are cured when the data is written over them. In the case of `read both disks & clone data from better one (that is, from the readable if another is not, or from the (I dunno the criteria) if the data doesn't match)` such sectors will be cured. That's somehow similar to zfs scrub. Second question: is it possible to avoid syncing? gjournal(8) says the syncing may be turned off on underlying mirror providers if it's used. I was somehow silly to thing it'll work magically, however I doubted that it'll work over partitioned mirror. Now thinking it over, I suppose I can enable journalling on all partitions on my mirror and turn the syncing off on it. Will it be safe? Also, I have clear_tmp_enable=YES, so I don't really need syncing for tmp. As I understand, I can only toggle syncing for the whole mirror, not separate partitions on it. Also, I can't (shouldn't) create separate mirrors for each partitions, cause they'll resync in parallel which is suboptimal in terms of performance. No solution here? -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru