Bootenv containing several filesystems
Michael Schuster
michaelsprivate at gmail.com
Sat Feb 13 11:13:55 UTC 2021
On Thu, Feb 11, 2021 at 3:21 PM Mike Clarke <jmc-freebsd2 at 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'
More information about the freebsd-questions
mailing list