Feature #7537

want nextboot (one time boot) support

Added by Toomas Soome about 4 years ago. Updated 19 days ago.

zfs - Zettabyte File System
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


Originally created by Andriy Gapon as

The idea is to provide an mechanism for "one time" boot config, meaning, if such config is set, the system will read and remove this config on next boot, and the followup boot will use normal (permanent) boot configuration.

The "nextboot" configuration is stored in pool label pad2 area, which is currently otherwise unused. The boot loader will read the pad2 content, and will remove the config by zeroing the pad2 area, so the next boot will not see the nextboot config and will use normal bootfs property based setup.

Since in illumos the boot environments are managed by beadm command, I don't see much need for another separate tool, so I did extent beadm activate to have two addition options, -t to set nextboot config and -T to remove it. Also beadm list and bootadm list-menu are updated to present the information.

Use case example:

root@test:/home/tsoome# beadm activate -t test
Activated successfully
root@test:/home/tsoome# beadm list
BE             Active Mountpoint Space Policy Created
multiboot-16   -      -          5,56M static 2016-10-30 23:53
multiboot-17   NR     /          106K  static 2016-11-06 13:42
test           T      -          12,6G static 2016-11-06 13:45

and after reboot:

tsoome@test:~$ beadm list
BE             Active Mountpoint Space Policy Created
multiboot-16   -      -          5,56M static 2016-10-30 23:53
multiboot-17   R      -          2,42M static 2016-11-06 13:42
test           N      /          12,7G static 2016-11-06 13:45

Some time has passed since this work was started, now the current update is based on two changes:

We are using nvlist based data encoding in bootenv area (previous pad2), we provide tooling to update nvlist from os and from boot loader. This way we can implement persistent data storage.

Loader zfs reader is updated to handle bootenv nvlist read and write, and nvlist updates (remove pair, add pair).

From OS userland, the data translation to/from nvlist is done in libzfsbootenv.

The initial publication of this change is, now also available on Gerrit.

Related issues

Related to illumos gate - Feature #13062: loader: make env_discard() publicClosedToomas Soome


Updated by Electric Monk 5 months ago

  • Gerrit CR set to 777

Updated by Toomas Soome 5 months ago

  • Description updated (diff)

Updated by Toomas Soome 3 months ago


Updated by Electric Monk 19 days ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

git commit b713c91e508f40be7797bedd4ae1146ef0652625

commit  b713c91e508f40be7797bedd4ae1146ef0652625
Author: Toomas Soome <>
Date:   2020-11-13T17:03:33.000Z

    7537 want nextboot (one time boot) support
    Reviewed by: Jason King <>
    Reviewed by: Andy Fiddaman <>
    Reviewed by: C Fraire <>
    Approved by: Dan McDonald <>

Also available in: Atom PDF