How To Use beadm to Upgrade FreeBSD installed in a ZFS Boot Environment, with minimal downtime

Listing and Creating New Boot Environments

Now we can use the beadm command to list the current boot environments, and create new ones.

# beadm list
BE      Active Mountpoint  Space Created
install NR     /          885.0M 2015-01-02 13:56

To create a new boot environment, we use the beadm create command. The new boot environment will be based on a snapshot of the source and though is identical will just consume disk space as things are changed. This one is named based on the current FreeBSD 10.1 Release Branch and patch level, combined with the last changed revision of the subversion tree, and the current date. However until I complete the build process it still contains the 10.1-RELEASE build from the DVD that the test system was built on.

#beadm create -e install 10.1-RELEASE-p3-r276159-2015.01.09
Created successfully
# beadm list
BE                                 Active Mountpoint  Space Created
install                            NR     /          885.0M 2015-01-02 13:56
10.1-RELEASE-p3-r276159-2015.01.09 -      -           47.0K 2015-01-09 12:13

Note:  -e, tells it the boot environment to use as the source. It will default to the active if not specified, I just did it here to show that it is an option.

Note:  I actually use a script to create the boot environment names based on the /usr/src tree contents and the current date. The name can be anything you would like to use.