From owner-freebsd-questions@freebsd.org Wed Sep 14 15:19:16 2016 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 D22B6BDACEC for ; Wed, 14 Sep 2016 15:19:16 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B89B1CED for ; Wed, 14 Sep 2016 15:19:16 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from zero-gravitas.local (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 6A1B51D71 for ; Wed, 14 Sep 2016 15:19:12 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/6A1B51D71; dkim=none; dkim-atps=neutral Subject: Re: 10.3 zpool/var canmount = off? To: freebsd-questions@freebsd.org References: From: Matthew Seaman Message-ID: <4bd29396-220a-e198-73b9-0de91b74d096@FreeBSD.org> Date: Wed, 14 Sep 2016 16:19:00 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8uKEEBhhf1xf4GJfL9M4D5aRN1SP5qIjI" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 15:19:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8uKEEBhhf1xf4GJfL9M4D5aRN1SP5qIjI Content-Type: multipart/mixed; boundary="j0TEXLnRCFlGrfb6n0FXE6LItWT3phmj3"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <4bd29396-220a-e198-73b9-0de91b74d096@FreeBSD.org> Subject: Re: 10.3 zpool/var canmount = off? References: In-Reply-To: --j0TEXLnRCFlGrfb6n0FXE6LItWT3phmj3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016/09/14 15:47, Oscar Hodgson wrote: > New 10.3 install and I just noted that canmount is set off (local). > So it serves only to provide a root for other var pools (okay) and a > number of /var sub-directories wind up on the root file system (e.g. > /var/db, /var/cache). >=20 > Is there any specific reason why that choice was made? >=20 > I working on updating / replacing a 9.0 mfsroot image we use to pxe > boot machines (and decided to pass on 9.3). That image set up /var > within rc.conf (varmfs=3D=E2=80=9CYES=E2=80=9D, populate_var=3D=E2=80=9C= YES=E2=80=9D), but everything > there disappears when the machine powers off at the end of the day =E2=80= =A6 > and part of my objective is to minimize the size of root. >=20 > Mostly curiosity (and my next step it to =E2=80=9Cfix=E2=80=9D canmount= ), just > thought I=E2=80=99d ask. The layout generated by the installer puts as much as possible into a single 'root' ZFS set up as a boot environment 'zroot/ROOT/default' that you can immediately drop into beadm(1) to manage updates etc. This single ZFS is then easier to manage for operations like using 'zfs send' to clone the system somewhere else. While beadm(1) will cope perfectly well with a more complicated tree of ZFSes in each boot environment, having a tree of ZFSes does make the tricks you can do with zfs send/recv quite a lot more bothersome. The root ZFS contains large chunks of the content under /var by default, but not all of it. The point of having zroot/var (with canmount=3Doff) that just acts as a placeholder is so that eg. zroot/var/log or zroot/var/tmp (which you'll see have 'canmount=3Don') get mounted in the right location in the file system without becoming part of any boot environment. That means there's only one copy of those filesystems and it always gets mounted every time you reboot -- which is really what you want for eg. /var/log but not correct for boot environments in general. Usually you'll have several available, but only one of them should be mounted and active. Your current setup using pxeboot and varmfs is behaving as expected. varmfs creates /var as a memory file system -- ie. one without a long lived backing store. It's expected to be destroyed when the system shuts down and recreated from scratch on bootup. If you want content under /var to survive reboots (for example, the package database in /var/db/pkg is a PITA to have to regenerate...), then you'll need to store it on something other than a mfs -- and you can use the 'canmount=3Doff' concept to create a ZFS overlay on top of an= mfs to do that. (Although getting everything mounted in the right sequence there is going to be a bit tricky.) Cheers, Matthew --j0TEXLnRCFlGrfb6n0FXE6LItWT3phmj3-- --8uKEEBhhf1xf4GJfL9M4D5aRN1SP5qIjI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJX2WptXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnmCQP/2w57jCUXck7qVyluEFIWXtt nJoZNk9T4KcvY3/Ige60uZi+qmCCAZtPQTt06dI0HpZzYe4hSKDHFdcd8A1tTrKV xV6skZsPfUSkgN4Lch0l31vmgHwR+nGej0FhyACJrjHQ6ubLGaicNke1frObAoiz GHRXJapt2wFBw620RYxirg3csDIK5AXLsuiw4Imcqfb7knXxjWVYHH1B0AMEbWBd XIWcb8A0yA9iW0LMRrf15Q+mNZB4f1wVaULcpRGwFoLL5c2x/yjevO1odxvOScJN 4W4IQPuPIRLt3O4QpSFPzUDNtj/UdNUUKnsMYylBLPP8DzvAp3e/IYqYDMbrpb3P WTnHCct56Z//9jQDZd1rkUfnIdBkLyQ5L5biibIIVIsuO3ZM7cfq5OOdWudiDYlI ZDpo3x4IPpGtZEt9eKRdNl/vP0Nrf6rAfOss62Lm7cpYRaktfFkW0KhSwTpxF0uc h+k8xUyMgHzxqKOfuJhBwhFnzQdSJ1TdqytFoM2/4aptTSkgU3EIaK/IbAphmYn9 jeelXByrIrC+I1G2qJg6NfvEPPWc2Yb4RRvoXPTk/MLkByJh2VplnJSaxHhe6Vp5 cNO2FGfe/XBUNItBd26dPt21f8IP69q5VCaADmmFGAVYT5BHauyGxJBoChkhaJjT hg3TZv8RH+XYiASb67Yr =5FY+ -----END PGP SIGNATURE----- --8uKEEBhhf1xf4GJfL9M4D5aRN1SP5qIjI--