From owner-freebsd-current@FreeBSD.ORG Thu Sep 1 08:47:45 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B78A106564A for ; Thu, 1 Sep 2011 08:47:45 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A296A8FC12 for ; Thu, 1 Sep 2011 08:47:44 +0000 (UTC) Received: by bkat8 with SMTP id t8so2223054bka.13 for ; Thu, 01 Sep 2011 01:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BXxqPJ32stHQQBoHfSN2oUSyeAbd4vpea4XIVx6emEA=; b=C/eIdVQPDVStPr1J9OCmls6YaqqrJL8XEq0lzuQ1yOldRY78hQwaX3waotOFWHIM6u Jip0jbFW7oC/gjzBWgiSRbp3W67tQmWzV4fKuBbtNG8jlHynxE/BCvmqbZTbmO/DT3YQ Z1xhrSvf9UEvAqp0F/faAeHVSkqJ99m2C/uJc= MIME-Version: 1.0 Received: by 10.204.142.197 with SMTP id r5mr800425bku.75.1314866862214; Thu, 01 Sep 2011 01:47:42 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.204.58.196 with HTTP; Thu, 1 Sep 2011 01:47:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Sep 2011 01:47:42 -0700 X-Google-Sender-Auth: fVePr5WieTK-pLp6URwZv9R0KWg Message-ID: From: Craig Rodrigues To: "Daniel O'Connor" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current Current Subject: Re: Custom installer woes (can't mount / RW) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 08:47:45 -0000 Hi, Does it make a difference if you change this line in your script: echo '/dev/gpt/swap / swap sw 0 0' >>${TMPDIR}/mnt/etc/fstab to: echo '/dev/gpt/swap none swap sw 0 0' >>${TMPDIR}/mnt/etc/fstab Mounting of the root file system "/" is a very interesting thing. During early bootup, when loader(8) runs, it has to read the root file system to find and load the kernel, but it also reads /etc/fstab (if it is there) and sets some environment variables, having to do with mounting the root file system. This logic is in src/sys/boot/common/boot.c in the getrootmount() function. The environment variables which are set are "vfs.root.mountfrom", and "vfs.root.mountfrom.options". After your install script runs, you should break into the loader before the kernel loads, and look at the value of those two environment variables. If there is something else wrong, you need to look into the logic in src/sys/kern/vfs_mount.c in the vfs_mountroot() function. BTW, once you solve your issue, do you have time to review the following document which I am in the middle of submitting to the FreeBSD Documentation Project: "PXE Booting with an NFS root file system" http://people.freebsd.org/~rodrigc/doc/doc/en_US.ISO8859-1/books/handbook/network-pxe-nfs.html It's not 100% related to your current issue, but I have used PXE Booting + NFS root, to write custom installers for FreeBSD. -- Craig Rodrigues rodrigc@crodrigues.org On Wed, Aug 31, 2011 at 11:45 PM, Daniel O'Connor wrote: > > The problem I am having is that when I boot into the newly installed system I can't mount / RW, when I try it reports "Operation not permitted". > > My script is at.. > http://www.gsoft.com.au/~doconnor/install-os.sh