Solaris Guide.pdf - From the Library of Daniel Johnson Solaris\u2122 10 System Administration Essentials From the Library of Daniel Johnson This page

Solaris Guide.pdf - From the Library of Daniel Johnson...

This preview shows page 1 out of 448 pages.

Unformatted text preview: From the Library of Daniel Johnson Solaris™ 10 System Administration Essentials From the Library of Daniel Johnson This page intentionally left blank From the Library of Daniel Johnson Solaris 10 System Administration Essentials ™ Solaris System Engineers Sun Microsystems Press Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City From the Library of Daniel Johnson Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Sun Microsystems, Inc., has intellectual property rights relating to implementations of the technology described in this publication. In particular, and without limitation, these intellectual property rights may include one or more U.S. patents, foreign patents, or pending applications. Sun, Sun Microsystems, the Sun logo, J2ME, J2EE, Solaris, Java, Javadoc, Java Card, NetBeans, and all Sun and Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC., MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales, [email protected] Visit us on the Web: informit.com/ph Library of Congress Cataloging-in-Publication Data Solaris 10 system administration essentials / Solaris system engineers. p. cm. Includes index. ISBN 978-0-13-700009-8 (pbk. : alk. paper) 1. Electronic data processing—Management. 2. Systems software. 3. Solaris (Computer file) I. Sun Microsystems. QA76.9.M3S65 2009 005.4’3—dc22 2009034498 Copyright © 2010 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054 U.S.A. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax: (617) 671-3447 ISBN-13: 978-0-13-700009-8 ISBN-10: 0-13-700009-X Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana. First printing, November 2009 From the Library of Daniel Johnson Contents Preface About the Authors Chapter 1 Chapter 2 xvii xxi Installing the Solaris 10 Operating System 1 1.1 Methods to Meet Your Needs 1.2 The Basics of Solaris Installation 1.2.1 Installing Solaris on a SPARC System 1.2.2 Installing Solaris on an x86 System 1.3 Solaris JumpStart Installation 1.3.1 Setting up a JumpStart Server 1.3.2 Creating a Profile Server for Networked Systems 1.3.3 Performing a Custom JumpStart Installation 1.4 Upgrading a Solaris System 1.5 Solaris Live Upgrade 1 2 6 9 13 13 14 22 25 26 Boot, Service Management, and Shutdown 33 2.1 Boot 2.1.1 The Bootloader 2.1.2 The Kernel 2.1.3 User-Mode Programs 2.1.4 GRUB Extensions 33 33 34 34 35 v From the Library of Daniel Johnson vi Chapter 3 Chapter 4 Contents 2.1.5 Modifying Boot Behavior 2.1.6 Run Levels 2.1.7 Troubleshooting 2.2 Service Management Facility 2.2.1 enabled 2.2.2 state, next_state, and state_time 2.2.3 logfile 2.2.4 dependency 2.2.5 How SMF Interacts with Service Implementations 2.2.6 The Service Configuration Facility 2.2.7 Health and Troubleshooting 2.2.8 Service Manifests 2.2.9 Backup and Restore of SCF Data 2.3 Shutdown 2.3.1 Application-Specific Shutdown 2.3.2 Application-Independent Shutdown 36 37 37 39 40 40 41 41 42 44 44 45 45 46 46 46 Software Management: Packages 47 3.1 Managing Software Packages 3.2 What Is a Package? 3.2.1 SVR4 Package Content 3.2.2 Package Naming Conventions 3.3 Tools for Managing Software Packages 3.4 Installing or Removing a Software Package with the pkgadd or pkgrm Command 3.5 Using Package Commands to Manage Software Packages 3.5.1 How to Install Packages with the pkgadd Command 3.5.2 Adding Frequently Installed Packages to a Spool Directory 3.5.3 Removing Software Packages 47 47 48 49 49 50 51 51 54 56 Software Management: Patches 59 4.1 Managing Software with Patches 4.2 What Is a Patch? 4.2.1 Patch Content 4.2.2 Patch Numbering 59 59 60 61 From the Library of Daniel Johnson Contents vii 4.3 Patch Management Best Practices 4.3.1 Proactive Patch Management Strategy 4.3.2 Reactive Patch Management Strategy 4.3.3 Security Patch Management Strategy 4.3.4 Proactive Patching When Installing a New System 4.3.5 Identifying Patches for Proactive Patching and Accessing Patches 4.4 Example of Using Solaris Live Upgrade to Install Patches 4.4.1 Overview of Patching with Solaris Live Upgrade 4.4.2 Planning for Using Solaris Live Upgrade 4.4.3 How to Apply a Patch When Using Solaris Live Upgrade for the Solaris 10 8/07 Release 4.5 Patch Automation Tools 4.6 Overview of Patch Types 4.7 Patch README Special Instructions 4.7.1 When to Patch in Single-User Mode 4.7.2 When to Reboot After Applying or Removing a Patch 4.7.3 Patch Metadata for Non-Global Zones 4.8 Patch Dependencies (Interrelationships) 4.8.1 SUNW_REQUIRES Field for Patch Dependencies 4.8.2 SUNW_OBSOLETES Field for Patch Accumulation and Obsolescence 4.8.3 SUNW_INCOMPAT Field for Incompatibility Chapter 5 Solaris File Systems 61 62 68 70 71 73 75 75 77 79 86 88 93 93 94 95 96 96 97 97 99 5.1 Solaris File System Overview 5.1.1 Mounting File Systems 5.1.2 Unmounting File Systems 5.1.3 Using the /etc/vfstab File 5.1.4 Determining a File System Type 5.1.5 Monitoring File Systems 5.2 UFS File Systems 5.2.1 Creating a UFS File System 5.2.2 Backing Up and Restoring UFS File Systems 5.2.3 Using Quotas to Manage Disk Space 5.2.4 Checking File System Integrity 99 100 102 103 104 105 105 106 107 108 110 From the Library of Daniel Johnson viii Chapter 6 Contents 5.2.5 Using Access Control Lists 5.2.6 Using UFS Logging 5.2.7 Using Extended File Attributes 5.2.8 Using Multiterabyte UFS File Systems 5.2.9 Creating UFS Snapshots 5.3 ZFS File System Administration 5.3.1 Using Pools and File Systems 5.3.2 Backing Up a ZFS File System 5.3.3 Using Mirroring and Striping 5.3.4 Using RAID-Z 5.3.5 Using Copy-on-Write and Snapshots 5.3.6 Using File Compression 5.3.7 Measuring Performance 5.3.8 Expanding a Pool 5.3.9 Checking a Pool 5.3.10 Replacing a Disk 5.4 NFS File System Administration 5.4.1 Finding Available NFS File Systems 5.4.2 Mounting an NFS File System 5.4.3 Unmounting an NFS File System 5.4.4 Configuring Automatic File System Sharing 5.4.5 Automounting File Systems 5.5 Removable Media 5.5.1 Using the PCFS File System 5.5.2 Using the HSFS File System 5.6 Pseudo File System Administration 5.6.1 Using Swap Space 5.6.2 Using the TMPFS File System 5.6.3 Using the Loopback File System 112 113 115 115 115 117 118 120 121 122 122 124 124 125 126 127 127 128 129 129 130 130 133 135 136 136 136 138 139 Managing System Processes 141 6.1 Overview 6.1.1 State of a Process 6.1.2 Process Context 6.2 Monitoring the Processes 6.2.1 Process Status: ps 141 143 143 145 146 From the Library of Daniel Johnson Contents Chapter 7 ix 6.2.2 Grepping for Process: pgrep 6.2.3 Process Statistics Summary: prstat 6.2.4 Reap a Zombie Process: preap 6.2.5 Temporarily Stop a Process: pstop 6.2.6 Resuming a Suspended Process: prun 6.2.7 Wait for Process Completion: pwait 6.2.8 Process Working Directory: pwdx 6.2.9 Process Arguments: pargs 6.2.10 Process File Table: pfiles 6.2.11 Process Libraries: pldd 6.2.12 Process Tree: ptree 6.2.13 Process Stack: pstack 6.2.14 Tracing Process: truss 6.3 Controlling the Processes 6.3.1 The nice and renice Commands 6.3.2 Signals 6.4 Process Manager 6.5 Scheduling Processes 6.5.1 cron Utility 6.5.2 The at Command 149 149 151 152 152 152 152 152 153 154 154 155 156 158 158 159 164 170 171 175 Fault Management 179 7.1 Overview 7.2 Fault Notification 7.3 Displaying Faults 7.4 Repairing Faults 7.5 Managing Fault Management Log Files 7.5.1 Automatic Log Rotation 7.5.2 Manual Log Rotation 7.5.3 Log Rotation Failures 7.5.4 Examining Historical Log Files 7.6 Managing fmd and fmd Modules 7.6.1 Loading and Unloading Modules 7.6.2 fmd Statistics 7.6.3 Configuration Files 179 181 182 184 184 185 186 187 188 188 189 191 192 From the Library of Daniel Johnson x Chapter 8 Contents 7.7 Fault Management Directories 7.8 Solaris Fault Management Downloadable Resources 7.8.1 Solaris FMA Demo Kit 7.8.2 Events Registry 193 193 193 194 Managing Disks 197 8.1 Hard Disk Drive 8.2 Disk Terminology 8.3 Disk Device Naming Conventions 8.3.1 Specifying the Disk Subdirectory in Commands 8.4 Overview of Disk Management 8.4.1 Device Driver 8.4.2 Disk Labels (VTOC or EFI) 8.4.3 Disk Slices 8.4.4 Slice Arrangements on Multiple Disks 8.4.5 Partition Table 8.4.6 format Utility 8.4.7 format Menu and Command Descriptions 8.4.8 Partition Menu 8.4.9 x86: fdisk Menu 8.4.10 Analyze Menu 8.4.11 Defect Menu 8.5 Disk Management Procedures 8.5.1 How to Identify the Disks on a System 8.5.2 How to Determine If a Disk Is Formatted 8.5.3 How to Format a Disk 8.5.4 How to Identify a Defective Sector by Performing a Surface Analysis 8.5.5 How to Repair a Defective Sector 8.5.6 How to Display the Partition Table or Slice Information 8.5.7 Creating Disk Slices (Partitioning a Disk) and Labeling a Disk 8.5.8 Creating a File System On a Disk 8.5.9 Additional Commands to Manage Disks 197 199 200 202 202 202 203 205 207 208 210 211 213 214 215 217 217 218 218 219 221 222 223 224 228 229 From the Library of Daniel Johnson Contents Chapter 9 xi Managing Devices 235 9.1 Solaris Device Driver Introduction 9.2 Analyzing Lack of Device Support 9.2.1 Device Does Not Work 9.2.2 Obtaining Information About Devices 9.2.3 Obtaining Information About Drivers 9.2.4 Does the Device Have a Driver? 9.2.5 Current Driver Does Not Work 9.2.6 Can a Driver for a Similar Device Work? 9.3 Installing and Updating Drivers 9.3.1 Backing Up Current Functioning Driver Binaries 9.3.2 Package Installations 9.3.3 Install Time Updates 9.3.4 Manual Driver Binary Installation 9.3.5 Adding a Device Driver to a Net Installation Image 9.3.6 Adding a Device Driver to a CD/DVD Installation Image 9.3.7 Swapping Disks 9.4 When Drivers Hang or Panic the System 9.4.1 Device Driver Causes the System to Hang 9.4.2 Device Driver Causes the System to Panic 9.4.3 Device Driver Degrades System Performance 9.5 Driver Administration Commands and Files 9.5.1 Driver Administration Command Summary 9.5.2 Driver Administration File Summary 235 236 236 236 241 248 250 250 251 251 252 252 253 256 Chapter 10 Solaris Networking 10.1 Introduction to Network Configuration 10.1.1 Overview of the TCP/IP Networking Stack 10.1.2 Configuring the Network as Superuser 10.2 Setting Up a Network 10.2.1 Components of the XYZ, Inc. Network 10.2.2 Configuring the Sales Domain 10.2.3 Configuring the Accounting Domain 10.2.4 Configuring the Multihomed Host 262 263 266 266 268 269 270 270 272 275 275 275 277 277 277 280 283 288 From the Library of Daniel Johnson x ii Contents 10.2.5 Setting Up a System for Static Routing 10.2.6 Configuring the Corporate Domain 10.2.7 Testing the Network Configuration 10.3 Monitoring Network Performance 10.3.1 dladm Command 10.3.2 ifconfig Command 10.3.3 netstat Command 10.3.4 snoop Command 10.3.5 traceroute Command 296 300 302 304 304 305 305 307 308 Chapter 11 Solaris User Management 11.1 Solaris Users, Groups, and Roles 11.1.1 File System Object Permissions 11.1.2 User Account Components 11.1.3 User Management Tools 11.1.4 User Management Files 11.2 Managing Users and Groups 11.2.1 Starting the Solaris Management Console 11.2.2 Adding a Group and a User to Local Files 11.2.3 Adding a Group and a User to an NIS Domain 11.3 Managing Roles 11.3.1 Changing root from a User to a Role 11.3.2 Viewing the List of Roles 11.3.3 Assigning a Role to a Local User 309 Chapter 12 Solaris Zones 12.1 Overview 12.2 How Zones Work 12.3 Branded Zones 12.4 Network Interfaces in Zones 12.5 Devices in Zones 12.6 Packages and Patches in a Zones Environment 12.7 Administering Zones 12.7.1 Zone Configuration 12.7.2 Viewing a Zone Configuration 12.7.3 Zone Installation and Booting 12.7.4 Zone Login Using the zlogin Command 321 309 310 312 313 313 314 314 315 317 318 318 319 319 321 323 324 324 325 325 326 327 331 331 332 From the Library of Daniel Johnson Contents xi i i 12.8 Halting, Uninstalling, Moving, and Cloning Zones 12.9 Migrating a Zone to a New System 12.10 Deleting a Zone 12.11 Listing the Zones on a System 12.12 Zones Usage Examples 12.12.1 Adding a Dedicated Device to a Non-Global Zone 12.12.2 How to Export Home Directories in the Global Zone into a Non-Global Zone 12.12.3 Altering Privileges in a Non-Global Zone 12.12.4 Checking the Status of SMF Services 12.12.5 Modifying CPU, Swap, and Locked Memory Caps in Zones 12.12.6 Using the Dtrace Program in a Non-Global Zone Chapter 13 Using Naming Services 13.1 Using Naming Services (DNS, NIS, AND LDAP) 13.1.1 Naming Service Cache Daemon (nscd) 13.1.2 DNS Naming Services 13.1.3 NIS Naming Services 13.1.4 LDAP Naming Services 13.1.5 Organizational Use of Naming Services 13.1.6 Network Database Sources 13.2 Name Service Switch File 13.2.1 Configuring the Name Service Switch File 13.2.2 Database Status and Actions 13.3 DNS Setup and Configuration 13.3.1 Resolver Files 13.3.2 Steps DNS Clients Use to Resolve Names 13.4 NIS Setup and Configuration 13.4.1 Setting Up NIS Clients 13.4.2 Working with NIS Maps 13.5 LDAP Setup and Configuration 13.5.1 Initializing a Client Using Per-User Credentials 13.5.2 Configuring an LDAP Client 13.5.3 Using Profiles to Initialize an LDAP Client 13.5.4 Using Proxy Credentials to Initialize an LDAP Client 13.5.5 Initializing an LDAP Client Manually 333 334 336 336 337 337 337 337 338 338 339 341 341 342 342 342 343 343 344 347 347 349 350 350 350 351 351 352 356 357 359 362 362 363 From the Library of Daniel Johnson x iv Contents 13.5.6 13.5.7 13.5.8 13.5.9 13.5.10 13.5.11 Modifying a Manual LDAP Client Configuration Troubleshooting LDAP Client Configuration Uninitializing an LDAP Client Initializing the Native LDAP Client LDAP API Entry Listings Troubleshooting Name Service Information Chapter 14 Solaris Print Administration 14.1 Overview of the Solaris Printing Architecture 14.2 Key Concepts 14.2.1 Printer Categories (Local and Remote Printers) 14.2.2 Printer Connections (Directly Attached and Network Attached) 14.2.3 Description of a Print Server and a Print Client 14.3 Solaris Printing Tools and Services 14.3.1 Solaris Print Manager 14.3.2 LP Print Service 14.3.3 PostScript Printer Definitions File Manager 14.4 Network Protocols 14.4.1 Berkeley Software Distribution Protocol 14.4.2 Transmission Control Protocol 14.4.3 Internet Printing Protocol 14.4.4 Server Message Block Protocol 14. 5 Planning for Printer Setup 14. 5.1 Print Server Requirements 14. 5.2 Locating Information About Supported Printers 14. 5.3 Locating Information About Available PPD Files 14. 5.4 Adding a New PPD File to the System 14. 5.5 Adding Printers in a Naming Service 14. 5.6 Printer Support in the Naming Service Switch 14. 5.7 Enabling Network Listening Services 14.6 Setting Up Printers with Solaris Printer Manager 14.6.1 Assigning Printer Definitions 14.6.2 Starting Solaris Print Manager 14.6.3 Setting Up a New Directly Attached Printer With Solaris Print Manager 363 364 364 364 368 368 369 369 370 370 370 371 371 371 371 372 372 372 372 373 373 373 373 374 375 375 377 377 378 379 379 380 381 From the Library of Daniel Johnson Contents xv 14.6.4 Setting Up a New Network-Attached Printer with Solaris Print Manager 14.7 Setting Up a Printer on a Print Client with Solaris Print Manager 14.7.1 Adding Printer Access With Solaris Print Manager 14.8 Administering Printers by Using LP Print Commands 14.8.1 Frequently Used LP Print Commands 14.8.2 Using the lpstat Command 14.8.3 Disabling and Enabling Printers 14.8.4 Accepting or Rejecting Print Requests 14.8.5 Canceling a Print Request 14.8.6 Moving Print Requests from One Printer to Another Printer 14.8.7 Deleting a Printer 14.9 Troubleshooting Printing Problems 14.9.1 Troubleshooting No Output (Nothing Prints) 14.9.2 Checking That the Print Scheduler Is Running 14.9.3 Debugging Printing Problems 14.9.4 Checking the Printer Network Connections Index 381 385 385 385 386 386 387 387 388 389 390 392 392 393 393 394 395 From the Library of Daniel Johnson This page intentionally left blank From the Library of Daniel Johnson Preface Solaris™ 10 System Administration Essentials Solaris™ 10 System Administration Essentials is the centerpiece of the new series on Solaris system administration. It covers all of the breakthrough features of the Solaris 10 operating system in one place. Other books in the series, such as Solaris™ 10 Security Essentials and Solaris™ 10 ZFS Essentials, cover specific features and aspects of the Solaris OS in detail. Solaris™ 10 System Administration Essentials is the most comprehensive book about Solaris 10 on the market. It covers the significant features introduced with the initial release of Solaris 10 and the features, like ZFS, introduced in subsequent updates. The Solaris OS has a long history of innovation. The Solaris 10 OS is a watershed release that includes features such as:  Zones/Containers, which provide application isolation and facilitate server consolidation  ZFS, the file system that provides a new approach to managing your data with an easy administration interface  The Fault Management Architecture, which automates fault detection and resolution xv i i From the Library of Daniel Johnson x viii Preface  The Service Management Facility, a unified model for services and service management on every Solaris system  Dynamic Tracing (DTrace), for troubleshooting OS and application problems on production systems in real time The Solaris 10 OS fully supports 32-bit and 64-bit x86 platforms as well as the SPARC architecture. This book is the work of the engineers, architects, and writers who conceptualized the services, wrote the procedures, and coded the rich set of Solaris features. These authors bring a wide range of industry and academic experience to the business of creating and deploying operating systems. These are the people who know Solaris 10 best. They have collaborated to write a book...
View Full Document

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture