Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Feb 2021 12:13:43 +0100
From:      Michael Schuster <michaelsprivate@gmail.com>
To:        freeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Bootenv containing several filesystems
Message-ID:  <CADqw_g%2BAqHHc6NOc4QRaYNdy_itT3xioo=4G44h7C1Cpv8RYPA@mail.gmail.com>
In-Reply-To: <5361642.mMMZhaHaU6@curlew>
References:  <CADqw_gKG6ovTuN7bZvYy7PCydfCXH4M2fw68YLmLvZhxi-g2xw@mail.gmail.com> <2068084.5gTYqTD1LS@curlew> <CADqw_g%2BThFJd8c0s-0=mKL-4VAbE6t%2BenW31RpuWbLAk1_NrPg@mail.gmail.com> <5361642.mMMZhaHaU6@curlew>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 11, 2021 at 3:21 PM Mike Clarke <jmc-freebsd2@milibyte.co.uk>
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'



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADqw_g%2BAqHHc6NOc4QRaYNdy_itT3xioo=4G44h7C1Cpv8RYPA>