geom_mirror delayed synchronizing question

Christian Laursen xi at borderworlds.dk
Wed Dec 27 06:48:52 PST 2006


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


More information about the freebsd-geom mailing list