From owner-freebsd-hackers Fri May 29 17:06:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA05179 for freebsd-hackers-outgoing; Fri, 29 May 1998 17:06:14 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from tcs07.nada.kth.se (tcs07.nada.kth.se [130.237.222.76]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA05051 for ; Fri, 29 May 1998 17:05:28 -0700 (PDT) (envelope-from staffanu@nada.kth.se) Received: (from staffanu@localhost) by tcs07.nada.kth.se (8.8.7/8.8.7) id CAA04874; Sat, 30 May 1998 02:05:14 +0200 (MET DST) To: freebsd-hackers@FreeBSD.ORG Subject: Re-mounting root after boot? Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII From: Staffan Ulfberg Date: 30 May 1998 02:05:12 +0200 Message-ID: Lines: 39 X-Mailer: Gnus v5.3/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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