Re: Boot environments and zfs canmount=noauto

2016-08-11 Thread Andriy Gapon
On 28/07/2016 13:34, Andriy Gapon wrote:
> 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.

For posterity, as the paste has expired, I've placed it here:
https://people.freebsd.org/~avg/zfsbe.sh

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot environments and zfs canmount=noauto

2016-07-28 Thread Ultima
Is this actually required? Instead of the extra steps, how about just
moving/creating each dataset into each BE (or at least the ones desired)
and setting them to mountpoint=inherit. With zfs_enable="YES" this should
mount the dataset appropriately. Only the root BE should need
canmount=noauto because if the parent dataset is not mounted the child will
inherently not mount.

Is this not sufficient?
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot environments and zfs canmount=noauto

2016-07-28 Thread Randy Westlund
On Thu, Jul 28, 2016 at 01:34:03PM +0300, Andriy Gapon wrote:
> 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.

Awesome, thanks.  I'll play with this over the weekend.

Maybe someday we'll be able to set something like canmount=with-parent,
which could be like noauto, except that it would mount when its parent
mounts.


signature.asc
Description: PGP signature


Re: Boot environments and zfs canmount=noauto

2016-07-28 Thread Miroslav Lachman

Andriy Gapon wrote on 07/28/2016 14:44:


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.


beadm works with the following layout

NAME   USED  AVAIL  REFER  MOUNTPOINT
sys   10.8G  3.63G96K  none
sys/ROOT  1.45G  3.63G96K  none
sys/ROOT/b4pupg_20160516 8K  3.63G   606M  /
sys/ROOT/b4pupg_20160523 8K  3.63G   621M  /
sys/ROOT/b4pupg_20160531 8K  3.63G   643M  /
sys/ROOT/b4pupg_20160616 8K  3.63G   649M  /
sys/ROOT/b4pupg_20160627 8K  3.63G   655M  /
sys/ROOT/b4supd_20160523 8K  3.63G   621M  /
sys/ROOT/b4supd_20160728 8K  3.63G   664M  /
sys/ROOT/default  1.45G  3.63G   663M  /
sys/tmp104K  3.63G   104K  /tmp
sys/usr   7.42M  3.63G96K  none
sys/usr/home  6.72M  3.63G  6.72M  /usr/home
sys/usr/obj 96K  3.63G96K  /usr/obj
sys/usr/ports  428K  3.63G   332K  /usr/ports
sys/usr/ports/distfiles 96K  3.63G96K  /usr/ports/distfiles
sys/usr/src 96K  3.63G96K  /usr/src
sys/var   9.31G  3.63G96K  none
sys/var/audit   96K  3.63G96K  /var/audit
sys/var/log   9.31G  3.63G  9.31G  /var/log
sys/var/tmp152K  3.63G   152K  /var/tmp


Note mountpoint "none" on sys/usr and sys/var. They are not mounted 
intermediate directories, because /usr and /var should be part of the 
BE, but some subdirectories should not be part of BE.


BEs under sys/ROOT have this properties

# zfs get all | grep mount
sys  mounted  no-
sys  mountpoint   none  local
sys  canmount ondefault
sys/ROOT mounted  no-
sys/ROOT mountpoint   none  inherited from sys
sys/ROOT canmount ondefault
sys/ROOT/b4pupg_20160516 mounted  no-
sys/ROOT/b4pupg_20160516 mountpoint   / local
sys/ROOT/b4pupg_20160516 canmount off   local
sys/ROOT/b4pupg_20160523 mounted  no-
sys/ROOT/b4pupg_20160523 mountpoint   / local
sys/ROOT/b4pupg_20160523 canmount off   local
sys/ROOT/b4pupg_20160531 mounted  no-
sys/ROOT/b4pupg_20160531 mountpoint   / local
sys/ROOT/b4pupg_20160531 canmount off   local
sys/ROOT/b4pupg_20160616 mounted  no-
sys/ROOT/b4pupg_20160616 mountpoint   / local
sys/ROOT/b4pupg_20160616 canmount off   local
sys/ROOT/b4pupg_20160627 mounted  no-
sys/ROOT/b4pupg_20160627 mountpoint   / local
sys/ROOT/b4pupg_20160627 canmount off   local
sys/ROOT/b4supd_20160523 mounted  no-
sys/ROOT/b4supd_20160523 mountpoint   / local
sys/ROOT/b4supd_20160523 canmount off   local
sys/ROOT/b4supd_20160728 mounted  no-
sys/ROOT/b4supd_20160728 mountpoint   / local
sys/ROOT/b4supd_20160728 canmount off   local
sys/ROOT/default mounted  yes   -
sys/ROOT/default mountpoint   / local
sys/ROOT/default canmount ondefault

Miroslav Lachman
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot environments and zfs canmount=noauto

2016-07-28 Thread Andriy Gapon

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
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot environments and zfs canmount=noauto

2016-07-28 Thread Andriy Gapon
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
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot environments and zfs canmount=noauto

2016-07-27 Thread Allan Jude
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.

In order to do it the way Dexter is proposing, you can set them
canmount=noauto or with mountpoint=legacy, and then mount them via fstab
(defined differently in each BE), but that kind of defeats a lot of the
purpose of ZFS.


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Boot environments and zfs canmount=noauto

2016-07-27 Thread Randy Westlund
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?


signature.asc
Description: PGP signature