Manual SA-202-S10 Rev D.1

630
System Administration for the Solaris 10 OS Part 2 Student Guide SA-202-S10 Rev D.1 D61738GC11 Edition 1.1 D65082 and D65083 Oracle University and Control Electronico, S.A. use only THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED

description

System Administration for the Solaris 10 OS Part 2

Transcript of Manual SA-202-S10 Rev D.1

Student GuideSA-202-S10 Rev D.1

D61738GC11Edition 1.1D65082 and D65083

THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCOMPUTER IS STRICTLY PROHIBITED

Oracle University and Control Electronico, S.A. use only

System Administration forthe Solaris 10 OS Part 2

Copyright 2009, 2010, Oracle and/or its affiliates. All rights reserved.DisclaimerThis document contains proprietary information, is provided under a license agreement containing restrictions on use anddisclosure, and is protected by copyright and other intellectual property laws. You may copy and print this document solely foryour own use in an Oracle training course. The document may not be modified or altered in any way. Except as expresslypermitted in your license agreement or allowed by law, you may not use, share, download, upload, copy, print, display,perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the expressauthorization of Oracle.The information contained in this document is subject to change without notice. If you find any problems in the document,please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. Thisdocument is not warranted to be error-free.

This training manual may include references to materials, offerings, or products that were previously offered by SunMicrosystems, Inc. Certain materials, offerings, services, or products may no longer be offered or provided.Oracle and itsaffiliates cannot be held responsible for any such references should they appear in the text provided.Restricted Rights NoticeIf this documentation is delivered to the U.S. Government or anyone using the documentation on behalf of the U.S.Government, the following notice is applicable:U.S. GOVERNMENT RIGHTSThe U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these training materials arerestricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.Trademark NoticeOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respectiveowners.AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced MicroDevices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are usedunder license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademarklicensed through X/Open Company, Ltd.

THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCOMPUTER IS STRICTLY PROHIBITED

Oracle University and Control Electronico, S.A. use only

Sun Microsystems, Inc. Disclaimer

THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCOMPUTER IS STRICTLY PROHIBITED

Oracle University and Control Electronico, S.A. use only

This page intentionally left blank.

THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCOMPUTER IS STRICTLY PROHIBITED

Oracle University and Control Electronico, S.A. use only

This page intentionally left blank.

About This Course .................................................................Preface-iCourse Goals............................................................................ Preface-iCourse Map.............................................................................. Preface-iiTopics Not Covered...............................................................Preface-iiiHow Prepared Are You?.......................................................Preface-ivIntroductions ........................................................................... Preface-vHow to Use Course Materials ..............................................Preface-viConventions ...........................................................................Preface-viiIcons ...............................................................................Preface-viiTypographical Conventions ..................................... Preface-viiiManaging Swap Space, Core Files and Crash Dumps..................1-1Objectives ........................................................................................... 1-1Introducing Virtual Memory............................................................ 1-2Physical RAM ............................................................................ 1-2Swap Space ............................................................................... 1-3The swapfs File System ........................................................... 1-4Paging ........................................................................................ 1-5Configuring Swap Space................................................................... 1-7Displaying the Current Swap Configuration........................ 1-7Adding Swap Space.................................................................. 1-9Removing Swap Space ........................................................... 1-10What is a Core File? ......................................................................... 1-12Why Generate a Core File? .................................................... 1-12Managing Crash Dump Behavior.................................................. 1-13The Crash Dump ..................................................................... 1-13Displaying the Current Dump Configuration .................... 1-14Changing the Crash Dump Configuration......................... 1-15Managing Core File Behavior......................................................... 1-17Core Files.................................................................................. 1-17Displaying the Current Core File Configuration................ 1-18Changing the Core File Configuration ................................ 1-20Exercise 1: Managing swap Utility Configuration....................... 1-26Preparation............................................................................... 1-26

1THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

Table of Contents

Configuring NFS .............................................................................. 2-1Objectives ........................................................................................... 2-1Introducing the Benefits of NFS....................................................... 2-2Benefits of Centralized File Access........................................ 2-3Benefits of Common Software Access.................................... 2-3Introducing the Fundamentals of the NFS DistributedFile System ....................................................................................... 2-4NFS Server................................................................................. 2-5NFS Client .................................................................................. 2-6Managing an NFS Server .................................................................. 2-7The NFS Server Files................................................................. 2-7The NFS Server Daemons ..................................................... 2-10Managing the NFS Server Daemons .................................... 2-13NFS Server Commands .......................................................... 2-15Configuring the NFS Server for Sharing Resources.......... 2-16Managing the NFS Client................................................................ 2-22NFS Client Files ....................................................................... 2-22NFS Client Daemons .............................................................. 2-23Managing the NFS Client Daemons.................................... 2-24NFS Client Commands........................................................... 2-25Configuring the NFS Client for Mounting Resources ....... 2-25Enabling NFS Server Logging........................................................ 2-31Fundamentals of NFS Server Logging................................. 2-31Configuring NFS Log Paths ................................................. 2-32Initiating NFS Logging.......................................................... 2-34Configuring the nfslogd Daemon Behavior..................... 2-35NFS Version 4 (NFSv4).................................................................... 2-36Pseudo-File System................................................................. 2-36

Administrationfor theSolaris 10 OperatingSystem, PartTHESE2eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Oracle University and Control Electronico, S.A. use only

Tasks ......................................................................................... 1-28Exercise 2: Collecting the Crash Dump and Core Dump........... 1-30Preparation............................................................................... 1-30Task 1 Using the dumpadm Command to Display theCore File Directory Location .............................................. 1-31Task 2 Using the coreadm Command to ConfigureCore File Storage Locations ................................................ 1-31Exercise Summary............................................................................ 1-33Exercise 1 Solutions: Managing swap Utility Configuration ..... 1-34Tasks and Solutions ............................................................... 1-36Exercise 2 Solutions: Collecting the Crash Dumpand Core Dump............................................................................. 1-40Preparation............................................................................... 1-40Task 1 Using the dumpadm Command to Display theCore File Directory Location ............................................. 1-41Task 2 Using the coreadm Command to ConfigureCore File Storage Locations ............................................... 1-43

Configuring AutoFS .........................................................................3-1Objectives ........................................................................................... 3-1Introducing the Fundamentals of AutoFS...................................... 3-2AutoFS File System ................................................................... 3-3The automountd Daemon....................................................... 3-4The automount Command ...................................................... 3-4Using Automount Maps ................................................................... 3-5Configuring the Master Map................................................... 3-6Identifying Mount Points for Special Maps .......................... 3-7Adding Direct Map Entries ..................................................... 3-8Adding Indirect Map Entries ................................................ 3-11Updating the Automount Maps ........................................... 3-13Stopping and Starting the Automount System................... 3-16Exercise: Using the Automount Facility ....................................... 3-18Preparation............................................................................... 3-18Tasks ......................................................................................... 3-18Exercise Summary............................................................................ 3-22Exercise Solutions: Using the Automount Facility...................... 3-23Preparation............................................................................... 3-23Tasks and Solutions ................................................................ 3-23

3THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

Strong Security ........................................................................ 2-38Compound Procedures .......................................................... 2-39Extended Attributes................................................................ 2-40File Handles ............................................................................. 2-40Delegation ................................................................................ 2-41Configuring an NFSv4 Server ............................................... 2-42Configuring an NFSv4 Client................................................ 2-43Troubleshooting NFS Errors .......................................................... 2-45The rpcbind failure Error.................................................. 2-45The server not responding Error...................................... 2-46The NFS client fails a reboot Error .......................... 2-46The service not responding Error ................................. 2-47The program not registered Error ................................. 2-47The stale NFS file handle Error...................................... 2-48The unknown host Error ....................................................... 2-48The mount point Error .......................................................... 2-48The no such file Error ...................................................... 2-49Exercise: Configuring NFS.............................................................. 2-50Preparation............................................................................... 2-50Tasks ......................................................................................... 2-50Exercise Summary............................................................................ 2-53Exercise Solutions: Configuring NFS ............................................ 2-54Preparation............................................................................... 2-54Tasks and Solutions ................................................................ 2-54

Configuring Solaris Volume Manager Software............................ 5-1Objectives ........................................................................................... 5-1Introducing Solaris Volume Manager Software Concepts .......... 5-2Logical Volume ......................................................................... 5-2Soft Partitions ............................................................................ 5-3Introducing the State Database ............................................... 5-4Introducing Hot Spares and Hot Spare Pools....................... 5-7Solaris Volume Manager Concepts ................................................. 5-8The State Database Replicas ............................................................. 5-9Creating the State Database..................................................... 5-9Configuring RAID-0 ........................................................................ 5-11RAID-0 Striped Volumes ................................................................ 5-12Creating a RAID-0 Volume ................................................... 5-13Configuring RAID-1 ........................................................................ 5-17Building a Mirror of the Root (/) File System.............................. 5-20The Scenario............................................................................ 5-21Creating the RAID-0 Volumes .............................................. 5-21Creating the RAID-1 Volume ................................................ 5-22Configuring an x86-Based System for Mirrored Failover . 5-27Unmirroring the root (/) File System ................................ 5-34Exercise: Mirroring the root (/) File System onSPARC-Based Systems ................................................................. 5-36Preparation............................................................................... 5-36Tasks ......................................................................................... 5-36Exercise Summary............................................................................ 5-40Exercise Solutions: Mirroring the root (/) File System onSPARC-Based Systems ................................................................. 5-41Preparation............................................................................... 5-41Tasks and Solutions ................................................................ 5-41Exercise: Mirroring the root (/) File System onx86/x64-Based Systems................................................................ 5-49Preparation............................................................................... 5-49Tasks ......................................................................................... 5-50Exercise Summary............................................................................ 5-54Exercise Solutions: Mirroring the root (/) File Systemon x86/x64-Based Systems .......................................................... 5-55Preparation............................................................................... 5-55Tasks and Solutions ................................................................ 5-56

Administrationfor theSolaris 10 OperatingSystem, PartTHESE4eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Oracle University and Control Electronico, S.A. use only

Describing RAID............................................................................... 4-1Objectives ........................................................................................... 4-1Introducing RAID .............................................................................. 4-2RAID 0 ........................................................................................ 4-2RAID 1 ........................................................................................ 4-5RAID 5 ...................................................................................... 4-12Storage Configurations ......................................................... 4-15

Configuring System Messaging......................................................7-1Objectives ........................................................................................... 7-1Introducing the syslog Function .................................................... 7-2The syslog Concept................................................................. 7-2The /etc/syslog.conf File .................................................. 7-3The syslogd Daemon and the m4 Macro Processor ........... 7-8Configuring the /etc/syslog.conf File..................................... 7-11Message Routing ..................................................................... 7-11Stopping and Starting the syslogd Daemon...................... 7-12Configuring syslog Messaging .................................................... 7-13Enabling TCP Tracing ............................................................ 7-13Monitoring a syslog File in Real Time ............................... 7-15Adding One-Line Entries to a System Log File ................. 7-17Exercise: Using the syslog Function and Auditing Utilities .... 7-19Preparation............................................................................... 7-19Tasks ......................................................................................... 7-19Exercise Summary............................................................................ 7-25

5THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

Configuring Role-Based Access Control (RBAC) .........................6-1Objectives ........................................................................................... 6-1Introducing RBAC Fundamentals ................................................... 6-2Key RBAC Files ......................................................................... 6-2Roles............................................................................................ 6-3Assigning Rights Profiles To Users ....................................... 6-4Assigning Rights Profiles To Roles ....................................... 6-8Assigning Roles to Users ...................................................... 6-11Using Roles ............................................................................. 6-12Authorizations.................................................................................. 6-13Assigning Authorizations..................................................... 6-16Assigning Authorizations to User Accounts ..................... 6-17Assigning Authorizations to Roles....................................... 6-18Assigning Authorizations to Rights Profiles ..................... 6-19Make root User Into a Role ............................................................. 6-20RBAC Configuration File Summary.............................................. 6-22The /etc/user_attr File...................................................... 6-22The /etc/security/prof_attr File.................................. 6-23The /etc/security/exec_attr File.................................. 6-25The /etc/security/auth_attr File................................. 6-27Exercise: Configuring RBAC .......................................................... 6-29Preparation............................................................................... 6-29Tasks ........................................................................................ 6-29Exercise Summary............................................................................ 6-31Exercise Solutions: Configuring RBAC......................................... 6-32Preparation............................................................................... 6-32Tasks and Solutions ............................................................... 6-32

Using Name Services ...................................................................... 8-1Objectives ........................................................................................... 8-1Introducing the Name Service Concept.......................................... 8-2Domain Name System (DNS) ................................................. 8-4Network Information Service (NIS) ....................................... 8-6Network Information Service Plus (NIS+) ........................... 8-8Lightweight Directory Access Protocol (LDAP) .................. 8-9Name Service Features Summary......................................... 8-11Introducing the Name Service Switch File ................................... 8-12Database Sources.................................................................... 8-14Status Codes............................................................................. 8-15Actions ...................................................................................... 8-15Configuring the Name Service Cache Daemon (nscd) .............. 8-17The nscd Daemon ................................................................... 8-17Configuring the nscd Daemon ............................................. 8-17Stopping and Starting the nscd Daemon ............................ 8-19Retrieving Name Service Information .......................................... 8-21The getent Command........................................................... 8-21Using the getent Command ............................................... 8-22Exercise: Reviewing Name Services.............................................. 8-23Preparation............................................................................... 8-23Tasks ......................................................................................... 8-23Exercise Summary............................................................................ 8-25Exercise Solutions: Reviewing Name Services ............................ 8-26Preparation............................................................................... 8-26Tasks and Solutions ................................................................ 8-26Configuring Name Service Clients ................................................. 9-1Objectives ........................................................................................... 9-1Configuring a DNS Client ................................................................ 9-2Configuring the DNS Client During Installation ................. 9-2Editing DNS Client Configuration Files ................................ 9-5Setting Up an LDAP Client............................................................... 9-7Client Authentication ............................................................... 9-7Client Profile and Proxy Account ........................................... 9-8Client Initialization ................................................................... 9-8Configuring the LDAP Client During Installation.............. 9-9Initializing the Native LDAP Client..................................... 9-12Copying the /etc/nsswitch.ldap File to the/etc/nsswitch.conf File ................................................ 9-14Listing LDAP Entries.............................................................. 9-15Unconfiguring an LDAP Client ............................................ 9-16

