Delete unneeded files after upgrade to 13.2

Is there something I can do to reduce the system's footprint after a major upgrade? After upgrading 13.1 to 13.2 and deleting leftover files in /var/db/freebsd-update/, I am still left with something like 3 GB less free space than I had before the upgrade. That is not an immediate concern for most of my installations, but some of them are running on really limited hardware and I expect to exhaust the disk space in one or two more upgrades. I guess I could simply delete everything and perform a clean install, but isn't there a less drastic method that I could use? Thanks.
 
If you use ZFS freebsd-update(8) may have created a boot environment from the 'old' version. If you don't need it any more you could remove it.

Have a look with bectl list
 
This command lists quite a lot of older versions. One is marked as "NR" in the Active column (active now and in the future as well), others have no Active flag at all. So my impression is that I can delete those with bectl destroy 13.1-RELEASE_2022-08-20_060534 and that will reclaim the disk space for me. Is that correct?
 
Yes, the one marked with NR is your current, active, boot environment. All the others could be deleted. That should reclaim quite a bit of space if you have a lot of them.

Basically every time you update/upgrade with freebsd-update(8) a new boot environment is made from the 'original' system. That makes it easy to rollback should those updates/upgrades fail for some reason. But once you're satisfied with the update/upgrade those old versions just take up space and can be removed.
 
Did the "-o" become the default on bectl destroy? If not you may want to do "bectl -o destroy wheveryourbenameis"

Keep in mind that the way ZFS works with snapshots and copy on write the space is not completely reclaimed until all references to it are gone. Until then it just moves somewhere.

Procedurally, I start with the oldest boot environment, do bectl -o destroy on it, then go the next oldest.
 
Back
Top