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

Starting the jail

To start the jail, simply use the FreeBSD jail command, passing it the configuration file we just created.

/usr/sbin/jail -f /jails/devel/jail.conf -c freebsd-zfs-devel
freebsd-zfs-devel: created

Note:  -f, tells it the configuration file to use instead of the default, and -c specifies the jails name within the configuration file.

I prefer to use a script that does this for me, I have the following code saved in a file /jails/devel/ on my systems, I can simple change to the /jails/devel directory and call ./ start to start the jail and not need to type the full command. It also uses the current host name, to determine the name so I can use the script for multiple servers without editing it.

HOSTNAME=`/bin/hostname -s`
case ${1} in
   /usr/sbin/jail -f ${JAILCONF} -c ${DEVELNAME}
   /usr/sbin/jail -f ${JAILCONF} -r ${DEVELNAME}
   echo ${0}' Requires one of [start|stop]'
   echo '   start runs: /usr/sbin/jail -f '${JAILCONF}' -c '${DEVELNAME}
   echo '   stop runs:  /usr/sbin/jail -f '${JAILCONF}' -r '${DEVELNAME}