Administrationfor theSolaris 10 OperatingSystem, PartTHESE6eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Oracle University and Control Electronico, S.A. use only

Exercise Solutions: Using the syslog Function and AuditingUtilities............................................................................................ 7-26Preparation............................................................................... 7-26Tasks and Solutions ................................................................ 7-26

Introduction to Zones.....................................................................10-1Objectives ......................................................................................... 10-1Introducing Solaris Zones............................................................... 10-2Server Consolidation Solutions............................................. 10-2Resource Sharing..................................................................... 10-3Zone Features .......................................................................... 10-4Zone Concepts .................................................................................. 10-5Zone Types............................................................................... 10-5Zone Daemons......................................................................... 10-8Zone File Systems .................................................................. 10-9Zone Networking................................................................. 10-11Zone States ............................................................................ 10-12Configuring Zones ......................................................................... 10-14Identifying Zone Components ............................................ 10-14Allocating File System Space............................................... 10-14Using the zonecfg Command ............................................ 10-15The zonecfg Resources Parameters................................... 10-17Zone Configuration Walk-Through .................................. 10-19Viewing the Zone Configuration........................................ 10-21Using the zoneadm Command ..................................................... 10-24Verifying a Configured Zone .............................................. 10-24Installing a Configured Zone .............................................. 10-25Booting a Zone....................................................................... 10-25Halting a Zone....................................................................... 10-26Rebooting a Zone .................................................................. 10-27Logging Into and Working With the Zone........................ 10-27Moving a Zone ...................................................................... 10-29Migrating a Zone............................................................................ 10-30Pre-Validating Zone Migration.......................................... 10-32Deleting a Zone .................................................................... 10-33Installing Packages in Zones ........................................................ 10-34Packaging for Sparse and Whole Root Zones................... 10-34Listing Parameters for Packages......................................... 10-35Package Operations Possible in the Global Zone............. 10-36Package Operations Possible in a Non-Global Zone ....... 10-37Using lx Branded Zone ................................................................ 10-39Planning for lx Branded Zone............................................ 10-39

7THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

Exercise: Configuring a System to Use DNS and LDAP............ 9-17Preparation............................................................................... 9-17Tasks ......................................................................................... 9-17Exercise Summary............................................................................ 9-19Exercise Solutions: Configuring a System to Use DNS and LDAP ..9-20Preparation............................................................................... 9-20Tasks and Solutions ................................................................ 9-20

Introduction to LDAP..................................................................... 11-1Objectives ......................................................................................... 11-1

Administrationfor theSolaris 10 OperatingSystem, PartTHESE8eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Oracle University and Control Electronico, S.A. use only

Installing and Configuring an lx Branded Zone ............. 10-41Exercise 1: Configuring Zones ..................................................... 10-42Preparation............................................................................. 10-42Task 1 Creating and Installing a Non-Global Zone ...... 10-43Task 2 Administering Users and Data Within Zones ... 10-45Task 3 Installing Software Packages in Zones ............... 10-45Task 4 - Removing Zones..................................................... 10-46Exercise Summary.......................................................................... 10-47Exercise 1 Solutions: Configuring Zones.................................... 10-48Preparation............................................................................. 10-48Task 1 Creating and Installing a Non-Global Zone ...... 10-49Task 2 Administering Users and Data Within Zones ... 10-55Task 3 Installing Software Packages in Zones ................ 10-56Task 4 - Removing Zones..................................................... 10-60Exercise 2: Validating a Zone Migration Before theMigration Is Performed.............................................................. 10-62Preparation............................................................................. 10-62Task 1 - Configuring a Non-Global Zone .......................... 10-62Task 2 - Creating and Transferring Zone Manifest.......... 10-63Task 3 - Validating Zone Migration Before theActual Migration ................................................................ 10-63Exercise Summary.......................................................................... 10-64Exercise 2 Solutions: Validating a Zone Migration Before theMigration Is Performed.............................................................. 10-65Preparation............................................................................. 10-65Task 1 - Configuring a Non-Global Zone .......................... 10-65Task 2 - Creating and Transferring Zone Manifest.......... 10-66Task 3 - Validating Zone Migration Before theActual Migration ................................................................ 10-67Exercise 3: Using Solaris Containers for Linux Applications .. 10-68Preparation............................................................................. 10-68Task 1 - Configuring the lx Branded Zone....................... 10-68Task 2 - Installing the lx Branded Zone............................ 10-69Task 3 - Booting the lx Branded Zone............................... 10-69Task 4 - Logging On to the lx Branded Zone................... 10-69Exercise Summary.......................................................................... 10-70Exercise 3 Solutions: Using Solaris Containers for LinuxApplications................................................................................. 10-71Preparation............................................................................. 10-71Task 1 - Configuring the lx Branded Zone....................... 10-71Task 2 - Installing the lx Branded Zone............................ 10-72Task 3 - Booting the lx Branded Zone............................... 10-72Task 4 - Logging On to the lx Branded Zone.................. 10-73

Configuring JumpStart Installation Using the Solaris 10 OperatingSystem.............................................................................................12-1Objectives ......................................................................................... 12-1Introducing JumpStart Configurations......................................... 12-2Purpose of JumpStart ............................................................. 12-2Boot Services ............................................................................ 12-3Identification Services ............................................................ 12-5Configuration Services ........................................................... 12-7Installation Services ................................................................ 12-9Implementing a Basic JumpStart Server ..................................... 12-11Spooling the Operating System Image .............................. 12-11Editing the sysidcfg File.................................................... 12-14Running the check Script .................................................... 12-22Running the add_install_client Script........................ 12-24Booting a SPARC JumpStart Client................................... 12-27Introducing the SPARC JumpStart ClientBoot Sequence..................................................................... 12-28Exercise 1: Configuring a JumpStart Server to Support

9THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

LDAP As A Naming Service .......................................................... 11-2The Lightweight Directory Access Protocol (LDAP)......... 11-2Basic LDAP Concepts and Terminology ...................................... 11-3Defining a Directory Service ................................................. 11-4Directory Schema .................................................................... 11-4LDAP ....................................................................................... 11-7Four Defined LDAP Models................................................. 11-8LDAP Directory: Information Model................................... 11-9LDAP Entries: Naming Model ............................................ 11-10LDAP Protocol: Functional Model .................................... 11-11LDAP Request: Security Model .......................................... 11-13Defining LDAP Search Parameters .................................... 11-15Utilizing LDIF........................................................................ 11-18Default Directory Information Tree (DIT)......................... 11-19General LDAP Tools............................................................. 11-20DSMLv2 Over HTTP/SOAP ............................................... 11-22Directory Server Requirements.................................................... 11-23System Requirements ........................................................... 11-23Operating Systems and Platforms ...................................... 11-24DSEE Components................................................................ 11-25DSEE Security Features........................................................ 11-26Configuring A Client System To Use LDAP.............................. 11-27ldapclient Utility ................................................................... 11-27/etc/nsswitch.conf File ........................................................ 11-28Enabling DNS With LDAP .................................................. 11-30LDAP Service......................................................................... 11-30Verifying Basic Client-Server Communication ............... 11-32

