Dualboot and ZFS

Victor Sudakov vas at mpeks.tomsk.su
Tue Jan 16 14:36:13 UTC 2018


Matthew Seaman wrote:

[dd]

> On 16/01/2018 11:28, Victor Sudakov wrote:
> > Do you know how to create a beadm-friendly zroot manually (like the one
> > created automatically by bsdinstall)? 
> 
> This is not particularly difficult.  First, you need to consider the
> standard directory structure and mentally divide the ZFSes containing
> this content into two classes:
> 
>    * The Kernel, kernel modules, binaries, shared libraries, application
>      and system configuration files that would be affected by a system
>      upgrade.
> 
>    * Working data, temporary files, documents, log files etc. which
>      would not be affected by a system upgrade.
> 
> The first type should be part of the boot environment files, the second
> type outside it.  If necessary you may need to create additional ZFSes
> to divide content appropriately.

This is clear, but...

> Plus various other ZFSes for jails and poudriere etc.   Now, assuming
> your root zpool is called zroot, and the BE name is '11.1-RELEASE-p6'
> you will want to create ZFSes like so:
> 
>    ZFS                                Mountpoint        Canmount
>    zroot                              /                 no
>    zroot/ROOT                         /ROOT             no
> 
>    zroot/ROOT/11.1-RELEASE-p6         /                 yes
>    zroot/ROOT/11.1-RELEASE-p6/usr     /usr              yes
>    zroot/ROOT/11.1-RELEASE-p6/var     /var              yes
>    zroot/ROOT/11.1-RELEASE-p6/var/db  /var/db           yes
> 
>    ...etc...
> 
>    zroot/home                         /home             yes
>    zroot/var                          /var              no
>    zroot/var/log                      /var/log          yes
>    zroot/var/db                       /var/db           no
>    zroot/var/db/postgres              /var/db/postgres  yes
> 

Your layout is different from that created automatically by
bsdinstall. There is a principal difference. 

The default layout does not have zroot/ROOT/${BE}/usr,
zroot/ROOT/${BE}/var etc. datasets like yours does. Still somehow when
I create a BE with beadm, the files in /usr/bin etc end up being
included in the BE. I don't understand how this works:

zroot                    33,3G  13,0G    96K  /zroot
zroot/ROOT               9,37G  13,0G    96K  none
zroot/ROOT/default       9,37G  13,0G  8,81G  /
zroot/ROOT/install          8K  13,0G   585M  /
zroot/ROOT/some_test_be     8K  13,0G  8,81G  /
zroot/tmp                56,9M  13,0G  47,6M  /tmp
zroot/usr                23,7G  13,0G    96K  /usr
zroot/usr/home           23,7G  13,0G  22,3G  /usr/home
zroot/usr/ports            96K  13,0G    96K  /usr/ports
zroot/usr/src              96K  13,0G    96K  /usr/src
zroot/var                 126M  13,0G    96K  /var
zroot/var/audit            96K  13,0G    96K  /var/audit
zroot/var/crash            96K  13,0G    96K  /var/crash
zroot/var/log            2,21M  13,0G  1,06M  /var/log
zroot/var/mail           15,1M  13,0G  15,0M  /var/mail
zroot/var/tmp             109M  13,0G   109M  /var/tmp

root at vas:~ # beadm list
BE           Active Mountpoint  Space Created
default      NR     /            9.4G 2016-08-13 22:50
install      -      -          391.0M 2016-08-13 23:01
some_test_be -      -          192.0K 2018-01-16 21:20
root at vas:~ # beadm mount some_test_be
Mounted successfully on '/tmp/BE-some_test_be.WjrL7kVi'
root at vas:~ # ls  /tmp/BE-some_test_be.WjrL7kVi/usr/bin/mail
/tmp/BE-some_test_be.WjrL7kVi/usr/bin/mail
root at vas:~ # 

zroot/usr is not below zroot/ROOT/some_test_be, but somehow it's
there in the BE.  Can you please explain this?

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
AS43859


More information about the freebsd-questions mailing list