From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 14 19:37:14 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 F06E3106566C for ; Mon, 14 Jul 2008 19:37:14 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (five.mired.org [66.92.153.75]) by mx1.freebsd.org (Postfix) with ESMTP id 82EA78FC16 for ; Mon, 14 Jul 2008 19:37:14 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 1799 invoked by uid 1001); 14 Jul 2008 15:37:00 -0400 Received: from bhuda.mired.org (bhuda [192.168.195.1]) by bhuda (tmda-ofmipd) with ESMTP; Mon, 14 Jul 2008 15:36:59 -0400 Date: Mon, 14 Jul 2008 15:36:53 -0400 To: "Tapan Chaudhari" Message-ID: <20080714153653.59ecb307@bhuda.mired.org> In-Reply-To: <482257ad0807141218l26cbb95aid91414a3c88a121c@mail.gmail.com> References: <482257ad0807141106m679ec19frd853339637d27a2d@mail.gmail.com> <20080714184030.GA62288@eos.sc1.parodius.com> <482257ad0807141218l26cbb95aid91414a3c88a121c@mail.gmail.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Mike Meyer Cc: freebsd-hackers@freebsd.org 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 19:37:15 -0000 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. 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