Performing Live Upgrade Using theSolaris 10 Operating System ........................................................ 13-1Objectives ......................................................................................... 13-1Introducing Solaris Live Upgrade ................................................. 13-2Solaris Live Upgrade Process......................................................... 13-3Multiple Release Compatibility ............................................ 13-3

Administrationfor theSolaris 10 OperatingSystem, PartTHESE10eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Oracle University and Control Electronico, S.A. use only

One SPARC JumpStart Client ................................................... 12-35Preparation............................................................................. 12-35Task Summary....................................................................... 12-35Tasks ....................................................................................... 12-36Booting and Installing x86/x64 Systems Over the NetworkWith PXE ...................................................................................... 12-42What is PXE?.......................................................................... 12-42Guidelines for Booting With PXE ....................................... 12-42Establishing DHCP Services for JumpStart Clients .................. 12-43Configuring DHCP Services on a JumpStart Server........ 12-43Booting an x86/x64 JumpStart Client Using DHCP ........ 12-50Exercise 2: Configuring a JumpStart Server to SupportOne x86/x64 JumpStart Client (Demonstration).................... 12-51Preparation............................................................................. 12-51Task Summary....................................................................... 12-51Tasks ...................................................................................... 12-52Setting Up JumpStart Software Configuration Alternatives ... 12-71Setting Up a Boot-Only Server for SPARC Clients .......... 12-71Setting Up Identification Service Alternatives ................. 12-76Setting Up Configuration Service Alternatives ............... 12-81Keywords and Arguments ................................................. 12-84Examples of Profile Files..................................................... 12-86Finish Scripts......................................................................... 12-87Setting Up Installation Service Alternatives .................... 12-89New Solaris 10 Keywords............................................................. 12-92Adding Patches Using the patch Keyword..................... 12-98JumpStart Installation For A ZFS Root (/) File System.......... 12-100ZFS Root Flash Install......................................................... 12-101Creating Additional Boot Environments Using LiveUpgrade And Jumpstart .......................................................... 12-103Jumpstart And Zones .................................................................. 12-104Exercise 3: (Optional) Creating a ZFS Mirrored Root Pool.... 12-105Troubleshooting JumpStart ........................................................ 12-111Resolving Boot Problems ................................................... 12-111Resolving Identification Problems ................................... 12-114Resolving Configuration Problems .................................. 12-116Resolving Installation Problems ....................................... 12-117Resolving Begin and Finish Script Problems .................. 12-118Identifying Log Files.......................................................... 12-119

THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM 11THISCopyright2009 Sun Microsystems,Inc. All PROHIBITEDRights Reserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLY

Oracle University and Control Electronico, S.A. use only

Solaris Live Upgrade System Requirements................................ 13-4Solaris Live Upgrade Disk Space Requirements ................ 13-4Guidelines for Selecting Slices for File Systems ................. 13-5Guidelines for Selecting a Slice for the root (/)File System ............................................................................ 13-5Guidelines for Selecting a Slice for a swap File System .... 13-6Guidelines for Selecting Slices for Shareable File Systems13-7Installing Solaris Live Upgrade ............................................ 13-7Creating a Boot Environment......................................................... 13-8Live Upgrade Commands ............................................................ 13-10Example Procedure: Creating A Base Master Flash Archive .. 13-11Example Procedure: Cloning An Alternate BootEnvironment From a Running System .................................... 13-12Example Procedure: Modifying the State of the NewBoot Environment ....................................................................... 13-19Example Procedure: Creating a Differential Archive UsingLive Upgrade Boot Environments............................................ 13-21Example Procedure: Applying a Differential Flash ArchiveUsing Live Upgrade BEs........................................................... 13-23Example Procedure: Using Live Upgrade To Patch A System 13-30Upgrading by Using a JumpStart Profile ................................... 13-34Creating a Solaris Live Upgrade Profile ........................... 13-36Upgrading a Boot Environment by Using a CustomJumpStart Profile (Command-Line Interface)............... 13-38To Install a Solaris Flash Archive on a BootEnvironment (Command-Line Interface) ....................... 13-38To Install a Solaris Flash Archive With a Profile(Command-Line Interface) .............................................. 13-40Exercise: Patching and Upgrading Using SolarisLive Upgrade ............................................................................... 13-41Preparation............................................................................. 13-41Task 1 - Creating a New UFS Boot Environment ............. 13-41Task 2 - Creating a New ZFS Boot Environment ............. 13-42Task 3 - Patching a UFS Boot Environment ...................... 13-42Task 4 - Upgrading UFS Boot to ZFS Boot ........................ 13-43Task 5 - Booting to a ZFS Boot Environment .................... 13-43Exercise Summary.......................................................................... 13-44Exercise Solution: Patching and Upgrading UsingLive Upgrade ............................................................................... 13-45Preparation............................................................................. 13-45Task 1 - Creating a New UFS Boot Environment ............. 13-45Task 2 - Creating a New ZFS Boot Environment ............. 13-46Task 3 - Patching a UFS Boot Environment ...................... 13-47Task 4 - Upgrading UFS Boot to ZFS Boot ........................ 13-47Task 5 - Booting to a ZFS Boot Environment .................... 13-47

Oracle University and Control Electronico, S.A. use onlyAdministrationfor theSolaris 10 OperatingSystem, PartTHESE12eKIT MATERIALS ARESystemFOR YOURUSE IN THISCLASSROOMONLY. COPYINGeKIT2MATERIALS FROM THISCopyright 2009Sun Microsystems,Inc. All RightsReserved. Sun Learning Services, Revision D.1COMPUTERIS STRICTLYPROHIBITED

Course Goals

About This CourseCourse GoalsUpon completion of this course, you should be able to:

Configure swap space

Manage crash dumps and core files

Manage NFS server and clients

Use automount maps

Describe RAID

Manage storage volumes

Manage RBAC

Describe the syslog function and the /etc/syslog.conf file

Set up name services

Configure a DNS client and an LDAP client

Configure, install, boot, move, migrate, and delete zones

Describe basic LDAP concepts and terminology

Implement a basic JumpStart server for SPARC and x86/x64 clients

Describe booting x86/x64 systems using the Preboot ExecutionEnvironment (PXE)

Perform Live Upgrade using the Solaris 10 Operating System

THESE eKIT MATERIALS AREAboutFOR YOURUSE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS Preface-iFROM THISThis CourseCOMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Preface

Course Map

Course Map

Managing Swap Space,Crash Dumps and CoreFiles

Configuring NFS

Configuring AutoFS

Describing RAID

Configuring SolarisVolume ManagerSoftware

