From owner-freebsd-questions@freebsd.org Sat Feb 13 11:13:55 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F44E5291B2 for ; Sat, 13 Feb 2021 11:13:55 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dd76B3TgJz3sb3 for ; Sat, 13 Feb 2021 11:13:54 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: by mail-io1-xd2f.google.com with SMTP id m17so1915012ioy.4 for ; Sat, 13 Feb 2021 03:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=8QKj49Oy53WI3ZWr4Hjs48mfYnBRFSJ1VInsBGCDm3A=; b=N5frZQu9WqOzv+LPZCXohj42EwBcYGoHDGntD26jePaUcHk16ZF3Ottgl8ZWJzCD4a F1k2lzTi8787dq52RQ8PfH2TbHoR+xlCkyLIcIvEBpMNE3EqfvFe11SPxgy8aAvp+sdg u4ManTfzn7d9B9BEUbwfnPjooMCIfQ3AFGJfmdmb+jfTvFKqAKvpgPQaNKYA+eHT0qji vMQquIVtgQx3IQ/x71sz8xbKvZ9Onhwjv451mq34UsMs8DLyxCDTMp0dSn6rl7dpX7jf FAXZYIMgWEHNlDuOqTJEG9utmyoibG+34SHj61MIrkuLvvNkhD/lwqUzdTqKWnZ7fT7P db+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=8QKj49Oy53WI3ZWr4Hjs48mfYnBRFSJ1VInsBGCDm3A=; b=Jq9qtpPEaY9fRirkvCqpyWiJBG+yTRLfeF0u6iI6t+qS02qHF+X/ApTBaI4yBDI/sS KX2zoBa58VizYv76aO5YbXdlurK6042eNkuiFPJtTWtsEQiT9nCqAFRiCTAVZ6CiUgNE m4LU3AMpJebeo6Xvhs40ZuNaDgTTIPgU0c8j/nt1DEEUZDmE+Q3DynFe9XRDaYx+35zS 1RoE2N9RP5yJufgLU+bl2Oq7Ck/a5YqfGT5+J7vOAcLC4Nwe6Drm4hoqtruqjsFxXZD5 n/fJaV+byuZxAnhtHqvlP8ABW8ZJ2UWQ9XQI3QGR9r1cpX75YP0onbi01iyxUhvblTke Lh+Q== X-Gm-Message-State: AOAM532KkhKuC4dV2PYaWc/QBkBcEcA1PecnZMyIhYzgeCFhNuL1kMXn OSEQ2rHuSTnGnEWkpPwofYeUrNvJyOd+52VsBo0RwSc6ydrkCA== X-Google-Smtp-Source: ABdhPJymk1TfIyIVZNO/XMtmNGB/NTGSRQr+JLrRthUMgYmEHwKWhURYKufPYTFM2ZUV268GuKkLWPA0a9BzoC5UZZc= X-Received: by 2002:a05:6638:3819:: with SMTP id i25mr6688738jav.68.1613214832919; Sat, 13 Feb 2021 03:13:52 -0800 (PST) MIME-Version: 1.0 References: <2068084.5gTYqTD1LS@curlew> <5361642.mMMZhaHaU6@curlew> In-Reply-To: <5361642.mMMZhaHaU6@curlew> From: Michael Schuster Date: Sat, 13 Feb 2021 12:13:43 +0100 Message-ID: Subject: Re: Bootenv containing several filesystems To: freeBSD Mailing List X-Rspamd-Queue-Id: 4Dd76B3TgJz3sb3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=N5frZQu9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of michaelsprivate@gmail.com designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=michaelsprivate@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d2f:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d2f:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2f:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 11:13:55 -0000 On Thu, Feb 11, 2021 at 3:21 PM Mike Clarke wrote: > On Wednesday, 10 February 2021 21:32:37 GMT Michael Schuster wrote: > > I have: > > > > $ zfs list | egrep 'BE_20210206_175312_CURRENT14|src' > > tank/ROOT/BE_20210206_175312_CURRENT14 30.9G 340G 24.3G / > > tank/usr/src 2.32G 340G 2.26G > /usr/src > > $ > > > > ... which I guess also explains why for me bectl list and beadm list > > produce similar output. > > > > my working zfs knowledge is a bit rusty; is there a trivial way of > getting > > my /usr/{src|ports} under the current BE? > > thx > > Something like this should work, assuming BE_20210206_175312_CURRENT14 is > the > currently active BE. It's based on memory of what I did in the > past for something similar so I can't be 100% certain that it will work > for > you but it should provide a usable guide. Make sure you have a backup and > check that each step does what was expected before going to the next. > > # Move /usr/src temporarily out of the way > > umount /usr/src > mount -t zfs tank/usr/src /mnt > > # Make sure the directory /usr/src exists. Create a new empty directory if > it > doesn't. If it exists and isn't empty delete the contents. > > # Move existing data /usr/src into the BE > mv /mnt/usr/src/* /usr/src > > # Check that all went well and destroy the old /usr/src dataset > umount /mnt > zfs destroy tank/usr/src > > The contents of your original /usr/src should now be included in > BE_20210206_175312_CURRENT14 and all new BEs created from it but NOT in > any > of your other BEs or their descendants. You will need to reinstall it from > the corresponding svn or git revision in each of the other BEs if you want > to > use them. > > Hi Mike, thx for the details - as usual, once I'd sent the email, I continued thinking about this myself, and came up with a solution based on "zfs rename", which is trivial with only one potential pitfall (which I of course had to test :-)): I'm using BE below instead of the actual name ... # zfs umount /tank/usr/src # zfs create -u ${BE}/usr # zfs rename /tank/usr/src ${BE}/usr/src # zfs mount ${BE}/usr/src now, when I create a new BE and mount it, /usr/src (and /usr/ports, for which I repeated steps 1, 3 and 4) are visible and populated under /mnt/usr. (I also explicitly set the mountpoint property on ${BE}/usr to "none" afterwards, don't know whether that's relevant) thx again Michael -- Michael Schuster http://recursiveramblings.wordpress.com/ recursion, n: see 'recursion'