beadm basics

dweimer dweimer at
Wed Jun 11 03:21:45 UTC 2014

On 06/10/2014 6:42 pm, freebsd at wrote:
> Nevermind I realized there needs to be a reboot between the first
> creation/activation and the installation/upgrade you are performing.
> On Tue, 10 Jun 2014, freebsd at wrote:
>> I'm trying to learn ZFS and beadm. I wanted to do a proof-of-concept, 
>> so I ran 'beadm create <instance>', then ran 'beadm activate 
>> <instance>'.
>> I then installed something from ports (in this case, zfs-stats). I 
>> reactivated the default instance in beadm and rebooted. BUt I am still 
>> seeing zfs-stats installed.
>> In my understanding of beadm, shouldn't the machine be in the state it 
>> was prior to the zfs-stats install?
>> -------------------------------------------------------------------------
>> shot through the heart              ooh baby do you know what that's 
>> worth
>> and you're to blame                         ooh heaven is a place on 
>> earth
>> darling you give love                  they say in heaven love comes 
>> first
>> a bad name                              we'll make heaven a place on 
>> earth
>> ORBITAL                                                     "Halcyon 
>> Live"
>> _______________________________________________
>> freebsd-questions at mailing list
>> To unsubscribe, send any mail to 
>> "freebsd-questions-unsubscribe at"
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"

I have been using this quite extensively since I learned it, the shorter 
down times with updates, and the ability to go back if something went 
wrong quickly has been a huge sleep saver, as I can all the work with 
the server live during normal work hours.  Then just reboot then test 
applications at night time from home after hours.

### method 1, installing ports or port updates
beadm create <instance>
beadm mount <instance> /jails/devel/ROOT
## Have a jail configured with /jails/devel/ROOT as its ROOT
## With scripts that mount /usr/ports & distfiles under jail
jail -c devel
jexec <jailid> tcsh
install new ports or updates etc...
exit jail
jail -r devel

beadm umount <instance>
beadm activate <instance>

### Method 2, building world, installing ports and updates.
### Note:  works great from P1, P2... but if going from say 9.2 to 10, 
gets a little tricky
beadm create <instance>
beadm mount <instance> /jails/devel/ROOT

setenv MAKEOBJDIRPREFIX /jails/devel/ROOT/usr/obj
setenv DESTDIR /jails/devel/ROOT
setenv __MAKE_CONF /jails/devel/ROOT/etc/make.conf
setenv SRCCONF /jails/devel/ROOT/etc/src.conf
mount -t nullfs -o ro /usr/src /jails/devel/ROOT/usr/src

cd /jails/devel/ROOT/usr/src
Do buildworld/install/mergemaster

## IF port updates are also necessary see steps above to start jail & 
update ports

unsetenv DESTDIR
unsetenv __MAKE_CONF
unsetenv SRCCONF
umount /jails/devel/ROOT/usr/src

beadm umount <instance>
beadm activate <instance>

I can provide more detailed jail configurations, and some scripts I have 
setup to simplify the process if your interested.

    Dean E. Weimer

More information about the freebsd-questions mailing list