Configuring Role-BasedAccess Control (RBAC)

Configuring SystemMessaging

Using Name Services

Configuring NameService Clients

Introduction to Zones

Introduction to LDAP

Configuring JumpStartInstallation Using theSolaris 10 OS

Performing Live UpgradeUsing the Solaris 10 OS

THESEPreface-iieKIT MATERIALS AREFORYOUR USE INCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationforTHISthe Solaris10 OperatingParteKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

The course map enables you to see what you have accomplished andwhere you are going in reference to the course goals.

Topics Not Covered

Topics Not Covered

Software package administration Covered in SA-200-S10: SystemAdministration for the Solaris 10 Operating System, Part 1

Patch maintenance Covered in SA-200-S10: System Administrationfor the Solaris 10 Operating System, Part 1

Advanced file permissions Covered in SA-200-S10: SystemAdministration for the Solaris 10 Operating System, Part 1

Backup and recovery Covered in SA-200-S10: System Administrationfor the Solaris 10 Operating System, Part 1

Hardware or software troubleshooting Covered in ST-350: SunSystems Fault Analysis Workshop

System tuning Covered in SA-400: Solaris System PerformanceManagementDetailed shell programming Covered in SA-245: ShellProgramming for System Administrators

Detailed shell programming Covered in SA-245: Shell Programmingfor System Administrators

Detailed network administration concepts Covered inSA-300-S10: Network Administration for the Solaris 10 OperatingSystemRefer to the Sun Services catalog for specific information on coursecontent and registration.

THESE eKIT MATERIALS AREAboutFOR YOURUSE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALSPreface-iiiFROM THISThis CourseCOMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

This course does not cover the following topics. Many of these topics arecovered in other courses offered by Sun Educational Services:

How Prepared Are You?

How Prepared Are You?

Can you install and boot the Solaris 10 Operating System(Solaris 10 OS) on a stand-alone workstation?

Can you implement basic system security?

Can you add users to the system using the Solaris ManagementConsole software?

Can you use the pkgadd command to add software packages?

Can you monitor and mount file systems?

Can you manage disk devices and processes?

Can you perform backups and restorations?

THESEPreface-iveKIT MATERIALS AREFORYOUR USE INCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationforTHISthe Solaris10 OperatingParteKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

To be sure you are prepared to take this course, can you answer yes to thefollowing questions?

Introductions

Introductions

Name

Company affiliation

Title, function, and job responsibility

Experience related to topics presented in this course

Reasons for enrolling in this course

Expectations for this course

THESE eKIT MATERIALS AREAboutFOR YOURUSE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALSPreface-vFROM THISThis CourseCOMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Now that you have been introduced to the course, introduce yourself tothe other students and the instructor, addressing the following items:

How to Use Course Materials

How to Use Course Materials

Objectives You should be able to accomplish the objectives aftercompleting a portion of instructional content. Objectives supportgoals and can support other higher-level objectives.

Lecture The instructor will present information specific to theobjective of the module. This information will help you learn theknowledge and skills necessary to succeed with the activities.

Activities The activities take on various forms, such as an exercise,self-check, discussion, and demonstration. Activities are used tofacilitate the mastery of an objective.

Visual aids The instructor might use several visual aids to convey aconcept, such as a process, in a visual form. Visual aids commonlycontain graphics, animation, and video.

Note Many system administration tasks for the Solaris OS can beaccomplished in more than one way. The methods presented in thecourseware reflect recommended practices used by Sun EducationalServices.

THESEPreface-vieKIT MATERIALS AREFORYOUR USE INCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationforTHISthe Solaris10 OperatingParteKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

To enable you to succeed in this course, these course materials use alearning module that is composed of the following components:

Conventions

ConventionsThe following conventions are used in this course to represent varioustraining elements and alternative learning resources.

!

Discussion Indicates a small-group or class discussion on the currenttopic is recommended at this time.

?

Note Indicates additional information that can help students but is notcrucial to their understanding of the concept being described. Studentsshould be able to understand the concept or complete the task withoutthis information. Examples of notational information include keywordshortcuts and minor system adjustments.Caution Indicates that there is a risk of personal injury from anonelectrical hazard, or risk of irreversible damage to data, software, orthe operating system. A caution indicates that the possibility of a hazard(as opposed to certainty) might happen, depending on the action of theuser.Power user Indicates additional supportive topics, ideas, or otheroptional information.

THESE eKIT MATERIALS AREAboutFOR YOURUSE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALSFROM THISThis CoursePreface-viiCOMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Icons

Conventions

Typographical ConventionsCourier is used for the names of commands, files, directories, usernames, host names, programming code, and on-screen computer output;for example:

Courier bold is used for characters and numbers that you type; forexample:To list the files in this directory, type the following:# lsCourier italics is used for variables and command-line placeholdersthat are replaced with a real name or value; for example:To delete a file, use the rm filename command.Courier italic bold is used to represent variables whose values are tobe entered by the student as part of an activity; for example:Type chmod a+rwx filename to grant read, write, and executerights for filename.Palatino italics is used for book titles, new words or terms, or words thatyou want to emphasize; for example:Read Chapter 6 in the Users Guide.These are called class options.

THESEPreface-viiieKIT MATERIALS AREFORYOUR USE INCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationforTHISthe Solaris10 OperatingParteKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Use the ls -al command to list all files.host1# cd /home

Objectives

Managing Swap Space, Core Files andCrash DumpsObjectivesUpon completion of this module, you should be able to:

Configure swap space

Manage core file behavior

Manage crash dump behavior

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-1COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Module 1

Introducing Virtual Memory

Virtual memory combines RAM and dedicated disk storage areas knownas swap space. Virtual memory management software maps copies of fileson disk to virtual addresses. Programs use these virtual addresses ratherthan real addresses to store instructions and data. Virtual memory makesit possible for the operating system (OS) to use a large range of memory.However, the kernel must translate the virtual memory addresses intoreal address in RAM before the actual program instruction is performedon a central processing unit (CPU).

Physical RAMPhysical memory refers to the actual RAM installed on a computer. Whenworking with swap space, RAM is the most critical resource in yoursystem. The amount of physical memory varies depending on the systemthat runs the Solaris 10 OS. The code for each active process and any datarequired by each process must be mapped into physical memory beforeexecution can take place.

Virtual and Physical AddressesThe Solaris 10 OS virtual memory management system maps the files ondisk to virtual addresses in virtual memory. The virtual memorymanagement system then translates the virtual addresses into real,physical addresses in physical memory, because programs requireinstructions or data in these files. The CPU uses the data and instructionswhen they are placed in physical memory.

Anonymous Memory PagesPhysical memory pages associated with a running process can containprivate data or stack information that does not exist in any file system ondisk. Since these memory pages contain information that is not also anamed file on the disk, these pages are known as anonymous memorypages. Anonymous memory pages are backed by swap space; in otherwords, swap space is used as a temporary storage location for data whileit is swapped out of memory.

THESE1-2eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Introducing Virtual Memory

Introducing Virtual Memory

Swap Space

