From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 14 20:38:38 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61FF4106564A for ; Mon, 14 Jul 2008 20:38:38 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.184]) by mx1.freebsd.org (Postfix) with ESMTP id DFE858FC1F for ; Mon, 14 Jul 2008 20:38:37 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by gv-out-0910.google.com with SMTP id n8so787284gve.39 for ; Mon, 14 Jul 2008 13:38:36 -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=YNT9bBWrTuuIl+Q58zSRqfhM2x+4BRE3Yjap9WNe7BE=; b=VdmTpxkXVzjHpzlVl0N9T9Zjh3/8SpmEo8T+V+pRZ9xuTASnx//9DXF8cYUxqQK8J4 YAnxNnC98wotywB239u0O98HXyxAT/1O7XO+9RRa3g+P5BP4SlUPVSgz9SkZ9l3k0s6T HVDU91+P/u4/UdatXRSAnk6uh+93aCiYZghdU= 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=pcfNVFCbmxwcxaHHFDhAXELDYeQ8ioafoW5qOjvuoZYl3p+afnUYWJVpQVx9eOG1+a vvwJ+wojwDD9SsYSnMKH1oXG03HlZPQbobfU4XCvfDFQU56E+5WsnNvHOIeNdxHfFNY4 ovLhO3MqKZJQiMkNhXJHdu9Ny7wgV58laOqWU= Received: by 10.103.251.2 with SMTP id d2mr8224147mus.88.1216066224523; Mon, 14 Jul 2008 13:10:24 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Mon, 14 Jul 2008 13:10:24 -0700 (PDT) Message-ID: <482257ad0807141310h3381a97dif17290aed1133cfe@mail.gmail.com> Date: Tue, 15 Jul 2008 01:40:24 +0530 From: "Tapan Chaudhari" To: freebsd-hackers@freebsd.org In-Reply-To: <20080714153653.59ecb307@bhuda.mired.org> MIME-Version: 1.0 References: <482257ad0807141106m679ec19frd853339637d27a2d@mail.gmail.com> <20080714184030.GA62288@eos.sc1.parodius.com> <482257ad0807141218l26cbb95aid91414a3c88a121c@mail.gmail.com> <20080714153653.59ecb307@bhuda.mired.org> 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 I change the device of the "/" mount point at boot time. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2008 20:38:38 -0000 Hi, Thanks a lot Mike. But the problem is the device I am talking about is not the physical device. I am writing a driver which will create a virtual device and all the i/os done on this virtual device will be ultimately redirected to the original device. Correct me if I am wrong, but I guess the loader will try to mount my new device on '/' and then load the modules into the kernel. Since my driver would not be loaded at that point in time, it will fail to even mount '/'. Am I right? Or can our drivers get loaded before loader mounts '/' ? Thanks, --Tapan. On Tue, Jul 15, 2008 at 1:06 AM, Mike Meyer wrote: > On Tue, 15 Jul 2008 00:48:42 +0530 > "Tapan Chaudhari" wrote: > > > This is not exactly what I wanted. I will try to elaborate myself. > > I am creating my own device which will act as a new boot slice which must > be > > mounted as '/'. New device will process i/o calls and then redirect the > i/o > > calls to original device of '/'. Now since I cannot unmount '/' and mount > it > > again with my new device while system is running, I will have to find a > way > > to tell kernel to mount my new device as '/' from next time onwards it > > boots. > > does anyone have suggestions on this? > > That's pretty much exactly what vfs.root.mountfrom does. Edit > /boot/loader.conf to add a line: > > vfs.root_mountfrom="fstype:devicespec" > > and you're good to go. The kernel will boot from your default root > partition, then remount root using the value of that variable. I.e. - > I set mine to "zfs:internal/root" to boot my system to a zfs root. > > -- > Mike Meyer > http://www.mired.org/consulting.html > Independent Network/Unix/Perforce consultant, email for more information. > > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org >