From owner-freebsd-geom@FreeBSD.ORG Mon Jul 14 19:05:08 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 F11581065676 for ; Mon, 14 Jul 2008 19:05:08 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.190]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0458FC23 for ; Mon, 14 Jul 2008 19:05:08 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so1891065mue.3 for ; Mon, 14 Jul 2008 12:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=AJGygZ1yc9bVj2N5sDZ6l8wLoY4Vy7uTexns4xgPwr0=; b=RnquVgg/OuMITjczQlqNuTbJcZsUwy/Gf+Tm1HNU86R9BG5W+S25NUCCsLelVsjLTI 7wvurtS3ycz76zp/aDm3Eea4RXc6O/HovEBs3SBN7HxnM2vWN8QajX+1gJvZAGnlgVCa DGSn6uEfkNNmhpT2FM02xIJ95At9RqAYSlFZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=P7jmgJd9U+c1eRuM2BWk2toMHMK4NTFTwwSVVHOeVNjs47gLXVydJrgvy9k0mICnjd arikwtealaAZ//ED6LuRaB5uHQHmX692paPa9CevkVSnBSF+/G5TmjFkFfA3bmezhdJd 2k8QmdDcTakc7JfLVGIg0wzEmv5OkYyFI7G1o= Received: by 10.103.213.10 with SMTP id p10mr8184982muq.46.1216062306849; Mon, 14 Jul 2008 12:05:06 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Mon, 14 Jul 2008 12:05:06 -0700 (PDT) Message-ID: <482257ad0807141205i1d5e2c2co4b609a9f5b7015b@mail.gmail.com> Date: Tue, 15 Jul 2008 00:35:06 +0530 From: "Tapan Chaudhari" To: freebsd-geom@freebsd.org In-Reply-To: <482257ad0807111209g20cdb0f6j9f7000fd57a7287a@mail.gmail.com> MIME-Version: 1.0 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> <482257ad0807111129i66ac4372sbc9b4d4ef7675e9d@mail.gmail.com> <482257ad0807111209g20cdb0f6j9f7000fd57a7287a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Mon, 14 Jul 2008 19:05:09 -0000 Hi All, I am not able to find ways to intercept the i/o calls. I will need your help to move ahead. One thing to mention is 'mirror' is just an example. I want to write a new driver which will intercept the i/o calls. This is the first major milestone to achieve. Needed your help. Any pointers and directions will do. Thanks, --Tapan. On Sat, Jul 12, 2008 at 12:39 AM, Tapan Chaudhari wrote: > Hi, > I got the problem resolved of not getting mails. It was the stupid of me > that changed the settings :-).. I have unchecked the digest. > > Did Ivan sent some attachment with the mail? An attachment was scrubbed in > the digest I received. Sorry for the trouble but still, can anyone resend > it? > Expecting some help regarding "interception mechanism" from all of you. > > > Thanks, > --Tapan. > > > On Fri, Jul 11, 2008 at 11:59 PM, Tapan Chaudhari > wrote: > >> Hey guys, >> First of all, I was not able to receive your replies to my mail. I >> don't know the reason but I am already subscribed to the list. I got to know >> about your replies from the digest i received today. I have written a mail >> to the mailing list owner describing this problem. Hope this does not happen >> again. >> >> >> Well regarding GEOM as Poul mentioned he has already done this >> interception mechanism in GEOM, Poul can you please help me out by giving >> some directions as to how to move ahead and implement the interceptions of >> i/o to a particular device? I would be really happy to get any help >> regarding the interception mechanism. >> >> Thanks, >> --Tapan. >> >> >> On Thu, Jul 10, 2008 at 7:25 PM, Tapan Chaudhari >> wrote: >> >>> Thanks Mark, but unmounting will anyways work. But the problem here will >>> be, a new device "/dev/mirror/gm0" and "/dev/mirror/gm0s1" will be created >>> after :- >>> >>> #gmirror label -v -n -b round-robin gm0 /dev/md0 >>> #gmirror load >>> #gmirror configure -a gm0 >>> >>> and "/dev/md0s1" gets deleted. >>> Now I will have to mount the new device "/dev/mirror/gm0s1" to get my >>> original contents. >>> Can't I do it on the fly while the device is already mounted? I just want >>> that all the calls going to the device "/dev/md0s1" first come to me and >>> then it goes to the original device. In short intercepting the i/o calls. Is >>> there some way I can achieve this? >>> >>> Thanks, >>> >>> >>> On Thu, Jul 10, 2008 at 6:39 PM, Mark Gladman wrote: >>> >>>> On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: >>>> > Hi All, >>>> > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o >>>> calls >>>> > going to a particular mounted device by writing some driver. >>>> > I came across geom and thought it might work. I tried to create a new >>>> > device, mount it and then tried using gmirror to mirror the device :- >>>> > >>>> > #dd if=/dev/zero of=file1 bs=1M count=10 >>>> > #dd if=/dev/zero of=file2 bs=1M count=10 >>>> > #mdconfig -f file1 >>>> > #mdconfig -f file2 >>>> > #fdisk -B /dev/mirror/md0 >>>> > #newfs /dev/mirror/md0s1 >>>> > #mkdir /mnt/mirror0 >>>> > #mount /dev/mirror/md0s1 /mnt/mirror0/ >>>> > >>>> > #gmirror label -v -n -b round-robin gm0 /dev/md0 >>>> > gmirror: Can't store metadata on /dev/md0: Operation not permitted. >>>> > >>>> > It gave me this error "gmirror: Can't store metadata on /dev/md0: >>>> Operation >>>> > not permitted." >>>> > >>>> > Am I doing something wrong? Or GEOM does not permit me intercept the >>>> i/o >>>> > calls? If not geom, is there any other mechanism by which I can >>>> achieve it? >>>> > >>>> > >>>> > Thanks, >>>> > --Tapan. >>>> > _______________________________________________ >>>> > freebsd-geom@freebsd.org mailing list >>>> > http://lists.freebsd.org/mailman/listinfo/freebsd-geom >>>> > To unsubscribe, send any mail to " >>>> freebsd-geom-unsubscribe@freebsd.org" >>>> >>>> Hey, >>>> >>>> You're attempting to set up gmirror on a mounted device. >>>> Unmount /dev/mirror/md0s1 then retry the gmirror command and it should >>>> work. >>>> >>>> Cheers! >>>> Mark >>>> >>> >>> >> >