How to remove all the bectl versions and will I damage anything?

Hi,

So, I upgraded to FreeBSD 14.0-RELEASE. It looks like bectl shows:

13.1-RELEASE-p4_2023-12-22_152118 NR / 75.9G 2023-12-22 15:21
13.1-RELEASE-p4_2023-12-22_153018 - - 943M 2023-12-22 15:30
13.1-RELEASE-p4_2023-12-30_151926 - - 5.79M 2023-12-30 15:19
13.2-RELEASE-p8_2023-12-30_155536 - - 825M 2023-12-30 15:55
13.2-RELEASE-p8_2023-12-30_155916 - - 1.27M 2023-12-30 15:59
14.0-RELEASE-p3_2024-01-03_231405 - - 5.97G 2024-01-03 23:14
14.0-RELEASE-p4_2024-01-11_170520 - - 34.1M 2024-01-11 17:05

Can I simply boot from the 'last' entry by doing:

bectl activate 14.0-RELEASE-p4_2024-01-11_170520

I need confirmation this is going to work.

After I boot to the activated one, I assume it will be marked with 'NR /'

At that point, can I bectl destroy everything in the 13.x range without damaging anything?

Once I have this done, I have to move on to why my USB ports keep rebooting and attach/detach'ing.

Thank you for the help!!

Paul
 
Just do, bectl destroy <selected BE>

Remember, you will not be able to rollback to BEs that have been deleted. Best to do this once you're 100% sure you won't ever need to roll back.
 
There is a nice article by Dru Lavigne which is a good read, suggest you do read it and also take necessary backups before proceeding


It is not apparent how you have managed to set NR flags on your oldest boot environment

You should be able to use the FreeBSD boot loader to select different boot environments and test them as per above article

You may want to look at deleting snapshots if you decide to delete the BEs

# zfs list -t snapshot

# bectl destroy -o <selected BE>
 
It is not apparent how you have managed to set NR flags on your oldest boot environment

The header row (at least) is missing from the opening post.

Dates are probably dates of creation. The active boot environment is typically the oldest (created), is typically the most recently updated, and may be named Default.

Things can become confusing if the active environment is thought of as the default but is something other than Default.
 
… a nice article by Dru Lavigne which is a good read, …

Undated (the Klara collection might gain dates in due course). Probably mid-2021.

Where there's advice to create a boot environment before using freebsd-update(8): probably best to ignore the advice.
 
I'm using attached script to delete no longer needed boot environments. Added extension ".txt" to be accepted here.
This uses sysutils/beadm, but should be easily modiied for bectl.

First, create list file, /tmp/bes, by beadm list | cut -f1 -w -s > /tmp/bes, then, edit it to remove entry that you do NOT want to be deleted. Default is dry-run so you need option "-f" for actual deletion.
The list file name can be overridden on command line.
 

Attachments

  • del_noneed_BEs.txt
    1.2 KB · Views: 37
Well, I activated the latest by date. Booted into it. Everything looked and ran fine. *Shrugged*

Started doing: bectl destroy <BE environments>

Got to last two and stopped there. Everything is good. Happy, Happy, Joy, Joy! :D
 
the latest by date.

That was probably the environment that preceded an update.

Now, please:

freebsd-version -kru ; uname -aKU

bectl list -c creation

Hint: include the header row(s), and format as code.

1705127223398.png
 
Just do, bectl destroy <selected BE>
Did the "-o" option become the default on bectl destroy? "destroy the origin"? I know it was not the default for a while, there was discussion about making it the default, just wondering if it happened.
beadm always asks you unless you "force". It's been a while since I've used beadm so I could be wrong.

grahamperrin has a few good points in this thread, I'd like to emphasize.
From a standard install, the only boot environment is named "default", no version information in the name.
freebsd-update install will create a boot environment that is "your current environment before any changes are applied" (provides rollback) and then applies all changes in your current boot environment (typically marked with NR)

I use the bectl rename command a lot; after install rename "default" to something versioned so I know what it is, then after freebsd-update rename the BEs to match contents.

Example:
you are currently in a 13.2-p4 BE (named 13.2-p4) and run freebsd-update to get to 13.2-p8.
freebsd-update creates a new be name 13.2-p4-timestamp that is before applying updates, then it applies the updates to get to 13.2-p8.
bectl list will show a 13.2-p4-timestamp and one named 13.2-p4. The one named 13.2-p4 actually contains 13.2-p8.
I then bectl rename the named 13.2-p4 to 13.2-p8 and then bectl rename the 13.2-p4-timestamp to 13.2-p4.
 
It may not have happened on the mailing lists, but there was at least a minor discussion here around -o.
I know it bit me a little simply because it was different behavior than beadm.
I simply "reprogrammed" my brain to always add it.
 
Back
Top