Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle Solaris 11 Advanced Administration Cookbook

You're reading from  Oracle Solaris 11 Advanced Administration Cookbook

Product type Book
Published in Oct 2014
Publisher
ISBN-13 9781849688260
Pages 478 pages
Edition 1st Edition
Languages
Author (1):
Alexandre Borges Alexandre Borges
Profile icon Alexandre Borges
Toc

Table of Contents (17) Chapters close

Oracle Solaris 11 Advanced Administration Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. IPS and Boot Environments 2. ZFS 3. Networking 4. Zones 5. Playing with Oracle Solaris 11 Services 6. Configuring and Using an Automated Installer (AI) Server 7. Configuring and Administering RBAC and Least Privileges 8. Administering and Monitoring Processes 9. Configuring the Syslog and Monitoring Performance Index

Mounting, unmounting, installing, and uninstalling a package in an inactive boot environment


Many times, we want to install a package in an inactive BE and later (maybe at night), boot this BE and test whether the programs are working. Furthermore, we can keep all BEs consistent with each other and have them contain the same packages without booting each one to install a new package.

Getting ready

To follow this recipe, it's necessary that we have a machine (physical or virtual) running Oracle Solaris 11; we log in to the system as the root user and open a terminal.

How to do it…

We use the following commands to install a new package into a new BE (solaris_test_1):

root@solaris11:~# mkdir /solaris_test_1
root@solaris11:~# beadm mount solaris_test_1 /solaris_test_1
root@solaris11:~# beadm list
BE               Active Mountpoint      Space  Policy Created          
--               ------ ----------      -----  ------ -------          
solaris          NR     /               25.94G static 2013-10-05 20:44 
solaris-backup-1 -      -               303.0K static 2013-10-26 22:49 
solaris-backup-a -      -               7.26G  static 2013-10-10 19:57 
solaris_test_1   -      /solaris_test_1 27.37M static 2013-11-05 22:38 

We install the package in this mounted boot environment by running the following command:

root@solaris11:~# pkg -R /solaris_test_1 install unrar
Packages to install: 1
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1           6/6      0.1/0.1  656k/s
PHASE                                          ITEMS
Installing new actions                         19/19
Updating package state database                 Done 
Updating image state                            Done 
Creating fast lookup database                   Done

The unrar package was installed into the new BE (solaris_test_1) and not into the current one (solaris). Proving this fact is easy:

root@solaris11:~# unrar
bash: unrar: command not found
root@solaris11:~#

Note

The same package can be removed using the following command:

root@solaris11:~# pkg -R /solaris_test_1 uninstall unrar

Once the unrar package has been installed, we can unmount the BE by running the following commands:

root@solaris11:~# beadm umount solaris_test_1
root@solaris11:~# beadm list
BE               Active Mountpoint Space   Policy Created          
--               ------ ---------- -----   ------ -------          
solaris          NR     /          25.94G  static 2013-10-05 20:44 
solaris-backup-1 -      -          303.0K  static 2013-10-26 22:49 
solaris-backup-a -      -          7.26G   static 2013-10-10 19:57 
solaris_test_1   -      -          122.88M static 2013-11-05 22:38 

An overview of the recipe

This neat recipe taught us how to mount an inactive boot environment and install a package into this inactive BE by using the -R option to specify the mount point.

You have been reading a chapter from
Oracle Solaris 11 Advanced Administration Cookbook
Published in: Oct 2014 Publisher: ISBN-13: 9781849688260
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}