Skip site navigation (1)Skip section navigation (2)
Date:      30 May 1998 02:05:12 +0200
From:      Staffan Ulfberg <staffanu@nada.kth.se>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re-mounting root after boot?
Message-ID:  <jyfbtsghbd3.fsf@tcs07.nada.kth.se>

next in thread | raw e-mail | index | archive | help
Hello,

This is my first post to this mailing list, and I hope it's not
terribly off-topic.  The content is very similar to a post to
comp.unix.bsd.freebsd yesterday, but I hope the main question is
better answered here.

The FreeBSD Handbook, sec 22.1.4, "Interesting Combinations" contains
the following:

Boot a kernel with a MFS in it with a special /sbin/init which...
  -  NFS mounts your server:~you/FreeBSD as /nfs, chroots to /nfs and
     executes /sbin/init there

My question is: is this really possible?  To test it out, I simply
made a new /sbin/init on a working system:

Before launching the single user sh, init now does the following (when
booting "normally," init works as usual).

system("/sbin/ifconfig zp0 inet 62.20.128.20 netmask 0xffffff80");
system("/sbin/mount -t nfs multivac:/f /mnt");
chroot("/mnt");
chdir("/");
	
The shell is launched correctly, and the chroot works.  (Before
rebooting, I made a copy of the machine's kernel in the new root since
the boot kernel is expected to be in the root directory.)  This was
easy...  after CTRL-D boot continues normally, and everything seems to
work.  After a minute or so, however (sometimes I have the time to log
in and type a few commands, sometimes not), the kernel panics.
"Unexpected page fault while in kernel mode," process: idle.

Question: am I close to having it all working, or is there a
fundamental flaw in this setup?  For example, maybe the kernel has
some record of the root device which is now inconsistent with the one
I'm using?

Staffan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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