While the amount of physical memory in a system is constant, the use ofthe physical memory varies. Often processes conflict over which one getsaccess to physical memory space. Sometimes a process must give up someof its memory space allocation to another process. The process has someof its pages in RAM paged out. Anonymous memory pages are placed ina swap area, but unchanged file system pages are not placed in swapareas, because file system data exists as permanent storage on the disk,and can be removed from physical memory.

Swap SlicesThe primary swap space on the system is a disk slice. In the Solaris 10 OS,the default location for the primary swap space is slice 1 of the boot disk,which by default, starts at cylinder 0. You can change the default locationduring a custom installation. Each time you reboot the system, an entry inthe /etc/vfstab file determines the configuration of the swap partition.As additional swap space becomes necessary, you can configureadditional swap slices. Plan your swap slice location carefully. If you haveadditional storage space outside of the system disk, place the swap sliceon an additional drive to reduce the load on the system disk drive.

Swap FilesIt is also possible to provide additional swap space on a system by usingswap files. Swap files are files that reside on a file system, and that havebeen created using the mkfile command. These files might be useful insome cases. For example, swap files are useful when additional swapspace is required, but there are no free disk slices and reslicing a disk toadd more swap is not a practical solution. Swap files can be permanentlyincluded in the swap configuration by creating an entry for the swap filein the /etc/vfstab file.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-3COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

A systems virtual memory is a combination of the available randomaccess memory (RAM) and disk space. Portions of the virtual memory arereserved as swap space. Swap space can be defined as a temporarystorage location that is used when systems memory requirements exceedthe size of available RAM.

Introducing Virtual Memory

The swapfs File System

Because of the virtual swap space provided by the swapfs file system inthe Solaris 10 OS, there is less need for physical swap space on systemswith a large available memory. The decreased need for physical swapspace occurs because the swapfs file system provides virtual swap spaceaddresses rather than real physical swap space addresses in response toswap space allocation requests. Therefore, you need physical swap spaceon disk, only in the event that the physical RAM pages containing privatedata need to be paged out.Figure 1-1 shows that the swap space resides outside the physical RAM asa swap partition or as a swap file.

Swap Slice

Swap SpaceSwap File

RAM

Figure 1-1

Swap Space

THESE1-4eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

When the kernel runs a process, swap space for any private data or stackspace for the process must be allocated. The allocation occurs in case thestack information or private data might need to be paged out of physicalmemory, for example, if there are multiple processes contending forlimited memory space.

Introducing Virtual Memory

Paging is the transfer of selected memory pages between RAM and theswap areas. When you page private data to swap spaces, physical RAM ismade available for other processes to use. If you need the pages that werepaged out, you can retrieve them (page them in) from swap and mapthem back into physical memory. Moving these pages back into RAMmight require more paging (page outs) of other processs pages to makeroom. Swapping is the movement of all modified data memory pagesassociated with a process, between RAM and a disk.Use the pagesize command to display the size of a memory page inbytes. The default page size for SPARC-based systems running theSolaris 10 OS is 8192 bytes.# pagesize8192The default page size for Suns x86-systems is 4096 bytes.# pagesize4096You can use the Multiple Page Size Support (MPSS) service to run legacyapplications with larger memory page sizes. Using larger page sizes cansignificantly improve the performance of programs using large amountsof memory. Large pages must be mapped to addresses that are multiplesof the page size. Use the pagesize command to display all supportedpage sizes.For example, on SPARC-based systems:# pagesize -a8192655365242884194304On x86-based systems:# pagesize -a40962097152

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-5COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Paging

Introducing Virtual MemorySwapping does not typically occur in the Solaris OS. The required amountof swap space varies from system to system. The amount of availableswap space must satisfy two criteria:Swap space must be sufficient to supplement physical RAM to meetthe needs of concurrently running processes.

Swap space must be sufficient to hold a crash dump (in a singleslice), unless dumpadm(1m) has been used to specify a dump deviceoutside of swap space.

Oracle University and Control Electronico, S.A. use only

THESE1-6eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Configuring Swap Space

Configuring Swap Space

Displaying the Current Swap ConfigurationFigure 1-2 shows the relationship between the used swap space, whichconsists of allocated and reserved swap spaces, and the available swapspace.

Allocated

swap -sTotal Swap Allocation

Reserved

Memory paging affects the amountof memory allocated space

Task activation affects the amountof memory reserved space

AvailableArrow up: swap -d subtracts theamount of available swap spaceArrow down: swap -a adds theamount of available swap space

Figure 1-2

Swap Space Allocation

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-7COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

The swap command provides a method of adding, deleting, andmonitoring the swap areas used by the kernel. Swap area changes madefrom the command line are not permanent and are lost after a reboot. Tocreate permanent additions to the swap space, create an entry in the/etc/vfstab file. The entry in the /etc/vfstab file is added to the swapspace at each reboot.

Configuring Swap SpaceTo view the current swap space allocation, complete the following steps:1.

List a summary of the systems virtual swap space.

# swap -stotal: 41776k bytes allocated + 5312k reserved = 47088k used, 881536kavailable

# swap -lswapfile/dev/dsk/c0t0d0s1

List the details of the systems physical swap areas.dev swaplo blocksfree136,916 1048304 1048304

Note There can be a discrepancy in available and free swap space sizebetween the swap -s and swap -l outputs. The swap -s output doesnot take into account pre-allocated swap space that has not yet been usedby a process.The swap -l command reports values expressed in 512-byte blocks. Theswap -s command reports values expressed in Kbytes.The swaplo value reported by swap -l reflects the number of 512-byteblocks that match the system page size. The swaplo value preventspaging or swap operations in the disk blocks that might contain the diskVTOC and boot block.

THESE1-8eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

2.

Configuring Swap Space

Adding Swap SpaceWhen the swap space requirements of the system exceed the current swapspace available, you can use the following procedures to add additionalswap space to your system.

To add a swap slice, complete the following steps:1.

Edit the /etc/vfstab file to add information describing the swapslice.

# vi /etc/vfstab#devicedevice#to mountto fsck...2./dev/dsk/c1t3d0s13.

mountpoint

FStype

fsckpass

mountat boot

mountoptions

Add the following line to create the swap slice.-

-

swap

-

no

-

Use the swap -a command to add additional swap area.

# swap -a /dev/dsk/c1t3d0s1

Note When the system is subsequently rebooted, the new swap slice/dev/dsk/c1t3d0s1, is automatically included as part of the swap spaceas a result of adding the entry to the /etc/vfstab file.

Adding Swap FilesTo add a swap file, complete the following steps:1.

Identify a file system that has adequate space to create an additionalswap file, preferably on another drive.

2.

Make a directory to hold the swap file.

# mkdir -p /usr/local/swap3.

Create a 20-Mbyte swap file named swapfile in the/usr/local/swap directory.

# mkfile 20m /usr/local/swap/swapfile

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-9COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Adding Swap Slices

Configuring Swap Space4.

Add the swap file to the systems swap space.

# swap -a /usr/local/swap/swapfile5.

List the details of the modified system swap space.

6.

List a summary of the modified system swap space.

