From owner-freebsd-questions@freebsd.org Tue Jan 16 14:36:13 2018 Return-Path: Delivered-To: freebsd-questions@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 294A6E72CE5 for ; Tue, 16 Jan 2018 14:36:13 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA617C3AC; Tue, 16 Jan 2018 14:36:11 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) X-Virus-Scanned: by clamd daemon 0.98.5_1 for FreeBSD at relay2.tomsk.ru Received: from [212.73.125.240] (HELO admin.sibptus.transneft.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 39913910; Tue, 16 Jan 2018 20:31:20 +0600 Received: from admin.sibptus.transneft.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.transneft.ru (8.15.2/8.15.2) with ESMTP id w0GEa4wp021788; Tue, 16 Jan 2018 21:36:06 +0700 (+07) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.transneft.ru (8.15.2/8.15.2/Submit) id w0GEZx4d021787; Tue, 16 Jan 2018 21:35:59 +0700 (+07) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.transneft.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Tue, 16 Jan 2018 21:35:59 +0700 From: Victor Sudakov To: Matthew Seaman Cc: freebsd-questions@freebsd.org Subject: Re: Dualboot and ZFS Message-ID: <20180116143559.GA21461@admin.sibptus.transneft.ru> References: <20180115125241.GB60956@admin.sibptus.transneft.ru> <20180115144747.GA65526@admin.sibptus.transneft.ru> <20180115151526.GA66342@admin.sibptus.transneft.ru> <20180116034929.GB89443@admin.sibptus.transneft.ru> <20180116112814.GA18197@admin.sibptus.transneft.ru> <367901b3-a413-01f2-ecaa-479668b4b232@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <367901b3-a413-01f2-ecaa-479668b4b232@FreeBSD.org> Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 14:36:13 -0000 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