From owner-freebsd-current@freebsd.org Thu Jul 28 12:45:29 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D25BA58F9 for ; Thu, 28 Jul 2016 12:45:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EC8B8159C; Thu, 28 Jul 2016 12:45:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA23259; Thu, 28 Jul 2016 15:45:25 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bSkgn-000EgY-Dj; Thu, 28 Jul 2016 15:45:25 +0300 Subject: Re: Boot environments and zfs canmount=noauto To: Allan Jude , freebsd-current@FreeBSD.org, rwestlun@gmail.com References: <20160728020548.GD26793@gmail.com> <5e49ab87-65ff-fe20-1e50-387e3484cc47@FreeBSD.org> From: Andriy Gapon Message-ID: Date: Thu, 28 Jul 2016 15:44:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5e49ab87-65ff-fe20-1e50-387e3484cc47@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 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, 28 Jul 2016 12:45:29 -0000 I also would like to add, just in case, that I never set a BE's mountpoint to '/'. I leave it at its default value like /pond/ROOT/foobar. When the BE is active it would be mounted at / anyway. And when it is not active and I want to access it for some modifications, etc, then I can mount it simply with zfs mount and have it at a non-interfering location. Ditto for its subordinate datasets. I am saying this, because it seems that that is not how the FreeBSD installer ("zfsboot") configures the default BE that it creates. I am not sure what sysutils/beadm expects and configures in this regard. I use my own custom script for doing beadm-like things. On 28/07/2016 13:34, Andriy Gapon wrote: > On 28/07/2016 05:18, Allan Jude wrote: >> On 2016-07-27 22:05, Randy Westlund wrote: >>> I'm trying to follow Michael Dexter's post about using bhyve with boot >>> environments. It involves moving all child datasets under >>> zroot/ROOT/default, so that you can have entirely independent systems. >>> >>> http://callfortesting.org/bhyve-boot-environments/ >>> >>>> Let's change the datasets with "canmount on" to "canmount noauto": >>>> [snip] >>>> Considering that this setting is harmless to a system with a single >>>> boot environment, I would not object to it being the default. Hint >>>> hint. >>> >>> When I set all the datasets with canmount=on to canmount=noauto, only >>> zroot/ROOT/default gets mounted on next boot. It's my understanding >>> that 'zfs mount -a' doesn't mount datasets with canmount=noauto, but if >>> I leave them with canmount=on, they will try to mount regardless of >>> which BE is active. >>> >>> I'm trying this with 11.0-BETA2. Can sometime tell me what I'm missing? >>> >> >> You are not missing anything. This is why the default is to have all >> files that are specific to a BE be in the root dataset, and only files >> that are global (like home directory, etc) be outside of the BE. > > Locally I have the following rc script to handle subordinate datasets of > a boot environment: http://dpaste.com/0Q0JPGN.txt > It is designed for exactly the scenario described above. > The script is automatically enabled when zfs_enable is enabled. > > It would probably make sense to include the script into the OS after > some testing and a review. > -- Andriy Gapon