bieaz

Contents

bieaz is a boot environment manager.

Installation

bieaz is developed in tandem with several Root on ZFS installation guides:

bieaz itself can be installed:

Summary

bieaz depends on GRUB to support boot environment selection. In particular, GRUB must be installed to the FAT-formatted EFI system partition.

bieaz has some requirements on dataset layout:

bpool/BOOT/be-name mounted at /boot; canmount=noauto
rpool/ROOT/be-name mounted at /    ; canmount=noauto

bieaz also has some requirements on GRUB installation:

ESP=/boot/efi
source /etc/os-release

# for EFI
grub-install --boot-directory ${ESP}/EFI/${ID} --efi-directory ${ESP}
# for legacy
grub-install --boot-directory ${ESP}/EFI/${ID} --target=i386-pc $DISK

# generate menu and copy to current BE
grub-mkconfig -o ${ESP}/EFI/${ID}/grub/grub.cfg
mkdir -p /boot/grub
cp ${ESP}/EFI/${ID}/grub/grub.cfg /boot/grub/grub.cfg

There are two grub.cfg. One inside ESP, the other inside BE, regardless of either legacy or EFI booting is used.

The one inside ESP is actually used when booting the default entry. The other one in BE is used to save some work during menu generation.

Limitation

Support and Contribution

This project is hosted on Gitlab. Link. If you have encountered a problem, please file a bug report there.

BE creation

Configuration

BIEAZ_GRUB_MKCONFIG_CMD
Set grub-mkconfig command name, differs between distros.
BIEAZ_GRUB_CFG_PATH_ZFS

Set the grub.cfg path in BE.

Used for optimizing menu generation.

BIEAZ_GRUB_CFG_DIR_ESP

Set GRUB stage 2 directory, should be set to the same directory as --boot-directory in the installation section.

bieaz submenu will be stored under this folder as ${BIEAZ_GRUB_CFG_DIR_ESP}/bieaz-menu.cfg.

Used for saving generated submenu.

BIEAZ_ESP_MIRROR
Set if enable support for ESP mirroring.
esp_mirror ()
Set the shell script for mirroring ESP.
BIEAZ_MOUNT_DIR

Set the mountpoint for bieaz mount subcommand. The path will be created if not exist. BE will be mounted under $BIEAZ_MOUNT_DIR/$be-name.

Used for bieaz mount subcommand.

BIEAZ_SINGLE_POOL
Confirmation for using a single-pool setup. This is dangerous and not supported by GRUB.
BIEAZ_GRUB_BE_LIMIT
Limit submenu entries generated by bieaz. Too many entries might crash GRUB.
BIEAZ_KEEP_ORIGIN
Set whether bieaz should keep origin snapshots when BE is destroyed.

Screenshots

[root@archonzfs ~]# time bieaz list
NAME        MOUNTED   USED  CREATION               ORIGIN              ORG.BIEAZ:LABEL
pac-exijni  no        504K  Thu May  6 16:49 2021  default@pac-exijni  post_-U_bieaz-0.2.13-1-any.pkg.tar.zst
pac-td2kzm  no        504K  Thu May  6 16:49 2021  default@pac-td2kzm  pre__-U_bieaz-0.2.13-1-any.pkg.tar.zst
                            GNU GRUB  version 2.04

+----------------------------------------------------------------------------+
| Arch Linux                                                                 |
| Advanced options for Arch Linux                                            |
|*bieaz /sys/ROOT/default                                                    |
+----------------------------------------------------------------------------+

     Use the ^ and v keys to select which entry is highlighted.
     Press enter to boot the selected OS, `e' to edit the commands
     before booting or `c' for a command-line.
+----------------------------------------------------------------------------+
|*Boot environment menu                                                      |
| Return to default BE                                                       |
| Press Esc to return previous menu                                          |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
|*pac-exijni Thu May  6 16:49 2021: post_-U_bieaz-0.2.13-1-any.pkg.tar.zst   |
| pac-td2kzm Thu May  6 16:49 2021: pre__-U_bieaz-0.2.13-1-any.pkg.tar.zst   |
+----------------------------------------------------------------------------+

Other

unrelated information