Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2008 01:40:24 +0530
From:      "Tapan Chaudhari" <tapan.list@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Can I change the device of the "/" mount point at boot time.
Message-ID:  <482257ad0807141310h3381a97dif17290aed1133cfe@mail.gmail.com>
In-Reply-To: <20080714153653.59ecb307@bhuda.mired.org>
References:  <482257ad0807141106m679ec19frd853339637d27a2d@mail.gmail.com> <20080714184030.GA62288@eos.sc1.parodius.com> <482257ad0807141218l26cbb95aid91414a3c88a121c@mail.gmail.com> <20080714153653.59ecb307@bhuda.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <mwm@mired.org> wrote:

> On Tue, 15 Jul 2008 00:48:42 +0530
> "Tapan Chaudhari" <tapan.list@gmail.com> 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
> --
> Mike Meyer <mwm@mired.org>
> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?482257ad0807141310h3381a97dif17290aed1133cfe>