Re: Boot environments and zfs canmount=noauto

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Thu, 28 Jul 2016 13:34:03 +0300
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
Received on Thu Jul 28 2016 - 08:34:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC