From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 22:02:37 2008 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 70104106568B; Thu, 10 Jul 2008 22:02:37 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 36D6D8FC13; Thu, 10 Jul 2008 22:02:36 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id 4AB6E170E3; Thu, 10 Jul 2008 22:02:35 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m6AM2YoL050706; Thu, 10 Jul 2008 22:02:35 GMT (envelope-from phk@critter.freebsd.dk) To: Ivan Voras From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 10 Jul 2008 21:19:35 +0200." Date: Thu, 10 Jul 2008 22:02:34 +0000 Message-ID: <50705.1215727354@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@freebsd.org Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? 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: Thu, 10 Jul 2008 22:02:37 -0000 In message , Ivan Voras writes: >> Can't I do it on the fly while the device is already mounted? I just wa= >nt >> that all the calls going to the device "/dev/md0s1" first come to me an= >d >> then it goes to the original device. In short intercepting the i/o call= >s. Is >> there some way I can achieve this? > >It would be very nice if GEOM could do this, since it would then=20 >trivially allow things like data replication, log/rollback, etc. but it=20 >doesn't work like that. In short, no, you cannot listen to IO between=20 >providers. > >(not that it isn't possible to do at all, it just isn't implemented). The GEOM design allows for insertions, where a 1:1 GEOM class is inserted in an existing provider-consumer connection. The traditional example was: insert mirror module add disk to mirror replicate drop original disk from mirror remove mirror module. I may still have the code that can do this in a src tree somewhere, but it never got to the surface of my TODO list. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.