# swap -stotal: 41672k bytes allocated + 5416k reserved = 47088k used, 901200kavailable7.

To use a swap file when the system is subsequently rebooted, add anentry for the swap file in the /etc/vfstab file.

# vi /etc/vfstab#devicedevice#to mountto fsck.../usr/local/swap/swapfile

mountpoint-

FStype-

swap

fsckpass-

mountat bootno

mountoptions-

Removing Swap SpaceIf you no longer need the additional swap space, you can delete the swapspace by removing the additional swap slices and swap files.

Removing Swap SlicesTo remove a swap slice, complete the following steps:1.

Delete a swap slice from the current swap configuration.

# swap -d /dev/dsk/c1t3d0s12.

To prevent the swap slice from being configured as part of the swapconfiguration during a reboot or change of run level, edit the/etc/vfstab file, and remove the swap slice entry from the file.

THESE1-10eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

# swap -lswapfiledev swaplo blocksfree/dev/dsk/c0t0d0s1136,916 1048304 1048304/usr/local/swap/swapfile 16 40944 40944

Configuring Swap Space

Removing Swap FilesTo remove a swap file, complete the following steps:1.

Delete a swap file from the current swap configuration.

# swap -d /usr/local/swap/swapfile2.

Remove the file to free the disk space that it is occupying.

3.

To prevent the swap file from being configured as part of the swapconfiguration during a reboot or change of run level, edit the/etc/vfstab file, and remove the swap file entry.

Note The output of the df -h command shows the space used by theswap file until it is removed.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-11COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

# rm /usr/local/swap/swapfile

What is a Core File?

What is a Core File?When software encounters a fatal error, a core file is generated. For userprocesses, this is often referred to as a core dump. For the kernel, you willrefer to the resulting core file as a crash dump.

For user processes, the address space of the process contains varioussegments that include the text, data and stack of the process. The core filegenerated when the process encounters a fatal error is a snapshot of whatthe memory space of the process looked like when the error occurred.The same is true for the kernel. A fatal error in the kernel software willresult in a system crash, (typically a "panic"). The kernel core image is asnapshot of the kernels memory space when the error occurred.In both cases, a debugger must be used to examine the core file. For userprocesses, dbx(1) or mdb(1) can be used. For the kernel, mdb(1) isused to analyze the core file.

Why Generate a Core File?Core files are generated so you can perform dump analysis (userprocesses), or crash dump analysis (the kernel) and determine the rootcause of the error so the problem can be corrected. Often times the onlypossible way to debug a problem that has caused a fatal software crash isan analysis of the core file.

Benefits of Generating Core FIlesYou generate core files so that you can effectively troubleshoot softwareproblems to the root-cause of the crashes, and get problems corrected.

Drawbacks of Generating Core FilesThe only drawback to generating core files is that these files can take up agreat deal of disk space, and consequently would need to be managed.

THESE1-12eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

The core file is an on-disk file that represents the memory image of thesoftware that encountered the fatal error.

Managing Crash Dump Behavior

If a fatal operating system error occurs, the operating system prints amessage to the console, describing the error. The operating system thengenerates a crash dump by writing some of the contents of the physicalmemory to a predetermined dump device, which must be a local diskslice. You can configure the dump device by using the dumpadm command.After the operating system has written the crash dump to the dumpdevice, the system reboots. The crash dump is saved for future analysis tohelp determine the cause of the fatal error.

The Crash DumpIf the Solaris OS kernel encounters a problem that might endanger theintegrity of data or when the kernel encounters an unexpected hardwarefault, the panic routine is executed. Despite its name, a system panic is awell-controlled event where memory contents are copied to a diskpartition defined as a dump device. Whatever the cause, the crash dumpitself provides valuable information to help your support engineerdiagnose the problem.When an operating system crashes, the savecore command isautomatically executed during a boot. The savecore command retrievesthe crash dump from the dump device and then writes the crash dump toa pair of files in your file system:

The savecore command places kernel core information in the/var/crash/nodename/vmcore.X file, where nodename is the namereturned by uname -n, and X is an integer identifying the dump.

The savecore command places name list information and symboltable information in the /var/crash/nodename/unix.X file.

Note Within the crash dump directory, a file named bounds is created.The bounds file holds a number that is used as a suffix for the next dumpto be saved.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-13COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Managing Crash Dump Behavior

Managing Crash Dump BehaviorTogether, these data files form the saved crash dump. You can use thedumpadm command to configure the location of the dump device and thesavecore directory.

Displaying the Current Dump ConfigurationTo view the current dump configuration, enter the dumpadm commandwithout arguments, as shown in the following example:# dumpadmDump content:Dump device:Savecore directory:Savecore enabled:

kernel pages/dev/dsk/c0t0d0s1 (swap)/var/crash/sys-02yes

The previous example shows the set of default values:

The dump content is set to kernel memory pages only

The dump device is a swap disk partition

The directory for savecore files is set to /var/crash/sys-02

The savecore command is set to run automatically on reboot

The following example shows that the current configuration is located inthe /etc/dumpadm.conf file:# cat /etc/dumpadm.conf## dumpadm.conf## Configuration parameters for system crash dump.# Do NOT edit this file by hand -- use dumpadm(1m) instead.#DUMPADM_DEVICE=/dev/dsk/c0t0d0s1DUMPADM_SAVDIR=/var/crash/sys-02DUMPADM_CONTENT=kernelDUMPADM_ENABLE=yes

THESE1-14eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

A dump device is usually disk space that is reserved to store system crashdump information. By default, a systems dump device is configured to bea swap slice. If possible, you should configure an alternate disk partitionas a dedicated dump device to provide increased reliability for crashdumps and faster reboot time after a system failure.

Managing Crash Dump Behavior

Changing the Crash Dump Configuration

Note Perform all modifications to the crash dump configuration byusing the dumpadm command, rather than attempting to edit the/etc/dumpadm.conf file. Editing the file might result in an inconsistentsystem dump configuration.The syntax of the dumpadm command is:/usr/sbin/dumpadm [-nuy] [-c content-type] [-d dump-device][-m mink | minm | min%] [-s savecore-dir] [-r root-dir]where:-n

Modifies the dump configuration so it does not run thesavecore command automatically on reboot.

-u

Forcibly updates the kernel dump configuration based onthe contents of the /etc/dumpadm.conf file.

-y

Modifies the dump configuration so that the savecorecommand is run automatically on reboot. This is the default.

-c content-type

Specifies the contents of the crash dump. The content-typecan be kernel, all, or curproc. The curproc content typeincludes the kernel memory pages and the memory pages ofthe currently executing process.

-d dump-device

Modifies the dump configuration to use the specified dumpdevice. The dump device can be an absolute path name orswap.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-15COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

The dumpadm command manages the configuration of the operatingsystem crash dump facility.

Managing Crash Dump BehaviorCreates a minfree file in the current savecore-dir directoryindicating that the savecore command should maintain atleast the specified amount of free space in the file system inwhich the savecore-dir directory is located:

-m mink-m minm-m min%

