From owner-freebsd-geom@FreeBSD.ORG Wed Dec 27 14:48:52 2006 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6253816A416 for ; Wed, 27 Dec 2006 14:48:52 +0000 (UTC) (envelope-from xi@borderworlds.dk) Received: from ferengi.borderworlds.dk (ferengi.borderworlds.dk [80.166.152.7]) by mx1.freebsd.org (Postfix) with ESMTP id 16C6413C479 for ; Wed, 27 Dec 2006 14:48:52 +0000 (UTC) (envelope-from xi@borderworlds.dk) Received: from dominion.borderworlds.dk (dominion.borderworlds.dk [10.1.0.10]) by ferengi.borderworlds.dk (Postfix) with ESMTP id 90DC7B9B3 for ; Wed, 27 Dec 2006 15:18:44 +0100 (CET) Received: by dominion.borderworlds.dk (Postfix, from userid 2000) id CF9588C7; Wed, 27 Dec 2006 15:18:43 +0100 (CET) To: freebsd-geom@freebsd.org From: Christian Laursen Date: Wed, 27 Dec 2006 15:18:43 +0100 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: geom_mirror delayed synchronizing question 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: Wed, 27 Dec 2006 14:48:52 -0000 I am trying to add functionality to geom_mirror to prevent it from synchronizing mirrors until a given time even if the mirrors are configured for autosynchronization. The purpose of this is to be able to postpone the synchronization until fsck is done after an unclean shutdown. So far I have been succesful in doing part of this. I have added a tunable "kern.geom.mirror.sync" that tells geom_mirror whether sync is allowed. It is also available as a read-only sysctl. When this tunable is set to 0, mirrors are not synced. I have added a "gmirror allowsync" command that changes this variable to allow synchronization to happen. What is missing is automatic synchronization after running this command. If I manualle run "gmirror rebuild name prov" on the stale arrays, synchronization starts, but I need this to happen automatically. The small changes I have made so far: http://borderworlds.dk/~xi/gmirror.diff Any hints on how to write the code to find the relevant mirrors and initiate the rebuild would be much appreciated. Thanks. -- Christian Laursen