Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Feb 2021 16:29:42 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: "make" in ports tells me "requires kernel source files in SRC_BASE=/usr/src." despite an up-to-date /usr/src
Message-ID:  <2476830.FrFBg55ix7@curlew>
In-Reply-To: <a71737ff-39f6-21ec-a4aa-a542aa70ce49@FreeBSD.org>
References:  <CADqw_gKG6ovTuN7bZvYy7PCydfCXH4M2fw68YLmLvZhxi-g2xw@mail.gmail.com> <CADqw_gL=9hY77i%2BnG6YCsVEFEzce0PngfrY9U_RYC2rrwD1MeQ@mail.gmail.com> <a71737ff-39f6-21ec-a4aa-a542aa70ce49@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, 9 February 2021 09:53:27 GMT Matthew Seaman wrote:

> There's an important difference between beadm and bectl which seems
> relevant here.  beadm defaults to accepting a tree of ZFSes as a boot
> environment, whereas bectl only applies to the ZFS at the top level of
> the boot environment unless you use the -r flag.

That probably accounts for a discrepancy that I always see between beadm list 
and bectl list for my BE which has child datasets:

curlew:/tmp% beadm list 
BE        Active Mountpoint  Space Created 
fbsd12.1y -      -            1.9G 2020-12-20 20:52 
fbsd12.2a -      -          133.0M 2020-12-24 11:20 
fbsd12.2b -      -           18.5M 2021-01-02 09:50 
fbsd12.2c -      -           11.7M 2021-01-12 09:55 
fbsd12.2d NR     /           39.4G 2021-02-05 10:46 
curlew:/tmp% bectl list 
BE        Active Mountpoint Space Created 
fbsd12.1y -      -          61.3M 2020-12-20 20:52 
fbsd12.2a -      -          6.97M 2020-12-24 11:20 
fbsd12.2b -      -          2.80M 2021-01-02 09:50 
fbsd12.2c -      -          5.91M 2021-01-12 09:55 
fbsd12.2d NR     /          39.5G 2021-02-05 10:46

For inactive BEs the output from beadm shows the total space for all the 
child datasets and their snapshots but bectl only includes the space for the 
top level dataset and its snapshot.

For example:

curlew:/tmp% zfs list -H -o name,used,origin ssd/ROOT/fbsd12.1y 
ssd/ROOT/fbsd12.1y      6.02M   ssd/ROOT/fbsd12.2d@2020-12-24-11:20:04 
curlew:/tmp% zfs list -t snap -H -o name,used ssd/ROOT/
fbsd12.2d@2020-12-24-11:20:04 
ssd/ROOT/fbsd12.2d@2020-12-24-11:20:04  55.3M

This gives a total of 61.3M matching the result for bectl but does not 
include the space used by all the children.

>From past experience I know that when I destroy fbsd12.1y it will free up 
about 1.9G but there's no way to get this information using bectl

Since bectl doesn't have an -r option for the list command it's not possible 
for me to make it look for child datasets. Perhaps it should be updated to 
check for and include child datasets by default when calculating the size, 
this shouldn't have any adverse affect the result if there is only a top 
level dataset in the BE.

-- 
Mike Clarke





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2476830.FrFBg55ix7>