Skip to main content

Backup/Restore Boot Environment

DISCLAIMER: The information in this guide is provided "as is" without any guarantee of completeness, accuracy, timeliness, or of the results obtained from the use of this information. The author assumes no responsibility for any errors or omissions in the content. It is meant for general information purposes only and should not be used as a substitute for professional advice. The author is not responsible for any damages caused by the use of this information. By using this guide, you agree to hold the author harmless from any and all claims, damages, or expenses that may arise from your use of the information.


Introduction

Create a ZFS Boot Evironment (BE) to rollback to if problems are encountered after an OPNsense update.


Requirements

  • ZFS Installation of OPNsense 21.7+

Instructions

In this guide, OPNsense versions 21.7.4 and 21.7.5 are used as an example. Replace these version labels accordingly.

  1. Login via SSH or access the shell via IPMI if available.

    image.png


  2. List the current boot environment(s) (BE) available:

    bectl list

    image.png

    The above example is a boot environment that has never been used before.


    The output shows that there is a BE named default with an Active status of NR.

    N = "active Now"
    R = "active on Reboot"

  3. Create a new BE and name it based on the current OPNsense version (e.g., 21.7.4):

    bectl create <new_version>
  4. Rename the current BE (e.g., default) based on the OPNsense version that is going to be applied (e.g., 21.7.5):

    bectl rename default 21.7.5
  5. In the OPNsense web UI, update to OPNsense 21.7.5. All changes will be applied to BE 21.7.5.

    However, if there are any problems, revert back to BE 21.7.4 and reboot OPNsense:

    bectl activate 21.7.4

    Use bectl list frequently to confirm the status of your boot environments. This is especially useful when setting a new active boot environment, which may be needed when rolling back to a previous BE.


    This guide covers restoring a boot environment from the shell, but it can also be restored from the OPNsense boot menu. You will only have a few seconds to select your option before the boot process continues, although you can use the <spacebar> to stop the countdown.

    image.png

     

  6. After validating the current BE (e.g., a successful OPNsense upgrade), older BE(s) may be removed:

    bectl destroy 21.7.4

Sources

 

KB Change/Issue Log

yyyy/mm/dd - Title

Issue

N/A

Solution

N/A


KB Meta

Page Includes @9#bkmrk-callout-danger-NoResponsibilityDisclaimer-5wod5ufe