solaris 11 exercise bootenvironments (1)

A boot environment is a bootable Oracle Solaris environment consisting of a root dataset and, optionally,
other datasets mounted underneath it. Exactly one boot environment can be active at a time.

A dataset is a generic name for ZFS entities such as clones, file systems, or snapshots. In the context
of boot environment administration, the dataset more specifically refers to the file
system specifications for a particular boot environment or snapshot.

A snapshot is a read-only image of a dataset or boot environment at a given point in time.
A snapshot is not bootable.

A clone of a boot environment is created by copying another boot environment. A clone is bootable.

Shared datasets are user-defined directories, such as /export, that contain the same mount point
in both the active and inactive boot environments. Shared datasets are located outside the root
dataset area of each boot environment.

Note - A clone of the boot environment includes everything hierarchically under the main root
dataset of the original boot environment. Shared datasets are not under the root dataset and are
not cloned. Instead, the boot environment accesses the original, shared dataset.

A boot environment's critical datasets are included within the root dataset area for that environment.

1. Create a new bootenvironment
# beadm create newbe
# beadm list
BE Active Mountpoint Space Policy Created
-- ------ ---------- ----- ------ -------
newbe - - 226.0K static 2014-02-17 17:20
solaris NR / 6.40G static 2014-02-16 14:02

2. View the new bootenvironment filesystems
# zfs list
(output skipped)
rpool/ROOT/newbe 142K 12.5G 3.35G /
rpool/ROOT/newbe/var 84K 12.5G 221M /var
(output skipped)

3. Activate the new bootenvironment
# beadm activate newbe
# beadm list
BE Active Mountpoint Space Policy Created
-- ------ ---------- ----- ------ -------
newbe R - 6.40G static 2014-02-17 17:20
solaris N / 41.0K static 2014-02-16 14:02

4. Mount the new bootenvironment.
# beadm mount newbe /newbe
Add a file to the mounted bootenvironment and reboot your system.
# touch /newbe/added
# shutdown -y -g0 -i6
Log in and check the file that you added.

5. Activate the original bootenvironment.
# beadm activate solaris
# shutdown -y -g0 -i6
Log in and destroy the new bootenvironment.
# beadm destroy newbe
Are you sure you want to destroy newbe? This action cannot be undone(y/[n]): y

6. Before installing a package, you can have a backup bootenvironment created.
First remove the telnet package and then install it again.
# pkg uninstall pkg://solaris/network/telnet
# pkg install --require-backup-be pkg://solaris/network/telnet
# beadm list | grep backup
solaris-backup-1 - - 145.0K static 2014-02-16 16:18

7. If there is no zone yet, create one.
# zonecfg -z zone1
# zonecfg -z zone2
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
create: Using system default template 'SYSdefault'
zonecfg:zone1> set zonepath=/software/zone1
zonecfg:zone1> exit
# zoneadm -z zone1 install
A ZFS file system has been created for this zone.
Progress being logged to /var/log/zones/zoneadm.20140217T224151Z.zone2.install
Image: Preparing at /software/zone2/root.

8. Create a bootenvironment in a the zone.
# zlogin zone1
# beadm create newbe
# beadm list
BE Active Mountpoint Space Policy Created
-- ------ ---------- ----- ------ -------
newbe - - 58.0K static 2014-02-17 22:30
solaris NR / 421.67M static 2014-02-17 17:08
# exit

Log in using the console of the zone.
# zlogin -C zone1
solaris console login: root
Password: *******

Change the rootpassword and then activate the new bootenvironment, and reboot.
# passwd
New Password:
Re-enter new Password:
# beadm activate newbe
# reboot

Can you use the new rootpassword to login?

This entry was posted in solaris. Bookmark the permalink.

Comments are closed.