From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 13:33:34 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 405E41065676 for ; Thu, 10 Jul 2008 13:33:34 +0000 (UTC) (envelope-from mark@legios.org) Received: from bade.legios.org (ppp198-172.static.internode.on.net [59.167.198.172]) by mx1.freebsd.org (Postfix) with ESMTP id 023118FC1C for ; Thu, 10 Jul 2008 13:33:33 +0000 (UTC) (envelope-from mark@legios.org) Received: from localhost (unknown [192.168.0.17]) by bade.legios.org (Postfix) with ESMTP id 190041AD719; Thu, 10 Jul 2008 23:11:14 +1000 (EST) X-Virus-Scanned: amavisd-new at legios.org Received: from bade.legios.org ([192.168.0.17]) by localhost (legios.org [192.168.0.17]) (amavisd-new, port 10024) with ESMTP id 18k629VjEppQ; Thu, 10 Jul 2008 23:10:58 +1000 (EST) Received: from [192.168.0.200] (unknown [192.168.0.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bade.legios.org (Postfix) with ESMTP id 8E85B1AD6F5; Thu, 10 Jul 2008 23:10:58 +1000 (EST) From: Mark Gladman To: freebsd-geom@freebsd.org Date: Thu, 10 Jul 2008 23:09:02 +1000 User-Agent: KMail/1.9.7 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> In-Reply-To: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807102309.03191.mark@legios.org> Cc: Tapan Chaudhari 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 13:33:34 -0000 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