m Indicates a positive integer suffixed with the unit m,specifying megabytes. % Indicates a percent (%) symbol, indicating that theminfree value is computed as the specified percentage ofthe total, current size of the file system that contains thesavecore-dir directory.-r root-dir

Specifies an alternative root directory relative to which thedumpadm command should create files. If the -r argument isnot specified, the default root directory / is used.

-s savecore-dir

Modifies the dump configuration to use the specifieddirectory to save files written by the savecore command. Thedefault savecore-dir directory is /var/crash/hostname,where hostname is the output of the uname -n command.

THESE1-16eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

k Indicates a positive integer suffixed with the unit k,specifying kilobytes.

Managing Core File Behavior

Managing Core File BehaviorWhen a process terminates abnormally, it typically produces a core file.You can use the coreadm command to specify the name or location of corefiles produced by abnormally terminated processes.

A core file is a point-in-time copy (snapshot) of the RAM allocated to aprocess. The copy is written to a more permanent medium, such as a harddisk. A core file is useful in analyzing why a particular program crashed.A core file is also a disk copy of the address space of a process, at a certainpoint-in-time. This information identifies items, such as the task name,task owner, priority, and instruction queue, in execution at the time thatthe core file was created.When a core file occurs, the operating system generates two possiblecopies of the core files, one copy known as the global core file and theother copy known as the per-process core file. Depending on the systemoptions in effect, one file, both files, or no files can be generated. Whengenerated, a global core file is created in mode 600 and is owned by thesuperuser. Non-privileged users cannot examine files with thesepermissions.Ordinary per-process core files are created in mode 600 under thecredentials of the process. The owner of the process can examine files withthese permissions.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-17COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Core Files

Managing Core File Behavior

Displaying the Current Core File Configuration

# coreadm1global core file pattern:2global core file content:3init core file pattern:4init core file content:5global core dumps:6per-process core dumps:7global setid core dumps:8 per-process setid core dumps:9global core dump logging:

defaultcoredefaultdisabledenableddisableddisableddisabled

Note The line numbers in the example are not part of the configuration.They are part of the example only to assist with the following descriptionof the file.Line 1 of the output identifies the name to use for core files placed in aglobal directory.Line 2 of the output identifies that the content of core files is the defaultsetting. The resultant core file contains all the process informationpertinent to debugging.Line 3 of the output identifies the default name that per-process core filesmust use. This name is set for the init process, meaning it is inherited byall other processes on the system.Line 4 of the output indicates that the init core file content is the defaultcontent structure.Line 5 indicates that global core files are disabled.Line 6 indicates that core file generation in the current working directoryof a process is enabled.Line 7 indicates that generation of global core files with setuid or setgidpermissions are disabled.

THESE1-18eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

You use the coreadm command without arguments to display the currentconfiguration.

Managing Core File BehaviorLine 8 indicates that generation of per process core files with setuid orsetgid permissions are disabled.

Caution A process that has a setuid mode presents security issues withrespect to dumping core files. The files might contain sensitiveinformation in its address space to which the current non-privilegedowner of the process should not have access. Therefore, by default,setuid core files are not generated because of this security issue.By viewing the /etc/coreadm.conf file, you can verify the sameconfiguration parameters that were displayed with the coreadmcommand.# cat /etc/coreadm.conf## coreadm.conf## Parameters for system core file configuration.# Do NOT edit this file by hand -- use coreadm(1) instead.#COREADM_GLOB_PATTERN=COREADM_GLOB_CONTENT=defaultCOREADM_INIT_PATTERN=coreCOREADM_INIT_CONTENT=defaultCOREADM_GLOB_ENABLED=noCOREADM_PROC_ENABLED=yesCOREADM_GLOB_SETID_ENABLED=noCOREADM_PROC_SETID_ENABLED=noCOREADM_GLOB_LOG_ENABLED=no

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-19COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Line 9 indicates if global core dump logging is enabled.

Managing Core File Behavior

The coreadm command allows you to control core file generationbehavior. For example, you can use the coreadm command to configure asystem so that all process core files are placed in a single system directory.The flexibility of this configuration makes it easier to track problems byexamining the core files in a specific directory whenever a process ordaemon terminates abnormally. This flexibility also makes it easy to locateand remove core files on a system.Note You should make all modifications to the coreadm configuration atthe command line by using the coreadm command instead of editing the/etc/coreadm.conf file.You can enable or disable two configurable core file paths, per-processand global, separately. If a global core file path is enabled and set to/corefiles/core, for example, then each process that terminatesabnormally produces two core files: one in the current working directory,and one in the /corefiles/core directory.Note If the directory defined in the global core file path does not exist,you must create it.Users can run the coreadm command with the -p option to specify the filename pattern for the operating system to use when generating aper-process core file.coreadm [-p pattern] [pid]...Only the root user can run the following coreadm command options toconfigure system-wide core file options.coreadm [-g pattern] [-i pattern] [-d option ... ] [-e option ... ]

THESE1-20eKIT MATERIALS AREFORYOUR USE forIN THISCLASSROOMONLY.System,COPYINGMATERIALS FROM THISSystemAdministrationthe Solaris10 OperatingPart eKIT2COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Changing the Core File Configuration

Managing Core File Behavior

The coreadm Command OptionsThe following are some options to the coreadm command.

-i pattern

Sets the per-process core file name pattern from init topattern. This option is the same as the coreadm -ppattern 1 command, except that the setting ispersistent after a reboot.

-e option

Enables the specified core file option, where option is:

global Enables core dumps by using the globalcore pattern.

process Enables core dumps by using theper-process core pattern.

global-setid Enables setid core dumps byusing the global core pattern.

proc-setid Enables setid core dumps by usingthe per-process core pattern.

log Generates a syslog (3) message when a userattempts to generate a global core file.

-d option

Disables the specified core file option; see the -eoption for descriptions of possible options. You canspecify multiple -e and -d options by using thecommand line.

-u

Updates system-wide core file options from thecontents of the configuration file /etc/coreadm.conf.If the configuration file is missing or contains invalidvalues, default values are substituted. Following theupdate, the configuration file is resynchronized withthe system core file configuration.

-g pattern

Sets the global core file name pattern to pattern. Thepattern must start with a forward slash (/), and cancontain any of the special embedded variablesdescribed in Table 1-1 on page 1-22.

THESE eKIT MATERIALS AREManagingFOR YOURUSEIN THISCLASSROOMONLY.COPYING eKIT MATERIALS FROMTHISSwapSpace,CoreFiles and CrashDumps1-21COMPUTER IS STRICTLY PROHIBITEDCopyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1

Oracle University and Control Electronico, S.A. use only

Note A regular user can only use the -p option, the superuser can useall options.

Managing Core File BehaviorSets the per-process core file name pattern to patternfor each of the specified process IDs (PIDs). The patterncan contain any of the special embedded variablesdescribed in Table 1-1 and does not have to begin witha forward slash (/). If pattern does not begin with /,it is evaluated relative to the current directory in effectwhen the process generates a core file.A non-privileged user can only apply the -p option toprocesses owned by that user. The superuser can applythe -p option to any process.-G content

Set the global core file cont