ZFS bectl commands fail

There are a couple of reasons why libbe_init(const char*) may fail. You can see (or guess) them in /usr/src/lib/libbe/be.c. That said, I don't think this will really help.

What is the result of zpool status?
Also, install and try the vermaden utility sysutils/beadm and see what beadm list gives as output.
 
thanks for all the suggestions. I still get the same error after install beadm. When i try beadmn I get an interesting message:

Code:
# bectl  list
libbe_init("") failed.

[255]# beadm  list
ERROR: This system is not configured for boot environments

[1]# zpool status
  pool: root
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        root        ONLINE       0     0     0
          nda0p4    ONLINE       0     0     0

errors: No known data errors

# freebsd-version -kru
14.1-RELEASE-p5
14.1-RELEASE-p5
14.1-RELEASE-p6

# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
root  14.1G  44.0G  14.1G  none

# mount
root on / (zfs, local, nfsv4acls)
devfs on /dev (devfs)

I am running zfs what do i need to do to make it configured for boot environments ?
 
It looks like something has gone wrong with your ZFS installation.

How did you install your root-on-ZFS?
Please post the output of zfs list -o name,canmount,mountpoint

There should be at least a line like:
Code:
	     NAME			     CANMOUNT	     MOUNTPOINT
	     zroot
[...]
	     zroot/ROOT/default		     noauto	     none
Mountpoint in this line may show / instead of none
This will result in:
Code:
# bectl list
BE 		Active 	Mountpoint 	Space 	Created
default 	R 		/
where the default BE resides in the data set zroot/ROOT/default, mounted on /
 
Code:
# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
root  14.1G  44.0G  14.1G  none
# mount
root on / (zfs, local, nfsv4acls)
devfs on /dev (devfs)


Check this: https://is.gd/BECTL

This is the default ZFS setup with Auto (ZFS) option from FreeBSD installer:

vermaden_2024-11-18_14-54-27.png
 
as root "zpool history root"
I don't think there is a problem with the pool name "root" but I've never seen that from the installer, I've always seen "zroot" as the pool name.
 
The same error happened to me on a system that was not previously installed with boot environments in mind, which I tried to convert to boot environments. I don't remember exactly what I did, but I reorganized my ZFS datasets to match a boot environment-enabled pool layout.

I think what I remember is that the root filesystem for the boot environment root cannot be the ZFS pool root, i.e. your root partition would cause this error so you'd need to create a root/ROOT partition.
 
thanks for all the replies. Do I have any options besides a reinstall ? any option to copy files or zfs send receive instead ?

btw I used the installer but not didn't use auto partitions since this is a laptop which is dual booting windows.
 
thanks for all the replies. Do I have any options besides a reinstall ? any option to copy files or zfs send receive instead ?

btw I used the installer but not didn't use auto partitions since this is a laptop which is dual booting windows.

After making a backup ...

Do this works? (probably not but worth a try ...)

Code:
# zfs create root/ROOT
# zfs rename -u root root/ROOT/default

Other way to try:

Code:
# zfs snapshot root@default
# zfs create root/ROOT
# zfs send root@default | zfs recv root/ROOT/default
 
I'm a new freeBSD user trying commands listed here - https://klarasystems.com/articles/managing-boot-environments/

I get an error when trying any bectl] command

Code:
# bectl list
libbe_init("") failed.

I am using ZFS. Any suggestions on troubleshooting ?
The reason for this is your system is a virgin FreeBSD install, i.e. it has not been updated by freebsd-update yet. I get this same error on my 15-CURRENT systems that I maintain using buildworld/kernel, i.e. there are no boot environments. Run freebsd-update fetch and follow the instructions. Reboot when it tells you. Then run bectl list again.
 
After making a backup ...

Do this works? (probably not but worth a try ...)

Code:
# zfs create root/ROOT
# zfs rename -u root root/ROOT/default

Other way to try:

Code:
# zfs snapshot root@default
# zfs create root/ROOT
# zfs send root@default | zfs recv root/ROOT/default
Thank you. this is what I was looking for. I'll try this on the weekend so I can reinstall in case things go south.
 
I get this same error on my 15-CURRENT systems that I maintain using buildworld/kernel, i.e. there are no boot environments.
If I understand correctly, as a newbie: if there is a ZFS, then there may not be a BE? I thought that if there is a ZFS, then there MUST be a BE. Don't ZFS + BE always exist together and work too?
 
If I understand correctly, as a newbie: if there is a ZFS, then there may not be a BE? I thought that if there is a ZFS, then there MUST be a BE. Don't ZFS + BE always exist together and work too?
Actually. There are some requirements in order to use the BEs. They can vary depending on the tool, but you must have a minimum dataset organization, see the posts of vermaden.

If you make a default installation, you will meet these requirements. But, if you organize your pool by hand, without care, it's likely you won't have the possibility to use the BEs.
 
  • Like
Reactions: mer
Back
Top