From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 20 10:47:41 2010 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA86106566C; Fri, 20 Aug 2010 10:47:41 +0000 (UTC) (envelope-from thomas@FreeBSD.ORG) Received: from melamine.cuivre.fr.eu.org (unknown [IPv6:2001:470:1f15:1531:224:e8ff:fe3d:60a5]) by mx1.freebsd.org (Postfix) with ESMTP id 24DE38FC0C; Fri, 20 Aug 2010 10:47:41 +0000 (UTC) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id F017E57FA; Fri, 20 Aug 2010 12:47:39 +0200 (CEST) Date: Fri, 20 Aug 2010 12:47:39 +0200 From: Thomas Quinot To: vwe@FreeBSD.org Message-ID: <20100820104739.GA48344@melamine.cuivre.fr.eu.org> References: <201008191954.o7JJsstZ037225@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008191954.o7JJsstZ037225@freefall.freebsd.org> X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/149803: [patch] loader: set vfs.mount.rootfrom using label X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 10:47:41 -0000 * vwe@FreeBSD.org, 2010-08-19 : > I tend to close this PR but would like to discuss that before. > A lot of machines I'm responsible for, do not have an /etc/fstab on the boot > filesystem at all, so loader(8) does not see anything at all. > > If vfs.root.mountfrom is properly set, neither loader(8) nor the kernel > require any entries to find the root filesystem. Right, setting vfs.root.mountfrom in loader.conf (or manually at the loader prompt) is another possibility. The proposed change does not change anything to the existing behaviour in that case. > All it takes is the correct filesystem type and device path to the device that > contains the root filesystem and that all can be set by loader.conf(5). This assumes that the contents of loader.conf is consistent with the device name which the kernel will assign to the filesystem. If this information is known in advance and can be stored in the filesystem, one might just as well put it in /etc/fstab. > So in the end, what your PR is all about can be done without any code changes. I beg to differ. The use case for the proposed change is when you cannot, or do not want to, hard-code in the filesystem the specific device name that will be assigned to it. Think for example of a machine where you want to have a "rescue" slice that contains an exact copy of the root filesystem taken in some "known good" state. You want to be able to boot from that rescue slice in case something goes wrong (e.g. a system upgrade) on the main slice. With the proposed change, you do not need to remember to fix /etc/fstab or /boot/loader.conf on the rescue slice at the point where you copy the "known good" snapshot: you can have the files in the rescue slice have exactly the same contents as on the main slice. Then, you can just select the desired slice from the boot blocks prompt, and with the proposed change the kernel will end up mounting the corresponding device. If we rely on /etc/fstab or /boot/loader.conf on the other hand, you will always end up mounting the root fs from the "main" slice" even if you have read the boot blocks, fstab and loader.conf from the rescue slice. Of course, on a machine that has just a single boot slice, my change does not bring anything compared to setting vfs.root.mountfrom in loader.conf (but if we follow this line of reasoning, we might just as well get rid of the existing code in loader that reads /etc/fstab!) > I'm wondering if you're able to set your root fs to be mounted at boot time, too? Not sure I understand the question... Thomas.