Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2018 21:35:59 +0700
From:      Victor Sudakov <vas@mpeks.tomsk.su>
To:        Matthew Seaman <matthew@FreeBSD.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Dualboot and ZFS
Message-ID:  <20180116143559.GA21461@admin.sibptus.transneft.ru>
In-Reply-To: <367901b3-a413-01f2-ecaa-479668b4b232@FreeBSD.org>
References:  <20180115125241.GB60956@admin.sibptus.transneft.ru> <VI1PR02MB1200C7F0066F361E60A6CBEDF6EB0@VI1PR02MB1200.eurprd02.prod.outlook.com> <20180115144747.GA65526@admin.sibptus.transneft.ru> <VI1PR02MB120018D174817F8FFB2981D5F6EB0@VI1PR02MB1200.eurprd02.prod.outlook.com> <20180115151526.GA66342@admin.sibptus.transneft.ru> <a7920f859b666cff48f4f73ee1b2f954@dweimer.net> <20180116034929.GB89443@admin.sibptus.transneft.ru> <alpine.BSF.2.21.1801160934560.69908@mail.fig.ol.no> <20180116112814.GA18197@admin.sibptus.transneft.ru> <367901b3-a413-01f2-ecaa-479668b4b232@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@vas:~ # beadm mount some_test_be
Mounted successfully on '/tmp/BE-some_test_be.WjrL7kVi'
root@vas:~ # ls  /tmp/BE-some_test_be.WjrL7kVi/usr/bin/mail
/tmp/BE-some_test_be.WjrL7kVi/usr/bin/mail
root@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180116143559.GA21461>