From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 5 09:14:33 2012 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 BF24F1065670 for ; Mon, 5 Mar 2012 09:14:33 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 48B058FC0A for ; Mon, 5 Mar 2012 09:14:32 +0000 (UTC) Received: by eaaf13 with SMTP id f13so1331532eaa.13 for ; Mon, 05 Mar 2012 01:14:32 -0800 (PST) Received-SPF: pass (google.com: domain of gljennjohn@googlemail.com designates 10.14.127.139 as permitted sender) client-ip=10.14.127.139; Authentication-Results: mr.google.com; spf=pass (google.com: domain of gljennjohn@googlemail.com designates 10.14.127.139 as permitted sender) smtp.mail=gljennjohn@googlemail.com; dkim=pass header.i=gljennjohn@googlemail.com Received: from mr.google.com ([10.14.127.139]) by 10.14.127.139 with SMTP id d11mr10815201eei.74.1330938872427 (num_hops = 1); Mon, 05 Mar 2012 01:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; bh=rJoBX59H9TOysAs7M3AAN5AKOsCWmK9e8y+b0W52ktU=; b=nXuCYftNjyzuLUAD4IRdLJ60m0MQywkvkD97G6QqbG/SrtS6tXX/dSZssArgsENpOh WNcr2MKpy+5UbMphWrCplNaDeADb4BR6i2Q2vIsiV2lWEv+wQEkUAsBjxD2/nZS/w1Cs jAHsbnKeEO8tVj5DlECleiZ7yW7rK1ydf+b1BwDSDNjp2XQj2d+rrYH0cxX2ch+pAUqu L0EUgMHvhCeHcO9tgh0HX2mh2JsDfPEFCxzsgLvYDuL5g+MbzHQ4gLMMwc9hc/1pv53V jSlA4QViYxbKuAiFhqyq6s5GPsI/pMDhKB6jxegGuFQAG9xMmodiXcJH7KEr2pCqaM6v JBNA== Received: by 10.14.127.139 with SMTP id d11mr8202826eei.74.1330938872282; Mon, 05 Mar 2012 01:14:32 -0800 (PST) Received: from ernst.jennejohn.org (p578E0CDC.dip.t-dialin.net. [87.142.12.220]) by mx.google.com with ESMTPS id z47sm33620644een.5.2012.03.05.01.14.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 01:14:31 -0800 (PST) Date: Mon, 5 Mar 2012 10:14:29 +0100 From: Gary Jennejohn To: Robert Simmons Message-ID: <20120305101429.59f23f86@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Where and when /etc/fstab is checking during boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 09:14:33 -0000 On Sun, 4 Mar 2012 19:32:36 -0500 Robert Simmons wrote: > I've just finished working though building a FreeBSD box with an > encrypted root partition as mentioned in the geli(8) man page: "Ask > for the passphrase on boot, before the root partition is mounted. > This makes it possible to use an encrypted root partition. One will > still need bootable unencrypted storage with a /boot/ directory, which > can be a CD-ROM disc or USB pen-drive, that can be removed after > boot." > > I've noticed something quite interesting about the way that fstab is > read during boot. If you follow the instructions exactly as they are > written in the geli(8) man page you soon discover that you also must > have an /etc/fstab file in that same unencrypted partition. But this > need not be the complete fstab file. It only needs to have the one > line that describes /. > > Later, after the encrypted partition is mounted, the /etc/fstab inside > the encrypted partition is then read and all other partitions listed > in fstab are mounted as written there. > > I've tested this by putting empty fstabs and fstabs with just the line > for / in both locations and booting to see what happens. > > Is this the correct behavior? Shouldn't the fstab file be read > completely once and not twice? > man 5 fstab It isn't explicitly stated, but implied, that fsck(8), mount(8) and umount(8) parse fstab every time they're invoked. It's a feature. -- Gary Jennejohn