System Administration Guide - Basic Administration
System Administration Guide - Basic Administration
System Administration Guide - Basic Administration
Basic Administration
This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No
part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any.
Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.
Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S.
and other countries, exclusively licensed through X/Open Company, Ltd.
Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, AutoClient, JumpStart, Sun Ray, Sun Blade, PatchPro, Sun Cobalt,
SunOS, Solstice, Solstice AdminSuite, Solstice DiskSuite, Solaris Solve, Java, JavaStation, OpenWindows, NFS, iPlanet, Netra and Solaris are
trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under
license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks
are based upon an architecture developed by Sun Microsystems, Inc. DLT is claimed as a trademark of Quantum Corporation in the United States and
other countries.
The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the
pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a
non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs
and otherwise comply with Sun’s written license agreements.
Federal Acquisitions: Commercial Software–Government Users Subject to Standard License Terms and Conditions.
DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Copyright 2004 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits réservés.
Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la
décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans
l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative
aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun.
Des parties de ce produit pourront être dérivées du système Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux
Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd.
Sun, Sun Microsystems, le logo Sun, docs.sun.com, AnswerBook, AnswerBook2, AutoClient, JumpStart, Sun Ray, Sun Blade, PatchPro, Sun Cobalt,
SunOS, Solstice, Solstice AdminSuite, Solstice DiskSuite, Solaris Solve, Java, JavaStation, DeskSet, OpenWindows, NFS et Solaris sont des marques de
fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC
sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres
pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. Quantum Corporation riclame
DLT comme sa marque de fabrique aux Etats-Unis et dans d’autres pays.
L’interface d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît
les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie
de l’informatique. Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les
licenciés de Sun qui mettent en place l’interface d’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun.
CETTE PUBLICATION EST FOURNIE “EN L’ETAT” ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N’EST ACCORDEE, Y COMPRIS DES
GARANTIES CONCERNANT LA VALEUR MARCHANDE, L’APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION
PARTICULIERE, OU LE FAIT QU’ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE
S’APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU.
040129@7940
Contents
Preface 27
3
Using the Solaris Management Tools With RBAC (Task Map) 50
If You Are the First to Log In to the Console 51
Creating the Primary Administrator Role 51
▼ How to Create the First Role (Primary Administrator) 53
▼ How to Assume the Primary Administrator Role 53
Starting the Solaris Management Console 54
▼ How to Start the Console as Superuser or as a Role 54
Using the Solaris Management Tools in a Name Service Environment (Task
Map) 56
RBAC Security Files 56
Prerequisites for Using the Solaris Management Console in a Name Service
Environment 58
Management Scope 58
The /etc/nsswitch.conf File 58
▼ How to Create a Toolbox for a Specific Environment 59
▼ How to Add a Tool to a Toolbox 60
▼ How to Start the Solaris Management Console in a Name Service
Environment 61
Adding Tools to the Solaris Management Console 62
▼ How to Add a Legacy Tool to a Toolbox 62
▼ How to Install an Unbundled Tool 62
Troubleshooting the Solaris Management Console 63
▼ How to Troubleshoot the Solaris Management Console 63
Contents 5
Maintaining User Accounts (Task Map) 110
Solaris User Registration 111
Accessing Solaris Solve 111
Troubleshooting Solaris User Registration Problems 112
▼ How to Restart Solaris User Registration 113
▼ How To Disable User Registration 113
Contents 7
User Notification of System Down Time 170
▼ How to Determine Who Is Logged in to a System 171
▼ How to Shut Down a Server 171
▼ How to Shut Down a Standalone System 174
Turning Off Power to All Devices 176
▼ How to Turn Off Power to All Devices 176
Contents 9
▼ How to Access Removable Media on Remote Systems 241
Contents 11
▼ How to Uninstall Software (prodreg) 302
▼ How to Uninstall Damaged Software (prodreg) 306
▼ How to Reinstall Damaged Software Components (prodreg) 309
Adding and Removing Signed Packages (Task Map) 311
▼ How to Import a Trusted Certificate into the Package Keystore (pkgadm
addcert) 311
▼ How to Display Certificate Information (pkgadm listcert) 313
▼ How to Remove a Certificate (pkgadm removecert) 314
▼ How to Set Up a Proxy Server (pkgadd) 314
▼ How to Add a Signed Package (pkgadd) 315
Managing Software Packages With Package Commands (Task Map) 316
▼ How to Add Software Packages (pkgadd) 317
Adding a Software Package to a Spool Directory 320
How to List Information About All Installed Packages (pkginfo) 321
▼ How to Check the Integrity of Installed Software Packages (pkgchk) 322
Removing Software Packages 324
▼ How to Remove Software Packages (pkgrm) 324
Adding and Removing Software Packages With Admintool (Task Map) 325
▼ How to Add Software Packages With Admintool 325
▼ How to Remove Software Packages With Admintool 327
Contents 13
▼ How to Configure a SCSI Controller 367
▼ How to Configure a SCSI Device 368
▼ How to Disconnect a SCSI Controller 369
▼ SPARC: How to Connect a SCSI Controller 370
▼ SPARC: How to Add a SCSI Device to a SCSI Bus 370
▼ SPARC: How to Replace an Identical Device on a SCSI Controller 371
▼ SPARC: How to Remove a SCSI Device 372
SPARC: Troubleshooting SCSI Configuration Problems 373
▼ How to Resolve a Failed SCSI Unconfigure Operation 375
PCI Hot-Plugging With the cfgadm Command (Task Map) 375
x86: PCI Hot-Plugging With the cfgadm Command 376
▼ x86: How to Display PCI Slot Configuration Information 376
▼ x86: How to Remove a PCI Adapter Card 377
▼ x86: How to Add a PCI Adapter Card 377
x86: Troubleshooting PCI Configuration Problems 378
Reconfiguration Coordination Manager (RCM) Script Overview 379
What Is an RCM Script? 380
What Can an RCM Script Do? 380
How Does the RCM Script Process Work? 380
RCM Script Tasks 381
Application Developer RCM Script (Task Map) 381
System Administrator RCM Script (Task Map) 382
Naming an RCM Script 383
Installing or Removing an RCM Script 383
▼ How to Install an RCM Script 383
▼ How to Remove an RCM Script 384
▼ How to Test an RCM Script 384
Tape Backup RCM Script Example 385
Contents 15
▼ How to Unconfigure a USB Device 428
▼ How to Configure a USB Device 428
▼ How to Logically Disconnect a USB Device 429
▼ How to Logically Connect a USB Device 429
▼ How to Logically Disconnect a USB Device Subtree 429
▼ How to Reset a USB Device 430
▼ How to Change the Default Configuration of a Multi-Configuration USB
Device 430
Contents 17
34 SPARC: Adding a Disk (Tasks) 485
SPARC: Adding a System Disk or a Secondary Disk (Task Map) 485
SPARC: Adding a System Disk or a Secondary Disk 486
▼ SPARC: How to Connect a System Disk and Boot 486
▼ SPARC: How to Connect a Secondary Disk and Boot 487
▼ SPARC: How to Create Disk Slices and Label a Disk 488
▼ SPARC: How to Create File Systems 493
▼ SPARC: How to Install a Boot Block on a System Disk 494
Contents 19
39 Creating File Systems (Tasks) 555
Creating a UFS File System 555
Default Parameters for the newfs Command 556
▼ How to Create a UFS File System 556
Creating a Temporary File System (TMPFS) 558
▼ How to Create a TMPFS File System 558
Creating a Loopback File System (LOFS) 560
▼ How to Create an LOFS File System 560
Contents 21
Swap-Related Error Messages 612
TMPFS-Related Error Messages 612
How Swap Space Is Allocated 612
The /etc/vfstab File 613
Planning for Swap Space 613
Monitoring Swap Resources 614
Adding More Swap Space 615
Creating a Swap File 615
▼ How to Create a Swap File and Make It Available 616
Removing a Swap File From Use 617
▼ How to Remove Unneeded Swap Space 617
Contents 23
47 Backing Up Files and File Systems (Tasks) 677
Backing Up Files and File System (Task Map) 677
Preparing for File System Backups 678
▼ How to Find File System Names 678
▼ How to Determine the Number of Tapes Needed for a Full Backup 679
Backing Up a File System 679
▼ How to Backup a File System to Tape 680
Contents 25
▼ How to Extract Files From a Remote Tape Device 742
Copying Files and File Systems to Diskette 743
What You Should Know When Copying Files to Diskettes 743
▼ How to Copy Files to a Single Formatted Diskette (tar) 743
▼ How to List the Files on a Diskette (tar) 744
▼ How to Retrieve Files From a Diskette (tar) 745
How to Archive Files to Multiple Diskettes 746
Index 755
The SunOS 5.9 operating system is part of the Solaris product family, which also
includes many features, including the Solaris Common Desktop Environment (CDE).
The SunOS 5.9 operating system is compliant with AT&T’s System V, Release 4
operating system.
For the Solaris 9 release, new features interesting to system administrators are covered
in sections called What’s New in ... ? in the appropriate chapters.
Note – The Solaris operating system runs on two types of hardware, or platforms,
SPARC and x86. The Solaris operating system runs on both 64–bit and 32–bit address
spaces. The information in this document pertains to both platforms and address
spaces unless called out in a special chapter, section, note, bullet, figure, table,
example, or code example.
Note – Sun is not responsible for the availability of third-party Web sites mentioned in
this document. Sun does not endorse and is not responsible or liable for any content,
advertising, products, or other materials that are available on or through such sites or
resources. Sun will not be responsible or liable for any actual or alleged damage or
loss caused by or in connection with the use of or reliance on any such content, goods,
or services that are available on or through such sites or resources.
27
Who Should Use This Book
This book is intended for anyone responsible for administering one or more systems
running the Solaris 9 release. To use this book, you should have 1-2 years of UNIX®
system administration experience. Attending UNIX system administration training
courses might be helpful.
System Administration Guide: Basic Administration User accounts and groups, server and client support,
shutting down and booting a system, removable media,
managing software (packages and patches), disks and
devices, file systems, and backing up and restoring data
System Administration Guide: Advanced Administration Printing services, terminals and modems, system
resources (disk quotas, accounting, and crontabs),
system processes, and troubleshooting Solaris software
problems
System Administration Guide: IP Services TCP/IP networks, IPv4 and IPv6, DHCP, IP Security,
Mobile IP, and IP Network Multipathing
System Administration Guide: Naming and Directory DNS, NIS, and LDAP naming and directory services
Services (DNS, NIS, and LDAP)
System Administration Guide: Naming and Directory FNS and NIS+ naming and directory services
Services (FNS and NIS+)
System Administration Guide: Resource Management and Resource management, remote file systems, mail, SLP,
Network Services and PPP
System Administration Guide: Security Services Auditing, PAM, RBAC, and SEAM
AaBbCc123 The names of commands, files, and Edit your .login file.
directories; on-screen computer output
Use ls -a to list all files.
machine_name% you have
mail.
AaBbCc123 Book titles, new words or terms, or Read Chapter 6 in User’s Guide.
words to be emphasized.
These are called class options.
Do not save changes yet.
Preface 29
Shell Prompts in Command Examples
The following table shows the default system prompt and superuser prompt for the C
shell, Bourne shell, and Korn shell.
Shell Prompt
General Conventions
Be aware of the following conventions used in this book.
■ When following steps or using examples, be sure to type double-quotes ("), left
single-quotes (‘), and right single-quotes (’) exactly as shown.
■ The key referred to as Return is labeled Enter on some keyboards.
■ The root path usually includes the /sbin, /usr/sbin, /usr/bin, and /etc
directories, so the steps in this book show the commands in these directories
without absolute path names. Steps that use commands in other, less common,
directories show the absolute paths in the examples.
■ The examples in this book are for a basic SunOS software installation without the
Binary Compatibility Package installed and without /usr/ucb in the path.
The following table provides a brief description of each tool and where to find more
information about them.
31
TABLE 1–1 New or Changed Solaris Management Tools in the Solaris 9 Release
Solaris Management Console 1 Serves as a launching point for a This guide and the console
variety of GUI-based system online help
management tools.
Solaris Patch Manager You can use this tool to add Chapter 24
signed and unsigned patches to
your system.
1
Do not confuse this tool with Sun Management Center (SunMC). For information
about the Sun Management Center product, see
http://www.sun.com/solaris/sunmanagementcenter/docs.
AutoClient Support No No
Supported in
Supported in Solaris
Solstice Management
AdminSuite 3.0? Supported in Console 2.0?
(Solaris 8 and Solaris (Solaris 8 1/01,
Supported in Solaris 8 6/00 and Management 4/01, 7/01, 10/01,
Feature or Tool admintool? 10/00 only) Console 1.0? 2/02 only)
Supported in Solstice
Supported in Solstice AdminSuite 3.0? (Solaris
Feature or Tool Supported in admintool? AdminSuite 2.3? 2.6 only)
This table describes the commands you can use to manage RBAC from the command
line. You must be superuser or assume an equivalent role to use these commands.
These commands cannot be used to manage RBAC information in a name service
environment.
This table describes the commands you can use to manage users, groups, and RBAC
features from the command line. You must be superuser or assume an equivalent role
to use these commands. These commands cannot be used to manage user and group
information in a name service environment.
All of the commands listed in Table 1–8 are also available in previous Solaris releases.
TABLE 1–9 Descriptions for Solstice AdminSuite™ 2.3/Solstice AutoClient™ 2.1 Commands
admhostadd, admhostmod, Adds, modifies, removes, and lists Solstice AdminSuite 2.3
admhostdel, admhostls support for client and server Administration Guide and
systems set up with the Solstice AutoClient 2.1
AdminSuite software Administration Guide
admuseradd, admusermod, Adds, modifies, removes, and lists Solstice AdminSuite 2.3
admuserdel, admuserls, users and groups Administration Guide
admgroupadd, admgroupmod,
admgroupdel, admgroupls
Solaris Management Console Solaris 9 releases This guide and the console
2.1 suite of tools online help
Solaris Management Console Solaris 8 1/01, 4/01, 7/01, The Solaris Management
2.0 suite of tools 10/01, and 2/02 releases Console online help
Solaris Management Console Solaris 2.6, Solaris 7, and Solaris Easy Access Server 3.0
1.0 suite of tools Solaris 8 releases Installation Guide
AdminSuite 2.3 Solaris 2.4, Solaris 2.5, Solaris Solstice AdminSuite 2.3
2.5.1, Solaris 2.6, and Solaris 7 Administration Guide
releases
AdminSuite 3.0 Solaris 8, Solaris 8 6/00, and Solaris Easy Access Server 3.0
Solaris 8 10/00 releases Installation Guide
This chapter provides an overview of the Solaris management tools used to perform
system administration tasks. Topics include starting the Solaris Management Console
(console), setting up Role-Based Access Control (RBAC) to use with the console, and
working with the Solaris management tools in a name service environment.
You can always add tools to the existing toolbox, or you can create new toolboxes.
41
The Solaris Management Console has three primary components:
■ The Solaris Management Console Client
Called console, this is the visible interface and contains the GUI tools used to
perform management tasks.
■ The Solaris Management Console Server
This component is located either on the same machine as the console or remotely,
and provides all the back end functionality that allows management through the
console.
■ The Solaris Management Console Toolbox Editor
This application, which looks similar to the console, is used to add or modify
toolboxes, to add tools to a toolbox, or to extend the scope of a toolbox. For
example, you would add a toolbox to manage a name service domain.
For in-depth information about how RBAC works, its benefits, and how to apply those
benefits to your site, see “Role-Based Access Control (Overview)” in System
Administration Guide: Security Services.
To learn more about using RBAC with the Solaris management tools, see “Using the
Solaris Management Tools With RBAC (Task Map)” on page 50.
■ Navigation pane (at the left) – For accessing tools (or sets of tools), folders, or other
toolboxes. Icons in the navigation pane are called nodes and are expandable if they
are folders or toolboxes.
■ View pane (at the right) – For viewing information related to the node selected in
the navigation pane, shows either the contents of the selected folder, subordinate
tools, or data associated with the selected tool.
■ Information pane (at the bottom) – For displaying context-sensitive help or console
events.
Suggested Roles Uses three roles that are easily “Role-Based Access Control
configured: Primary (Overview)” in System
Administrator, System Administration Guide: Security
Administrator, and Operator. Services
These roles are appropriate for
organizations with
administrators at different
levels of responsibility whose
job capabilities roughly fit the
suggested roles.
Custom Roles You can add your own roles, “Planning for RBAC” in
depending on your System Administration Guide:
organization’s security needs. Security Services
The superuser account and roles should be used only to perform administrative tasks
to prevent indiscriminate changes to the system. The security problem associated with
the superuser account is that a user has complete access to the system even when
performing minor tasks.
In a non-RBAC environment, you can either log into the system as superuser or use
the su command to change to the superuser account. If RBAC is implemented, you
can assume roles through the console or use su and specify a role.
When you use the console to perform administration tasks, you can do one of the
following:
■ Log into the console as yourself and then supply the root user name and password.
■ Log into the console as yourself and then assume a role.
A major benefit of RBAC is that roles can be created to give limited access to specific
functions only. If you are using RBAC, you can run restricted applications by
assuming a role rather than becoming superuser.
For step-by-step instructions on creating the Primary Administrator role, see “How to
Create the First Role (Primary Administrator)” on page 53. For an overview on
configuring RBAC to use roles, see “Configuring RBAC (Task Map)” in System
Administration Guide: Security Services.
c. Log in as a user, and then change to the superuser account by using the su
command at the command line.
% su
Password: root-password
#
This method provides complete access to all system commands and tools.
a. Log in as user, and then change to a role by using the su command at the
command line.
% su role
Password: role-password
$
This method provides access to all the commands and tools the role has access
to.
Note – The information in this chapter describes how to use the console with RBAC.
RBAC overview and task information is included to show you how to initially setup
RBAC with the console.
For detailed information on RBAC and using it with other applications, see
“Role-Based Access Control (Overview)” in System Administration Guide: Security
Services.
1. Start the console If your user account is already “How to Start the Console as
set up, start the console as Superuser or as a Role”
yourself, and then log in to on page 54
the console as root. If you do
not have a user account set
up, become superuser first,
and then start the console.
2. Add a user account for Add a user account for Solaris Management Console
yourself yourself if you do not have online help
one already.
3. Create the Primary Create the Primary “How to Create the First Role
Administrator role Administrator role and add (Primary Administrator)”
yourself to this role. on page 53
4. Assume the Primary Assume the Primary “How to Assume the Primary
Administrator role Administrator role after you Administrator Role”
have created this role. on page 53
5. (Optional) Make root a role Make root a role and add “Making a Role” in System
yourself to the root role so Administration Guide: Security
that no other user can use the Services
su command to become root.
The following sections provide overview information and step-by-step instructions for
using the Solaris Management Console and the RBAC security features.
Here are the general steps, depending on whether or not you are using RBAC:
■ Without RBAC – If you choose not to use RBAC, continue working as superuser. All
other administrators will also need root access to perform their jobs.
■ With RBAC – You’ll need to do the following:
■ Set up your user account, if you do not already have one.
■ Create the role called Primary Administrator.
■ Assign the Primary Administrator right to the role you are creating.
■ Assign your user account to this role.
For step-by-step instructions on creating the Primary Administrator role, see
“How to Create the First Role (Primary Administrator)” on page 53.
For an overview on configuring RBAC to use roles, see “Configuring RBAC
(Task Map)” in System Administration Guide: Security Services.
If you are superuser, or a user assuming the Primary Administrator role, you can
define which tasks other administrators are permitted to perform. With the help of the
Add Administrative Role wizard, you can create a role, grant rights to the role, and
You are prompted for the following information when you create the Primary
Administrator role:
TABLE 2–2 Item Descriptions for Adding a Role by Using the Console
Item Description
Role Shell Selects the shell that runs when a user logs
into a terminal or console window and
assumes a role in that window.
Create a role mailing list Creates a mailing list with the same name as
the role, if checked. You can use this list to
send email to everyone assigned to the role.
Role Password and Confirm Password Sets and confirms the role password and
password.
Available Rights and Granted Rights Assigns rights to this role by choosing from
the list of Available Rights and adding them to
the list of Granted Rights.
Select a home directory Selects the home directory server where this
role’s private files will be stored.
Assign users to this role Adds specific users to the role so they can
assume the role to perform specific tasks.
For detailed information about Role-Based Access Control, and how to use roles to
create a more secure environment, see “Role-Based Access Control (Overview)” in
System Administration Guide: Security Services.
5. Create the Primary Administrator role with the Administrative Role wizard by
following these steps.
a. Identify the role name, full role name, description, role ID number, role shell,
and whether you want to create a role mailing list. Click Next.
c. Select the Primary Administrator right from the Available Rights column and
add it to Granted Rights column. Click Next.
e. Assign yourself to the list of users who can assume the role. Click Next.
If necessary, see Table 2–2 for a description of the role items.
6. Click Finish.
When you assume a role, you take on all the attributes of that role, including the
rights. At the same time, you relinquish all of your own user properties.
3. Log in to the Primary Administrator role and provide the role password.
1. Verify that you are in a window environment, such as the CDE environment.
It might take a minute or two for the console to come up the first time.
■ From the Tools menu of the CDE front panel.
■ By double-clicking a Solaris Management Console icon in CDE’s Applications
Manager or File Manager.
The Solaris Management Console window is displayed.
3. Double-click the This Computer icon under the Management Tools icon in the
Navigation pane.
A list of categories is displayed.
9. If you are logging in as yourself, backspace over the root user name. Then
supply your user ID and user password.
A list of roles you can assume is displayed.
10. Select the Primary Administrator role, or an equivalent role, and supply the role
password.
For step-by-step instructions on creating the Primary Administrator role, see “How
to Create the First Role (Primary Administrator)” on page 53.
The main tool menu is displayed.
To work with a console tool in a name service environment, you need to create a name
service toolbox, and then add the tool to that toolbox.
1. Verify prerequisites Verify you have completed “Prerequisites for Using the
the prerequisites before Solaris Management Console
attempting to use the console in a Name Service
in a name service Environment” on page 58
environment.
2. Create a toolbox for the Use the New Toolbox wizard “How to Create a Toolbox for
name service to create a toolbox for your a Specific Environment”
name service tools. on page 59
3. Add a tool to the name Add the Users tool, or any “How to Add a Tool to a
service toolbox other name service tool, to Toolbox” on page 60
your name service toolbox.
4. Select the toolbox just Select the toolbox you just “How to Start the Solaris
created created to manage name Management Console in a
service information. Name Service Environment”
on page 61
The RBAC security files in the Solaris 9 release are included in your name service so
that you can use the Solaris Management Console tools in a name service
environment.
The RBAC security files are created when you upgrade to or install the Solaris 9
release.
This table briefly describes the pre-defined security files that are installed on a Solaris
9 system.
For unusual upgrade cases, you might have to use the smattrpop command to
populate RBAC security files in the following instances:
■ When creating or modifying rights profiles, or
■ When you need to include users and roles by customizing the usr_attr file.
Set up your name service environment. System Administration Guide: Naming and
Directory Services (DNS, NIS, and LDAP)
Management Scope
The Solaris Management Console uses the term management scope to refer to the name
service environment that you want to use with the selected management tool. The
management scope choices for the Users and Computers and Networks tools are
LDAP, NIS, NIS+, or files.
The management scope that you select during a console session should correspond to
the primary name service identified in the /etc/nsswitch.conf file.
Note – You must make sure that the name service accessed from the console, which
you specify through the console Toolbox Editor, appears in the search path of the
/etc/nsswitch.conf file. If the specified name service does not appear there, the
tools might behave in unexpected ways, resulting in errors or warnings.
When using the Solaris managements tools in a name service environment, you might
impact many users with a single operation. For example, if you delete a user in the
NIS name service, that user is deleted on all systems that are using NIS.
Use the Toolbox Editor to add a new toolbox, to add tools to an existing toolbox, or to
change the scope of a toolbox. For example, to change the domain from local files to a
name service.
Note – You can start the Toolbox Editor as a normal user. However, if you plan to make
changes and save them to the default console toolbox, /var/sadm/smc/toolboxes,
you must start the Toolbox Editor as root.
4. Click Open.
The This Computer toolbox opens in the window.
7. Use the Folder wizard to add a new toolbox for your name service environment.
a. Name and Description – Provide a name in the Full Name window. Click
Next.
For example, “NIS tools” for the NIS environment.
c. Icons – Use the default value for the Icons. Click Next.
f. Add the name service master name in the Server: field, if necessary.
h. Click Finish.
The new toolbox appears in the left Navigation pane.
10. Enter the toolbox path name in the Local Toolbox Filename: dialog box. Use the
.tbx suffix.
/var/sadm/smc/toolboxes/this_computer/toolbox-name.tbx
You can also create a new toolbox, for either local management or network
management, and then add tools to the new toolbox.
a. Server Selection – Add the name service master in the Server: window. Click
Next.
b. Tools Selection – Select the tool you want to add from the Tools: window.
Click Next.
If this tool box is a name service toolbox, choose a tool you want to work in a
name service environment. For example, the Users Tools.
d. Icons – Accept the default values, unless you have created custom icons.
Click Next.
e. Management Scope – Accept the default value “Inherit from Parent.” Click
Next.
f. Tool Loading – Accept the default “Load tool when selected.” Click Finish.
6. Select Save from the Toolbox menu to save the updated toolbox.
The Local Toolbox window is displayed.
a. Be sure the system you are logged into is configured to work in a name
service environment.
3. Select the toolbox you created for the name service, which appears in the
Navigation pane.
For information on creating a toolbox for a name service, see “How to Create a
Toolbox for a Specific Environment” on page 59.
3. Open the toolbox to which you want to add the legacy application.
The toolbox selected is opened in the Toolbox Editor.
4. Select the node in the toolbox to which you want to add the legacy application.
A legacy application can be added to the top node of a toolbox or to another folder.
These packages provide the basic Solaris Management Console launcher. You must
install the SUNWCprog cluster to use the Solaris Management Console and all of its
tools.
If the console is visible and you are having trouble running the tools, it might be that
the server is not running. Or, the server might be in a problem state that can be
resolved by stopping and restarting it.
4. If the server is running and you are still having problems, stop the console
server and then restart it.
This topic map lists the chapters that provide information on managing users and
groups.
65
66 System Administration Guide: Basic Administration • April 2004
CHAPTER 4
This chapter provides guidelines and planning information for managing user
accounts and groups. This chapter also includes information about customizing the
user’s work environment.
For step-by-step instructions on managing user accounts and groups, see Chapter 5.
67
Solaris Management Console Tools Suite
The Solaris Management tools suite, available from the Solaris Management Console,
enable you to manage all user and group features. For information on using the Solaris
Management Console, see Chapter 2. For information on performing specific user and
group management tasks, see “What You Can Do With Solaris User Management
Tools” on page 78.
For information on setting up LDAP, see System Administration Guide: Naming and
Directory Services (DNS, NIS, and LDAP).
For information on managing users and groups with iPlanet Directory Server, see
iPlanet Directory Server 5.1 Administrator’s Guide at this
http://docs.sun.com/db/doc/816-2670? location.
User project information is stored in the /etc/project file, which can be stored on
the local system (files), the NIS name service, or the LDAP directory service. You can
use the Solaris Management Console to manage project information.
The /etc/project file must exist for users to log in successfully, but requires no
administration if you are not using projects.
For more information on using or setting up projects, see “Projects and Tasks” in
System Administration Guide: Resource Management and Network Services.
Component Description
User initialization files Shell scripts that control how the user’s
working environment is set up when a user
logs in to a system.
Also, when you set up a user account, you can add the user to predefined groups of
users. A typical use of groups is to set up group permissions on a file and directory,
which allows access only to users who are part of that group.
For example, you might have a directory containing confidential files that only a few
users should be able to access. You could set up a group called topsecret that
includes the users working on the topsecret project. And, you could set up the
topsecret files with read permission for the topsecret group. That way, only the
users in the topsecret group would be able to read the files.
A special type of user account, called a role, is used to give selected users special
privileges. For more information, see “Role-Based Access Control (Overview)” in
System Administration Guide: Security Services.
A user or group can be a member of one or more projects. A project is an identifier that
is used to chargeback system resources. For information on using projects, see
“Projects and Tasks” in System Administration Guide: Resource Management and Network
Services.
Name Services
If you are managing user accounts for a large site, you might want to consider using a
name or directory service such as LDAP, NIS, or NIS+. A name or directory service
enables you to store user account information in a centralized manner instead of
storing user account information in every system’s /etc files. When using a name or
directory service for user accounts, users can move from system to system using the
same user account without having site-wide user account information duplicated on
every system. Using a name or directory service also promotes centralized and
consistent user account information.
Keep the following guidelines in mind when creating user or role names:
■ Be unique within your organization, which might span multiple domains
■ Contain from two to eight letters and numerals. The first character should be a
letter and at least one character should be a lowercase letter.
Even though user names can include a period (.), underscore (_), or hyphen (-), using
these characters is not recommended because they can cause problems with some
software products.
Consider establishing a standard way of assigning user names so they are easier for
you to track. Also, names should be easy for users to remember. A simple scheme
when selecting a user name is to use the first name initial and first seven letters of the
user’s last name. For example, Ziggy Ignatz becomes zignatz. If this scheme results
in duplicate names, you can use the first initial, middle initial, and the first six
characters of the user’s last name. For example, Ziggy Top Ignatz becomes ztignatz.
If this scheme still results in duplicate names, consider using the following scheme:
■ The first initial, middle initial, first five characters of the user’s last name,
■ and the number 1, or 2, or 3, and so on, until you have a unique name.
User ID Numbers
Associated with each user name is a user identification (UID) number. The user UID
identifies the user name to any system on which the user attempts to log in. And, the
user UID is used by systems to identify the owners of files and directories. If you
create user accounts for a single individual on a number of different systems, always
use the same user name and user ID. In that way, the user can easily move files
between systems without ownership problems.
UID numbers must be a whole number less than or equal to 2147483647. UID numbers
are required for both regular user accounts and special system accounts. The following
table lists the UID numbers reserved for user accounts and system accounts.
Although UID numbers 0 through 99 are reserved, you can add a user with one of
these numbers. However, do not use 0 through 99 for regular user accounts. By
definition, root always has UID 0, daemon has UID 1, and pseudo-user bin has UID 2.
In addition, you should give uucp logins and pseudo user logins, like who, tty, and
ttytype, low UIDs so they fall at the beginning of the passwd file.
As with user (login) names, you should adopt a scheme to assign unique UIDs. Some
companies assign unique employee numbers, and administrators add a number to the
employee number to create a unique UID number for each employee.
To minimize security risks, you should avoid reusing the UIDs from deleted accounts.
If you must reuse a UID, “wipe the slate clean” so the new user is not affected by
attributes set for a former user. For example, a former user might have been denied
access to a printer by being included in a printer deny list, but that attribute might not
be appropriate for the new user.
However, UIDs and GIDs over 60000 do not have full functionality and are
incompatible with many Solaris features, so avoid using UIDs or GIDs over 60000.
The following table describes interoperability issues with Solaris products and
previous Solaris releases.
NFS™ SunOS™ 4.0 NFS NFS server and client code truncates large
Interoperability software and UIDs and GIDs to 16 bits. This situation can
compatible releases create security problems if systems running
SunOS 4.0 and compatible releases are used in
an environment where large UIDs and GIDs
are being used. Systems running SunOS 4.0
and compatible releases require a patch to
avoid this problem.
Name Service NIS name service and Users with UIDs greater than 60000 can log in
Interoperability file-based name service or use the su command on systems running
the Solaris 2.5 and compatible releases, but
their UIDs and GIDs will be set to 60001
(nobody).
NIS+ name service Users with UIDs greater than 60000 are
denied access on systems running Solaris 2.5
and compatible releases and the NIS+ name
service.
60003 or greater ■ Users in this category logging into systems running Solaris 2.5
and compatible releases and the NIS or files name service get
a UID and GID of nobody.
65535 or greater ■ Systems running Solaris 2.5 and compatible releases with the
NFS version 2 software see UIDs in this category truncated to
16 bits, creating possible security problems.
■ Users in this category using the cpio command with the
default archive format to copy a file see an error message for
each file. And, the UIDs and GIDs are set to nobody in the
archive.
■ SPARC based systems: Users in this category running SunOS
4.0 and compatible applications see EOVERFLOW returns from
some system calls, and their UIDs and GIDs are mapped to
nobody.
■ x86 based systems: Users in this category running
SVR3-compatible applications will probably see EOVERFLOW
return codes from system calls.
■ x86 based systems: If users in this category attempt to create a
file or directory on a mounted System V file system, the
System V file system returns an EOVERFLOW error.
262144 or greater ■ Users in this category using the cpio command with the -H
odc format or the pax -x cpio command to copy files see
an error message returned for each file. And, the UIDs and
GIDs are set to nobody in the archive.
1000000 or greater ■ Users in this category using the ar command have their UIDs
and GIDs set to nobody in the archive.
2097152 or greater ■ Users in this category using the tar command, the cpio -H
ustar command, or the pax -x tar command have their
UIDs and GIDs set to nobody.
Passwords
You can specify a password for a user when you add the user. Or, you can force the
user to specify a password when the user first logs in. User passwords must comply
with the following syntax:
■ Password length must at least match the value identified by the PASSLENGTH
variable in the /etc/default/passwd file. By default, PASSLENGTH is set to 6.
■ The first 6 characters of the password must contain at least two alphabetic
characters and have at least one numeric or special character.
To make your computer systems more secure, ask users to change their passwords
periodically. For a high level of security, you should require users to change their
passwords every six weeks. Once every three months is adequate for lower levels of
security. System administration logins (such as root and sys) should be changed
monthly, or whenever a person who knows the root password leaves the company or
is reassigned.
Password Aging
If you are using NIS+ or the /etc files to store user account information, you can set
up password aging on a user’s password. Starting in the Solaris 9 12/02 release,
password aging is also supported in the LDAP directory service.
Password aging enables you to force users to change their passwords periodically or
to prevent a user from changing a password before a specified interval. If you want to
prevent an intruder from gaining undetected access to the system by using an old and
inactive account, you can also set a password expiration date when the account
becomes disabled. You can set password aging attributes with the passwd command
or the Solaris Management Console’s Users Tool.
A home directory can be located either on the user’s local system or on a remote file
server. In either case, by convention the home directory should be created as
/export/home/username. For a large site, you should store home directories on a
server. Use a separate file system for each /export/homen directory to facilitate
backing up and restoring home directories. For example, /export/home1,
/export/home2.
Regardless of where their home directory is located, users usually access their home
directories through a mount point named /home/username. When AutoFS is used to
mount home directories, you are not permitted to create any directories under the
/home mount point on any system. The system recognizes the special status of /home
when AutoFS is active. For more information about automounting home directories,
see “Task Overview for Autofs Administration” in System Administration Guide:
Resource Management and Network Services.
To use the home directory anywhere on the network, you should always refer to the
home directory as $HOME, not as /export/home/username. The latter is
machine-specific. In addition, any symbolic links created in a user’s home directory
should use relative paths (for example, ../../../x/y/x), so the links will be valid
no matter where the home directory is mounted.
A good strategy for managing the user’s work environment is to provide customized
user initialization files, such as .login, .cshrc, .profile, in the user’s home
directory. For detailed information about customizing user initialization files for users,
see “Customizing a User’s Work Environment” on page 88. After you create the
customized user initialization files, you can add them to a user’s home directory when
you create a new user account.
A recommended one-time task is to set up skeleton directories on a server. You can use
the same server where the user’s home directories are stored. The skeleton directories
enable you to store customized user initialization files for different types of users.
Another way to customize user accounts is through role-based access control. See
“Role-Based Access Control (Overview)” in System Administration Guide: Security
Services for more information.
Each group must have a name, a group identification (GID) number, and a list of user
names that belong to the group. A GID identifies the group internally to the system.
The two types of groups that a user can belong to are:
■ Primary group – Specifies a group that the operating system assigns to files created
by the user. Each user must belong to a primary group.
■ Secondary groups – Specifies one or more groups to which a user also belongs.
Users can belong to up to 15 secondary groups.
Sometimes a user’s secondary group is not important. For example, ownership of files
reflect the primary group, not any secondary groups. Other applications, however,
might rely on a user’s secondary memberships. For example, a user has to be a
member of the sysadmin group (group 14) to use the Admintool software, but it
doesn’t matter if group 14 is his or her current primary group.
The groups command lists the groups that a user belongs to. A user can have only
one primary group at a time. However, a user can temporarily change the user’s
primary group, with the newgrp command, to any other group in which the user is a
member.
This table describes the tasks you can do with Users Tool’s User Accounts feature.
Add a user You can add a user to the local “What Are User Accounts and
system or name service. Groups?” on page 69 and
“Guidelines for Managing User
Accounts” on page 70
Add a user with a user You can add a user with a Same as above
template template so that user attributes
are pre-defined.
Set up user properties You can set up user properties in Same as above
advance of adding users such as
whether a user template is used
when adding a user and whether
the home directory or mail box is
deleted by default when
removing a user.
Add multiple users You can add multiple users to the Same as above
local system or name service by
specifying a text file, typing each
name, or automatically
generating a series of user names.
View or change user You can view or change user Same as above
properties properties like login shell,
password, or password options.
Assign rights to users You can assign rights to users Same as above
that will allow them to perform
specific administration tasks.
Remove a user You can remove the user from the Same as above
local system or the name service
and optionally specify whether
the user’s home directory or mail
is removed. The user is also
removed from any groups or
roles.
Grant a right You can grant a user a right to “RBAC Rights Profiles” in
run a specific command or System Administration Guide:
application that was previously Security Services
only available to an
administrator.
View or change existing You can view or change existing Same as above
rights Properties rights.
Add an administrative You can add a role that someone “RBAC Roles” in System
role would use to perform a specific Administration Guide: Security
administrative task. Services
Task Description
Add a group Add a group to the local system “Guidelines for Managing
or name service so that the group Groups” on page 76
name is available before you add
the user.
Add a user to a group Add a user to a group if the user Same as above
needs access to group-owned
files.
Remove a user from a You can remove a user from a Same as above
group group if the user no longer
requires group file access.
Create or clone a project You can create a new project or Solaris Management Console
clone an existing project if it has online help
attributes similar to what you
need for the new project.
Modify or view project You can view or change existing Solaris Management Console
attributes project attributes. online help
Create a mailing list You can create a mailing list, Solaris Management Console
which is a list of names for online help
sending email messages.
Change a mailing list You can make changes to the Solaris Management Console
name mailing list after it is created. online help
Remove a mailing list You can remove a mailing list if Solaris Management Console
it is no longer used. online help
If you do use the Users Tool to change a user name, the home directory’s ownership is
changed, if a home directory exists for the user.
One part of a user account that you can change is a user’s group memberships. Select
Properties from Users Tool’s Action menu to add or delete a user’s secondary groups.
Alternatively, you can use the Groups Tool to directly modify a group’s member list.
You can customize the user initialization templates in the /etc/skel directory and
then copy them to users’ home directories.
Administer Passwords
You can use Users Tool for password administration, which includes the following
capabilities:
■ Specifying a normal password for a user account
■ Enabling users to create their own passwords during their first login
■ Disabling or locking a user account
■ Specifying expiration dates and password aging information.
You can also enter an expiration date in the account availability section of the User
Properties screen to set a limit on how long the account is active.
Other ways to disable a user account is to set up password aging or to change the
user’s password.
Note – To avoid confusion, the location of the user account and group information is
generically referred to as a file rather than as a database, table or map.
Most of the user account information is stored in the passwd file. However, password
encryption and password aging is stored in the passwd file when using NIS or NIS+
and in the /etc/shadow file when using /etc files. Password aging is not available
when using NIS.
For example:
kryten:x:101:100:Kryten Series 4000 Mechanoid:/export/home/kryten:/bin/csh
username Contains the user or login name. User names should be unique
and consist of 1-8 letters (A-Z, a-z) and numerals (0-9). The first
character must be a letter, and at least one character must be a
lowercase letter.
comment Usually contains the full name of the user. This field is
informational only. It is sometimes called the GECOS field
because it was originally used to hold the login information
needed to submit batch jobs to a mainframe running GECOS
(General Electric Computer Operating System) from UNIX
systems at Bell Labs.
For example:
rimmer:86Kg/MNT/dGu.:8882:0::5:20:8978
lastchg Indicates the number of days between January 1, 1970, and the
last password modification date.
expire Contains the absolute date when the user account expires. Past
this date, the user cannot log in to the system.
For example:
bin::2:root,bin,daemon
group-name Contains the name assigned to the group. For example, members of
the chemistry department in a university might be called chem. Group
names can have a maximum of eight characters.
gid Contains the group’s GID number. It must be unique on the local
system, and should be unique across the entire organization. Each GID
number must be a whole number between 0 and 60002. Numbers
under 100 are reserved for system default group accounts. User
defined groups can range from 100 to 60000. 60001 and 60002 are
reserved and assigned to nobody and noaccess, respectively.
The Solaris environment provides default user initialization files for each shell in the
/etc/skel directory on each system, as shown in the following table.
C /etc/skel/local.login
/etc/skel/local.cshrc
You can use these files as a starting point and modify them to create a standard set of
files that provide the work environment common to all users. Or, you can modify
them to provide the working environment for different types of users. For step-by-step
instructions on how to create sets of user initialization files for different types of users,
see “How to Customize User Initialization Files” on page 103.
When you use the Users Tool to create a new user account and select the create home
directory option, the following files are created, depending on which login shell is
selected:
Bourne and The /etc/skel/local.profile file is copied into the user’s home
Korn directory and renamed .profile.
When you reference a site initialization file in a user initialization file, all updates to
the site initialization file are automatically reflected when the user logs in to the
system or when a user starts a new shell. Site initialization files are designed for you
to distribute site-wide changes to users’ work environments that you did not
anticipate when you added the users.
Any customization that can be done in a user initialization file can be done in a site
initialization file. These files typically reside on a server, or set of servers, and appear
as the first statement in a user initialization file. Also, each site initialization file must
be the same type of shell script as the user initialization file that references it.
To reference a site initialization file in a C-shell user initialization file, place a line
similar to the following at the beginning of the user initialization file:
source /net/machine-name/export/site-files/site-init-file
Shell Features
The following table lists basic shell features that each shell provides, which can help
you determine what you can and can’t do when creating user initialization files for
each shell.
Shell Environment
A shell maintains an environment that includes a set of variables defined by the
login program, the system initialization file, and the user initialization files. In
addition, some variables are defined by default. A shell can have two types of
variables:
■ Environment variables – Variables that are exported to all processes spawned by
the shell. Their settings can be seen with the env command. A subset of
environment variables, like PATH, affects the behavior of the shell itself.
In the C shell, you use the lowercase names with the set command to set shell
variables and use uppercase names with the setenv command to set environment
variables. If you set a shell variable, the shell sets the corresponding environment
variable and vice versa. For example, if you update the path shell variable with a new
path, the shell also updates the PATH environment variable with the new path.
In the Bourne and Korn shells, you can use the uppercase variable name equal to some
value to set both shell and environment variables. You also have to use the export
command to activate the variables for any subsequently executed commands.
For all shells, you generally refer to shell and environment variables by their
uppercase names.
In a user initialization file, you can customize a user’s shell environment by changing
the values of the predefined variables or by specifying additional variables. The
following table shows how to set environment variables in a user initialization file.
The following table describes environment and shell variables that you might want to
customize in a user initialization file. For more information about variables that are
used by the different shells, see sh(1), ksh(1), or csh(1).
Variable Description
CDPATH, or cdpath Sets a variable used by the cd command. If the target directory of the cd
in the C shell command is specified as a relative path name, the cd command first
looks for the target directory in the current directory (“.”). If the target is
not found, the path names listed in the CDPATH variable are searched
consecutively until the target directory is found and the directory
change is completed. If the target directory is not found, the current
working directory is left unmodified. For example, the CDPATH variable
is set to /home/jean, and two directories exist under /home/jean,
bin and rje. If you are in the /home/jean/bin directory and type cd
rje, you change directories to /home/jean/rje, even though you do
not specify a full path.
LOGNAME Defines the name of the user currently logged in. The default value of
LOGNAME is set automatically by the login program to the user name
specified in the passwd file. You should only need to refer to, not reset,
this variable.
PATH, or path in the Specifies, in order, the directories that the shell searches to find the
C shell program to run when the user types a command. If the directory is not
in the search path, users must type the complete path name of a
command.
The default PATH is automatically defined and set as specified in
.profile (Bourne or Korn shell) or .cshrc (C shell) as part of the
login process.
The order of the search path is important. When identical commands
exist in different locations, the first command found with that name is
used. For example, suppose that PATH is defined in Bourne and Korn
shell syntax as PATH=/bin:/usr/bin:/usr/sbin:$HOME/bin and a
file named sample resides in both /usr/bin and /home/jean/bin. If
the user types the command sample without specifying its full path
name, the version found in /usr/bin is used.
PS1 Defines the shell prompt for the Bourne or Korn shell.
SHELL, or shell in Sets the default shell used by make, vi, and other tools.
the C shell
TERMINFO Specifies the path name for an unsupported terminal that has been
added to the terminfo file. Use the TERMINFO variable in
/etc/profile or /etc/.login.
When the TERMINFO environment variable is set, the system first checks
the TERMINFO path defined by the user. If it does not find a definition
for a terminal in the TERMINFO directory defined by the user, it searches
the default directory, /usr/share/lib/terminfo, for a definition. If
the system does not find a definition in either location, the terminal is
identified as “dumb.”
TERM, or term in the Defines the terminal. This variable should be reset in /etc/profile or
C shell /etc/.login. When the user invokes an editor, the system looks for a
file with the same name as the definition of this environment variable.
The system searches the directory referenced by TERMINFO to determine
the terminal characteristics.
TZ Sets the time zone, which is used to display dates, for example, in the ls
-l command. If TZ is not set in the user’s environment, the system
setting is used. Otherwise, Greenwich Mean Time is used.
A default path is set by the system, but most users modify it to add other command
directories. Many user problems related to setting up the environment and accessing
the right version of a command or a tool can be traced to incorrectly defined paths.
In a Bourne- or Korn-shell user initialization file, you would add the following:
PATH=.:/usr/bin:/$HOME/bin:/net/glrr/files1/bin
export PATH
Locale Variables
The LANG and LC environment variables specify the locale-specific conversions and
conventions for the shell, like time zones, collation orders, and formats of dates, time,
currency, and numbers. In addition, you can use the stty command in a user
initialization file to set whether the terminal session will support multibyte characters.
LANG sets all possible conversions and conventions for the given locale. If you have
special needs, you can set various aspects of localization separately through these LC
variables: LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, LC_MONETARY,
and LC_TIME.
The following table describes some of the values for the LANG and LC environment
variables.
Value Locale
de_DE.ISO8859-1 German
es_ES.ISO8859-1 Spanish
fr_FR.ISO8859-1 French
it_IT.ISO8859-1 Italian
sv_SE.ISO8859-1 Swedish
For more information on supported locales, see the International Language Environments
Guide.
In a Bourne- or Korn-shell user initialization file, you would add the following:
LANG=de_DE.ISO8859-1; export LANG
Note that if the first digit is zero, it is not displayed. For example, if umask is set to
022, 22 is displayed.
You can also determine the umask value you want to set by using the following table,
which shows the file and directory permissions that are created for each of the octal
values of umask.
0 rw- rwx
1 rw- rw-
2 r-- r-x
3 r-- r--
4 -w- -wx
5 -w- -w-
6 --x --x
The following line in a user initialization file sets the default file permissions to
rw-rw-rw-.
umask 000
Example—.profile File
1
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/ccs/bin:.
2
MAIL=/var/mail/$LOGNAME
3
NNTPSERVER=server1
4
MANPATH=/usr/share/man:/usr/local/man
5
PRINTER=printer1
6
umask 022
Example—.cshrc File
1
set path=($PATH $HOME/bin /usr/local/bin /usr/ccs/bin)
2
setenv MAIL /var/mail/$LOGNAME
3
setenv NNTPSERVER server1
4
setenv PRINTER printer1
5
alias h history
6
umask 022
7
source /net/server2/site-init-files/site.login
switch ($choice)
case "1":
setenv APPHOME /opt/app-v.1
breaksw
case "2":
setenv APPHOME /opt/app-v.2
endsw
This site initialization file could be referenced in a user’s .cshrc file (C shell users
only) with the following line:
source /net/server2/site-init-files/site.login
In this line, the site initialization file is named site.login and is located on a server
named server2. This line also assumes that the automounter is running on the user’s
system.
This chapter describes how to set up and maintain user accounts and groups by using
the Solaris Management Console.
For information on the procedures associated with setting up and maintaining user
accounts and groups with the Solaris Management Console, see “Setting Up User
Accounts (Task Map)” on page 101 and “Maintaining User Accounts (Task Map)”
on page 110.
For background information about managing user accounts and groups, see
Chapter 4.
(Optional) Gather user Use a standard form to gather “How to Gather User
information user information to help you Information” on page 102
keep user information
organized.
(Optional) Customize user You can set up user “How to Customize User
initialization files initialization files (.cshrc, Initialization Files”
.profile, .login), so you on page 103
can provide new users with
consistent environments.
101
Task Description For Instructions
(Optional) Set up a user You can create a user template See Solaris Management
template so you don’t have to manually Console online help
add all similar user properties.
(Optional) Add rights or a role You can add rights or a role to See Solaris Management
to a user a user so the user can perform Console online help
a specific command or task.
Share the user’s home You must share the user’s “How to Share a User’s
directory home directory so the Home Directory” on page 107
directory can be remotely
mounted from the user’s
system.
Mount the user’s home You must mount the user’s “How to Mount a User’s
directory home directory on the user’s Home Directory” on page 109
system.
Item Description
User Name:
Profiles or Authorizations:
User Name:
UID:
Primary Group:
Secondary Groups:
Comment:
Default Shell:
Mounting Method:
Mail Server:
Department Name:
Department Administrator:
Manager:
Employee Name:
Employee Title:
Employee Status:
Employee Number:
Start Date:
3. Copy the default user initialization files into the directories you created for
different types of users.
# cp /etc/skel/local.cshrc /shared-dir/skel/user-type/.cshrc
# cp /etc/skel/local.login /shared-dir/skel/user-type/.login
# cp /etc/skel/local.profile /shared-dir/skel/user-type/.profile
Note – If the account has profiles assigned to it, then the user has to launch a special
version of the shell called a profile shell to use commands (with any security
attributes) that are assigned to the profile. There are three profile shells
corresponding to the types of shells: pfsh (Bourne shell), pfcsh (C shell), and
pfksh (Korn shell).
4. Edit the user initialization files for each user type and customize them based on
your site’s needs.
For a detailed description on the ways to customize the user initialization files, see
“Customizing a User’s Work Environment” on page 88.
6. Verify that the permissions for the user initialization files are correct.
# ls -la /shared-dir/skel/*
3. Double-click the This Computer icon under the Management Tools icon in the
Navigation pane.
A list of categories is displayed.
4. (Optional) Select the appropriate toolbox for your name service environment.
You can add existing users to the group when you add the group. Or, you can just add
the group and then add the user to the group when you add the user.
■ Select Add Group from the Action menu.
■ Identify the group name, mechanoids, at the Group Name prompt under Group
Identification.
■ Identify the group number, 101, at the Group ID number prompt.
■ Click on OK.
3. Double-click the This Computer icon under the Management Tools icon in the
Navigation pane.
A list of categories is displayed.
4. (Optional) Select the appropriate toolbox for your name service environment.
5. Select one of the following based on whether the file system containing the
user’s home directory is already shared.
3. Edit the /etc/vfstab file and create an entry for the user’s home directory.
system-name:/export/home/user-name - /export/home/user-name nfs - yes rw
For more information about adding an entry to the /etc/vfstab file, see
Chapter 40.
Delete a Group You can delete a group if its See Solaris Management
no longer needed. Console online help
Delete a User Account You can delete a user account See Solaris Management
if it is no longer needed. Console online help
Basically, the steps for completing Solaris User Registration and accessing Solaris Solve
are:
1. Fill in the electronic Solaris User Registration profile.
2. Submit the profile by email or print the profile to fax or mail.
3. Create your login ID and password to access the Solaris Solve site.
Even if you do not access the Solaris Solve site immediately, we recommend that
you create your Solaris Solve login ID and password during the Solaris User
Registration process. A Solaris Solve login ID and password should contain 6 to 8
alphanumeric characters without spaces and colons.
4. Access the Solaris Solve site.
The following table describes problems that may occur when you try to register, and
actions required to resolve these conflicts.
The registration form failed to initialize: Web Check for missing registration files.
page window displays and requests user see
system administrator to resolve problem that
prevents registration setup.
The form could not be emailed: Dialog box Check to see if email is configured correctly.
displays and requests user see system Also check if CDE is on user’s system since it
administrator to resolve problem. must be present to email completed
registration form. Alternatively, users can
print the form and fax or mail it.
The form could not be printed: Dialog box Check to see if the printer is configured
displays and requests user to see system correctly. Alternatively, the user can email
administrator to resolve problem. form.
The form could not be saved: Dialog box Check the user’s home directory. Required
displays and verifies that registration action depends on the system’s configuration.
succeeded; however, the registration
information cannot be recalled when updating
registration in the future.
You forgot your Solaris Solve login ID and Send a mail message describing the problem
password. to [email protected] or see “How to
Restart Solaris User Registration” on page 113.
You want to restart the registration process. “How to Restart Solaris User Registration”
on page 113.
1. To disable user registration before installing the Solaris release, select one of the
following:
■ Deselect the SUNWsregu package (interactive installation).
■ Modify a custom JumpStart profile to not install the SUNWsregu package.
■ Create and run a finish script that creates a file named solregis in the
/etc/default directory on one or more systems with the following line in the
script:
DISABLE=1
For more information see Solaris 9 12/03 Installation Guide or solregis(1).
This topic map lists the chapters that provide information on managing server and
client support.
115
116 System Administration Guide: Basic Administration • April 2004
CHAPTER 7
This chapter describes the management of server and client support on a network, and
it provides overview information about each system configuration (referred to as a
system type) that is supported in the Solaris environment. This chapter also includes
guidelines for selecting the appropriate system type to meet your needs.
For step-by-step instructions about how to manage diskless client support, see
Chapter 8.
117
These commands are part of the Solaris Management Console tool suite. You cannot
use the Solaris Management Console to manage diskless clients. You can only use the
smosservice and smdiskless commands to manage diskless clients.
For more information on managing diskless clients, see “Diskless Client Management
Overview” on page 123 and Chapter 8.
Diskless client systems and Solstice Solstice AdminSuite 2.3 Administration Guide
AutoClient systems in previous Solaris
releases
Client A system that uses remote services from a server. Some clients have
limited disk storage capacity, or perhaps none at all, and they have
to rely on remote file systems from a server to function. Diskless
systems, AutoClient systems, and appliance systems are examples
of this type of client.
Other clients might use remote services (such as installation
software) from a server, but they don’t rely on a server to function.
A standalone system, which has its own hard disk containing the
root (/), /usr, and /export/home file systems and swap space, is
a good example of this type of client.
Sun Cobalt Server The Sun Cobalt server appliance provides an integrated set of
Appliance pre-configured Internet services. Users of the server appliance just
need a web browser and an IP address. Administration on the
servers is centralized and the appliance users require no client
administration. For more information, see
http://www.sun.com/hardware/serverappliances.
Appliance A network appliance such as the Sun Ray appliance provides access
to applications and the Solaris environment. An appliance gives
you centralized server administration and no client administration
or upgrades. Sun Ray appliances also provide hot desking, which is
the ability to instantly access your computing session from any
appliance in the server group, exactly where you left off. For more
information, see http://www.sun.com/products/sunray.
Servers
A server system contains the following file systems:
■ The root (/) and /usr file systems, plus swap space
■ The /export and /export/home file systems, which support client systems and
provide home directories for users
■ The /opt directory or file system for storing application software
Standalone Systems
A networked standalone system can share information with other systems in the network,
but it can continue to function if detached from the network.
A standalone system can function autonomously because it has its own hard disk that
contains the root (/), /usr, and /export/home file systems and swap space. The
standalone system thus has local access to operating system software, executables,
virtual memory space, and user-created files.
Note – A standalone system requires sufficient disk space to hold its necessary file
systems.
Diskless Clients
A diskless client has no disk and depends on a server for all its software and storage
needs. A diskless client remotely mounts its root (/), /usr, and /home file systems
from a server.
A diskless client generates significant network traffic due to its continual need to
procure operating system software and virtual memory space from across the
network. A diskless client cannot operate if it is detached from the network or if its
server malfunctions.
For more overview information about diskless clients, see “Diskless Client
Management Overview” on page 123.
AutoClient Systems
An AutoClient system is nearly identical to a diskless client in terms of installation
and administration. An AutoClient system has the following characteristics:
Appliances
An appliance, such as the Sun Ray appliance, is an X display device that requires no
administration. There is no CPU, fan, disk, and very little memory. An appliance is
connected to a Sun display monitor, but the appliance user’s desktop session is run on
a server and displayed back to the user. The X environment is setup automatically for
the user and has the following characteristics:
■ Relies on a server to access other file systems and software applications
■ Provides centralized software administration and resource sharing
■ Contains no permanent data, making it a field-replaceable unit (FRU)
This table describes how each system type scores in terms of each category. A ranking
of 1 is most efficient. A ranking of 4 is least efficient.
Centralized
System Type Administration Performance Disk Usage
Standalone System 4 1 4
Diskless Client 1 4 1
AutoClient System 1 2 2
Appliance 1 1 1
A diskless client is a system that depends on an OS server for its operating system,
software, and storage. A diskless client mounts its root (/), /usr, and other file
systems from its OS server. A diskless client has its own CPU and physical memory
and can process data locally. However, a diskless client cannot operate if it is detached
from its network or if its OS server malfunctions. A diskless client generates significant
network traffic because of its continual need to function across the network.
In previous Solaris releases, diskless clients were managed with the Solstice graphical
management tools. In the Solaris 9 release, the diskless client commands,
smosservice and smdiskless, enable you to manage OS services and diskless
client support.
Solaris 8 1/01,
Architecture 4/01, 7/01, 10/01,
Type Solaris 2.6 Solaris 7 2/02 Solaris 9
You can do the following tasks with the smosservice and smdiskless commands:
■ Add and modify diskless client support
■ Add and remove OS services
■ Manage diskless client information in the LDAP, NIS, NIS+, or files environment
You can only use the diskless client commands to set up diskless client booting. You
cannot use them to set up other services, such as remote installation or profile services.
Set up remote installation services by including diskless client specifications in the
sysidcfg file. For more information, see Solaris 9 12/03 Installation Guide.
/usr/sadm/bin/smosservice
/usr/sadm/bin/smdiskless
Adding OS Services
A Solaris OS server is a server that provides operating system (OS) services to support
diskless client systems. You can add support for an OS server or convert a standalone
system to an OS server with the smosservice command.
For each platform group and Solaris release that you want to support, you must add
the particular OS service to the OS server. For example, if you want to support SPARC
Sun4m systems running the Solaris 8 release, you must add Sun4m/Solaris 8 OS
services to the OS server. You would also still need to add OS services to support
SPARC Sun4c systems or x86 based systems that runs the Solaris 8 release, because
they are different platform groups.
You must have access to the appropriate Solaris CD or disk image to add OS services.
For example, you may have a server that is running the Solaris 7 release. You may also
have additional OS services loaded on this server, including the Solaris 2.6 SPARC
sun4m OS services that have been patched. If you try to add the Solaris 2.6 SPARC
sun4c OS services from a CD-ROM to this server, you could get the following error
message:
Error: inconsistent revision, installed package appears to have been
patched resulting in it being different than the package on your media.
You will need to backout all patches that patch this package before
retrying the add OS service option.
/export/Solaris_version 10
/export/exec 800
/export/share 5
/export/root/templates/Solaris_version 30
This chapter describes how to manage diskless clients in the Solaris environment.
For information on the procedures associated with managing diskless clients, see
“Managing Diskless Clients (Task Map)” on page 129.
For information about managing clients with Solstice AdminSuite™ software, see
Solstice AdminSuite 2.3 Administration Guide.
1. (Optional) Remove existing If you have existing diskless Solstice AdminSuite 2.3
diskless client support clients that were added with Administration Guide
the Solstice AdminSuite
product, remove the diskless
client support and OS services
with the admhostdel and
admhostmod commands
before installing the Solaris
release.
129
Task Description For Instructions
3. (Optional) Enable Solaris Choose Log Viewer from the “Starting the Solaris
Management Console logging console main window to view Management Console”
to view diskless client error diskless client error messages. on page 54
messages
4. Prepare for adding a Verify supported releases and “How to Prepare for Adding
diskless client identify the platform, Diskless Clients” on page 132
mediapath, and cluster (or
software group) of each
diskless client.
5. Add required OS services to Add the OS services for the “How to Add OS Services For
an OS server diskless clients you want to Diskless Client Support”
support with the on page 133
smosservice command. You
must identify the platform,
media path, and each diskless
client platform that you want
to support.
6. Add a diskless client Add diskless client support by “How to Add a Diskless
specifying all required Client” on page 135
information with the
smdiskless command.
7. Boot the diskless client Verify that the diskless client “How to Boot a Diskless
support is successfully added Client” on page 136
by booting the diskless client.
8. (Optional) Delete diskless Delete support for a diskless “How to Delete Diskless
client support client if it is no longer Client Support” on page 137
required.
10. (Optional) Patch OS Add, delete, list, or “How to Add an OS Patch for
services synchronize patches for a Diskless Client” on page 139
diskless client OS services.
Keep the following key points in mind when managing diskless clients:
After you determine the platform, media path, and cluster for each diskless client, you
are ready to add OS services. The following directories are created and populated for
each OS service that you add:
■ /export/Solaris_version/Solaris_version_instruction_set.all (symbolic link
to /export/exec/Solaris_version/Solaris_version_instruction_set.all)
■ /export/Solaris_version
■ /export/Solaris_version/var
■ /export/Solaris_version/opt
■ /export/share
■ /export/root/templates/Solaris_version
■ /export/root/clone
■ /export/root/clone/Solaris_version
■ /export/root/clone/Solaris_version/machine_class
The following default directories are created and populated on the OS server for each
diskless client that you add:
■ /export/root/diskless_client
■ /export/swap/diskless_client
■ /tftpboot/diskless_client_ipaddress_in_hex/export/dump/diskless_client (if you
specify the -x dump option)
Note – You can modify the default locations of the root, /swap, and /dump directories
by using the -x option. However, do not create these directories under the /export
file system.
When you use the smosservice add command to add OS services, you must specify
the platform, mediapath, and cluster (or software group) of each diskless client platform
that you want to support.
1. Verify that the intended OS server and diskless client will be running a
combination of Solaris releases that are supported.
For more information, see “OS Server and Diskless Client Support Information”
on page 123.
* The sun4c architecture is not supported in the Solaris 8 or Solaris 9 releases. The
sun4d architecture is not supported in the Solaris 9 releases.
3. Identify the media path, which is the full path to the disk image that contains
the operating system that you want to install for the diskless client.
The Solaris operating system is delivered on multiple CDs. However, you cannot
use the smosservice command to load OS services from a multiple CD
distribution. You must run the scripts that are found on the Solaris software CDs
(and optional Language CD) to do the following:
■ Create an install image on a server. For information on setting up an install
server, refer to Solaris 9 12/03 Installation Guide.
■ Load the required OS services from the CD image using one of the following
scripts:
■ CD 1 of 2 –
/cdrom/cdrom0/s0/Solaris_9/Tools/setup_install_server
For example, if you are using the setup_install_server script from the
Solaris 9 Software 1 of 2 SPARC Platform Edition CD on a locally connected
CD-ROM device, the syntax looks something like this:
# mkdir /export/install/sparc_9
# cd /cd_mount_point/Solaris_9/Tools
# ./setup_install_server /export/install/sparc_9
■ After the Solaris CD image is installed on the disk, specify the disk image path.
For example:
/net/export/install/sparc_9
Note – If you are using a sun4u system, or if you are using a system with an
accelerated 8-bit color memory frame buffer (cgsix), you must specify SUNWCXall
as the cluster.
2. Verify that the Solaris Management Console server is running and that the
diskless client tools are available on the system.
5. When you are finished adding OS services, verify that the OS services were
installed.
# /usr/sadm/bin/smosservice list -H hostname:898 --
3. (Optional) Continue to use the smdiskless add command to add each diskless
client.
This example shows how to add a Solaris 7 client, inquisitor, from the server
starbug.
# /usr/sadm/bin/smdiskless add -- -i 172.20.27.102 -e 8:0:20:1f:31:be
-n inquisitor -x os=sparc.sun4u.Solaris_2.7 -x root=/export/root/inquisitor
-x swap=/export/swap/inquisitor -x swapsize=64 -x tz=US/Mountain
To list all spooled patches by OS and architecture, use the smosservice command
with the -P option.
Note – Pushing and synchronizing the patch to the diskless client can take up to 90
minutes per patch.
The swap size varies depending on whether you specify the -x swapsize option
when you add the diskless client. If you specify the -x dump option when you
add the diskless client, the following line is present:
dump=os-server:/export/dump/client dumpsize=24
The dump size varies depending on whether you specify the -x dumpsize option
when you add the diskless client.
■ Verify that the OS server’s IP address appears in the
/export/root/client/etc/inet/hosts file.
In a name service environment
■ Verify that both the OS server’s and the client’s Ethernet address and IP address
are correctly mapped.
■ Verify that the /etc/bootparams file contains the paths to the client’s root and
swap areas, as follows:
client root=os-server:/export/
root/client swap=os-server:/export/
swap/client swapsize=24
The swap size varies depending on whether you specify the -x swapsize option
when you add the diskless client. If you specify the -x dump option when you
add the diskless client, the following line is present:
dump=os-server:/export/dump/client dumpsize=24
The dump size varies depending on whether you specify the -x dumpsize option
when you add the diskless client.
Problem
Diskless client panics
Solution
■ Verify that the OS server’s Ethernet address is correctly mapped to its IP
address. If you physically moved a system from one network to another, you
might have forgotten to remap the system’s new IP address.
■ Verify that the client’s host name, IP address, and Ethernet address do not exist
in the database of another server on the same subnet that responds to the client’s
RARP, TFTP, or bootparam requests. Often, test systems are set up to install
their OS from an install server. In these cases, the install server answers the
client’s RARP or bootparam request, returning an incorrect IP address. This
incorrect address might result in the download of a boot program for the wrong
architecture, or a failure to mount the client’s root file system.
■ Verify that the diskless client’s TFTP requests are not answered by an install
server (or previous OS server) that transfers an incorrect boot program. If the
boot program is of a different architecture, the client immediately panics. If the
Problem
OS server is not responding to diskless client’s RARP request
Solution
From the client’s intended OS server, run the snoop command as root by using the
client’s Ethernet address:
# snoop xx:xx:xx:xx:xx:xx
Problem
Boot program downloads, but panics early in the process
Solution
Using the snoop command, verify that the intended OS server is answering the
client’s TFTP and NFS requests.
Problem
■ Diskless client hangs
■ Incorrect server responds to diskless client’s RARP request
Solution
Restart the following daemons on the OS server:
This topic map lists the chapters that provide information on shutting down and
booting a system.
145
146 System Administration Guide: Basic Administration • April 2004
CHAPTER 10
This chapter provides guidelines for shutting down and booting a system. The Solaris
software environment is designed to run continuously so that electronic mail and
network resources are available to users. Occasionally, it is necessary to shut down or
reboot a system because of a system configuration change, a scheduled maintenance
event, or a power outage.
147
PXE Network Boot
You can boot the Solaris x86 Platform Edition directly from a network without the
Solaris boot diskette on x86 based systems that support the Preboot Execution
Environment (PXE) network booting protocol. The PXE network boot is available only
for devices that implement the Intel Preboot Execution Environment specification.
You can enable the PXE network boot on the client system by using the BIOS setup
program in the system BIOS, the network adapter BIOS, or both. On some systems,
you must also adjust the boot device priority list so that a network boot is attempted
before a boot from other devices. See the manufacturer’s documentation for each setup
program, or watch for setup program entry instructions during boot.
Some PXE-capable network adapters have a feature that enables a PXE boot if you
type a particular keystroke in response to a brief boot-time prompt. This feature is
ideal when you use PXE for an install boot on a system that normally boots from the
disk drive because you do not have to modify the PXE settings. If your adapter does
not have this feature, disable PXE in the BIOS setup when the system reboots after
installation, and the system will boot from the disk drive.
Some early versions of PXE firmware cannot boot the Solaris system. If you have one
of these older versions, your system can read the PXE network bootstrap program
from a boot server, but the bootstrap will not transmit packets. If this problem occurs,
upgrade the PXE firmware on the adapter. Obtain firmware upgrade information from
the adapter manufacturer’s web site. For more information, see elxl(7D)
andiprb(7D).
For information on booting x86 based systems with or without the boot diskette, see
“x86: How to Boot a System From the Network” on page 203.
Use this table if you need information on booting a system over the network.
Configure a DHCP client with DHCP Manager System Administration Guide: IP Services
Reason for System Shut Down Appropriate Run Level For More Information
To turn off system power due to Run level 0, where it is safe to Chapter 12
anticipated power outage turn off power
To change kernel parameters in the Run level 6 (reboot the system) Chapter 12
/etc/system file
To recover from a hung system and See “When to Boot a System” N/A
you want to force a crash dump on page 152
For examples of shutting down a server or a standalone system, see Chapter 12.
To change kernel Reboot the system to “SPARC: How to Boot “x86: How to Boot a
parameters in the run level 3 (multiuser a System to Run Level System to Run Level 3
/etc/system file level with NFS 3 (Multiuser Level)” (Multiuser Level)”
resources shared) on page 186 on page 199
To perform file system Use Control-D from “SPARC: How to Boot “x86: How to Boot a
maintenance, such as run level S to bring a System to Run Level System to Run Level S
performing a backup the system back to run S (Single-User Level)” (Single-User Level)”
or restoring system level 3 on page 187 on page 200
data
To repair a system Interactive boot “SPARC: How to Boot “x86: How to Boot a
configuration file such a System System Interactively”
as /etc/system Interactively” on page 201
on page 188
To boot the kernel Booting kabd “SPARC: How to Boot “x86: How to Boot a
debugger (kadb) to the System With the System With the
track down a system Kernel Debugger Kernel Debugger
problem (kadb)” on page 193 (kadb)” on page 209
To repair an important Recovery boot “SPARC: How to Boot “x86: How to Boot a
system file that is a System for Recovery System for Recovery
causing system boot Purposes” Purposes”
failure on page 191 on page 204
This chapter provides overview information and tasks that are related to run levels
and boot files.
Run Levels
A system’s run level (also known as an init state) defines what services and resources
are available to users. A system can be in only one run level at a time.
The Solaris environment has eight run levels, which are described in the following
table. The default run level is specified in the /etc/inittab file as run level 3.
155
TABLE 11–1 Solaris Run Levels
Use the who -r command to determine a system’s current run level for any level,
except run level 0.
id:rstate:action:process
Field Description
action Identifies how the process that is specified in the process field is to be
run. Possible values include: initdefault, sysinit, boot,
bootwait, wait, and respawn.
initdefault identifies the default run level. For a description of the
other action keywords, see inittab(4).
1
ap::sysinit:/sbin/autopush -f /etc/iu.ap
2
ap::sysinit:/sbin/soconfig -f /etc/sock2path
3
fs::sysinit:/sbin/rcS sysinit >/dev/msglog 2<>/dev/msglog </dev/console
4
is:3:initdefault:
5
p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/...
6
sS:s:wait:/sbin/rcS >/dev/msglog 2<>/dev/msglog </dev/console
7
s0:0:wait:/sbin/rc0 >/dev/msglog 2<>/dev/msglog </dev/console
8
s1:1:respawn:/sbin/rc1 >/dev/msglog 2<>/dev/msglog </dev/console
9
s2:23:wait:/sbin/rc2 >/dev/msglog 2<>/dev/msglog </dev/console
10
s3:3:wait:/sbin/rc3 >/dev/msglog 2<>/dev/msglog </dev/console
11
s5:5:wait:/sbin/rc5 >/dev/msglog 2<>/dev/msglog </dev/console
12
s6:6:wait:/sbin/rc6 >/dev/msglog 2<>/dev/msglog </dev/console
13
fw:0:wait:/sbin/uadmin 2 0 >/dev/msglog 2<>/dev/msglog </dev/console
14
of:5:wait:/sbin/uadmin 2 6 >/dev/msglog 2<>/dev/msglog </dev/console
15
rb:6:wait:/sbin/uadmin 2 1 >/dev/msglog 2<>/dev/msglog </dev/console
16
sc:234:respawn:/usr/lib/saf/sac -t 300
17
co:234:respawn:/usr/lib/saf/ttymon -g -h -p "‘uname -n‘ console login: "
-T terminal-type -d /dev/console -l console
-m ldterm,ttcompat
The following table describes the keywords used for run level 3’s action field.
Starts the process when the init process receives a power failure
powerfail signal
Starts the process and waits for it to finish before going on to the next
wait entry for this run level
The following table describes the processes (or commands) that are executed at run
level 3.
/usr/sbin/shutdown Shuts down the system. The init process runs the
shutdown command only if the system has received a
power fail signal.
/usr/lib/saf/ttymon -g -h -p Starts the ttymon process that monitors the console for
"‘uname -n‘ console login: " login requests. This process is restarted if it fails.
-T terminal_type -d /dev/console
The terminal_type on a SPARC based system is sun.
-l console
The terminal_type on an x86 based system is AT386.
The Solaris software environment provides a detailed series of run control (rc) scripts
to control run-level changes. Each run level has an associated rc script that is located
in the /sbin directory:
■ rc0
■ rc1
■ rc2
■ rc3
■ rc5
■ rc6
■ rcS
For each rc script in the /sbin directory, there is a corresponding directory named
/etc/rcn.d that contains scripts to perform various actions for that run level. For
example, /etc/rc2.d contains files that are used to start and stop processes for run
level 2.
# ls /etc/rc2.d
K03samba* S20sysetup* S72slpd* S88utmpd*
K06mipagent* S21perf* S73cachefs.daemon* S89PRESERVE*
The /etc/rcn.d scripts are always run in ASCII sort order. The scripts have names
of the form:
[KS][0-9][0-9]*
Files that begin with K are run to terminate (kill) a system service. Files that begin with
S are run to start a system service.
Run control scripts are also located in the /etc/init.d directory. These files are
linked to corresponding run control scripts in the /etc/rcn.d directories.
The actions of each run control script are summarized in the following section.
Install-related tasks:
■ Configures the boot environment for the Live Upgrade software upon system
startup or system shutdown
■ Checks for the presence of the /etc/.UNCONFIGURE file to see if the system
should be reconfigured
■ Reboots the system from the installation media or a boot server if either
/.PREINSTALL or /AUTOINSTALL exists
Hardware-related tasks:
■ Starts the Sun Fire 15000 key management daemon (sckmd), if appropriate
■ Starts the Sun Fire 880 Dynamic Reconfiguration daemon (sf880drd), if
appropriate
■ Runs the flash PROM update script
■ Configures any graphic frame buffers or graphic accelerators
■ Runs the FCode interpreter daemon (efdaemon), if necessary
Note – Many of the system services and applications that are started at run level 2
depend on what software is installed on the system.
Note – The way system services are started and stopped in Solaris environment might
change in some future release.
One advantage of having individual scripts for each run level is that you can run
scripts in the /etc/init.d directory individually to stop system services without
changing a system’s run level.
Then, you can restart the NFS server daemons by typing the following:
# /etc/init.d/nfs.server start
# pgrep -f nfs
341
343
347
345
# pgrep -f nfs -d, | xargs ps -fp
UID PID PPID C STIME TTY TIME CMD
daemon 341 1 0 Aug 21 ? 0:00 /usr/lib/nfs/statd
Note – The way system services are started and stopped in the Solaris environment
might change in some future release.
If you want to add a run control script to start and stop a service, copy the script into
the /etc/init.d directory. Then, create links in the rcn.d directory where you
want the service to start and stop.
See the README file in each /etc/rcn.d directory for more information on naming
run control scripts. The following procedure describes how to add a run control script.
2. Rename the script by adding an underscore (_) to the beginning of the new file.
# cd /etc/rcn.d
# mv filename _filename
File Description
/boot/solaris/boot.rc Prints the Solaris x86 Platform Edition and runs the
Device Configuration Assistant in DOS-emulation
mode.
/boot/solaris/bootenv.rc Stores eeprom variables that are used to set up the boot
environment.
This chapter describes the procedures for shutting down systems. This is a list of the
step-by-step instructions in this chapter.
■ “How to Determine Who Is Logged in to a System” on page 171
■ “How to Shut Down a Server” on page 171
■ “How to Shut Down a Standalone System” on page 174
■ “How to Turn Off Power to All Devices” on page 176
For overview information about system run levels, see Chapter 11.
For a complete list of system administration tasks that require a system shutdown, see
Chapter 10.
169
For information on using your system’s power management features, see Solaris
Common Desktop Environment: User’s Guide.
The use of a system’s stop key sequence or turning a system off and then on are not
clean shutdowns because system services are terminated abruptly. However, it is
sometimes necessary to use these actions in emergency situations. For instructions on
system recovery techniques, see Chapter 13 or Chapter 14.
The following table describes the various shutdown commands and provides
recommendations for using them.
shutdown An executable shell script that Recommended for servers running at run
calls the init program to shut level 3 because users are notified of the
down the system. The system is impending shut down. Also notified are
brought to run level S by default. the systems that are mounting resources
from the server that is being shut down.
init An executable that kills all active Recommended for standalone systems
processes and syncs the disks when other users will not be affected.
before changing run levels. Provides a faster system shutdown
because users are not notified of the
impending shutdown.
reboot An executable that syncs the Not recommended. Use the init
disks and passes boot command instead.
instructions to the uadmin
system call, which, in turn, stops
the processor.
Use the who(1) command to determine which users on the system need to be notified.
This command is also useful for determining a system’s current run level. See “How
to Determine a System’s Run Level” on page 156.
3
lister pts/1 May 7 07:40 (bluemidget)
1. Become superuser.
6. After you have finished the system administration tasks, press Control-D to
return to the default system run level.
7. Use the following table to verify that the system is at the run level that you
specified in the shutdown command.
S (single-user level) # #
Run level 3 (multiuser level hostname console login: hostname console login:
with remote resources
shared)
If you are bringing the system to run level 0 to turn off power to all devices, see “How
to Turn Off Power to All Devices” on page 176.
1. Become superuser.
3. Use the following table to verify that the system is at the run level that you
specified in the init command.
S (single-user level) # #
2 (multiuser level) # #
3 (multiuser level with NFS hostname console login: hostname console login:
resources shared)
.
The system is down.
syncing file systems... [11] [10] [3] done
Type any key to continue
If you are bringing the system to run level 0 to turn off power to all devices, see “How
to Turn Off Power to All Devices” on page 176.
System devices to power down include the CPU, the monitor, and external devices
such as disks, tapes, and printers.
Before you turn off power to all system devices, you should shutdown the system
cleanly, as described in the preceding sections.
a. If shutting down a server, see “How to Shut Down a Server” on page 171.
3. After power can be restored, use the following steps to turn on the system and
devices.
This chapter describes the procedures for using the OpenBoot™ PROM monitor and
the procedures for booting a SPARC based system to different run levels.
For information on the procedures associated with booting a SPARC system, see
“SPARC: Booting a System (Task Map)” on page 179.
For overview information about the boot process, see Chapter 10. To troubleshoot boot
problems, see “What to Do If Rebooting Fails” in System Administration Guide:
Advanced Administration.
For step-by-step instructions on booting an x86 based system, see Chapter 14.
179
Task Description For Instructions
Before you can safely use the probe commands to find out what devices are attached
to the system, you need to do the following:
■ Change the PROM auto-boot? parameter to false and
You can the probe commands that are available on your system by using the
sifting probe command, as follows:
ok sifting probe
If you run the probe commands without clearing the system registers, the following
message is displayed:
ok probe-scsi
This command may hang the system if a Stop-A or halt command
has been executed. Please type reset-all to reset the system
before executing this command.
Do you wish to continue? (y/n) n
4. (Optional) If you want the system to reboot after a power failure or after using
the reset command, then change the auto-boot? parameter back to true.
ok setenv auto-boot? true
auto-boot? = true
ok probe-ide
Device 0 ( Primary Master )
You can use the devalias command to identify the device aliases and the associated
paths of devices that might be connected to the system.
ok devalias
screen /pci@1f,0/pci@1,1/SUNW,m64B@2
net /pci@1f,0/pci@1,1/network@1,1
cdrom /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f
disk /pci@1f,0/pci@1,1/ide@3/disk@0,0
disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0
disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0
disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0
disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0
ide /pci@1f,0/pci@1,1/ide@3
floppy /pci@1f,0/pci@1,1/ebus@1/fdthree
ttyb /pci@1f,0/pci@1,1/ebus@1/se:b
ttya /pci@1f,0/pci@1,1/ebus@1/se:a
keyboard! /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8:forcemode
keyboard /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8
mouse /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8
name aliases
1. Become superuser.
Use one of the probe commands if you need help with identifying the disk
number.
This self-test program, which runs diagnostic tests on the hardware, is executed and
the system is rebooted.
Use the who -r command to verify that the system is brought to the specified run
level. For a description of run levels, see Chapter 11.
4. To bring the system up to multiuser state after you completed the system
maintenance task, press Control-D.
Enter default directory for Provide an alternate path for the modules
modules [/platform/‘uname directory. Or, press Return to use the default
-i‘/kernel /platform/‘uname kernel modules directory.
-m/kernel /kernel /usr/kernel]:
Name of system file [etc/system]: Provide the name of an alternate system file
and press Return. Type /dev/null if your
/etc/system file has been damaged. Or,
press Return to use the default etc/system
file.
root filesystem type [ufs]: Press Return to use the default root (/) file
system. Type UFS for local disk booting, or
NFS for network booting.
Enter physical name of root device Provide an alternate device name and press
Return. Or, press Return to use the default
[physical_device_name]:
physical name of the root device.
3. If you are not prompted to answer the questions in the preceding table, verify
that you typed the boot -a command correctly.
The default network boot strategy is set to RARP. You can use either strategy
depending on whether a RARP boot server or a DHCP boot server is available on your
network.
Note – Sun Ultra systems must have PROM version 3.25.nn or later to use the DHCP
network boot strategy. For information on finding your PROM version, see “SPARC:
How to Find the PROM Revision for a System” on page 181.
If both methods are available, you can specify which service to use in the boot
command temporarily. Or, you can save the network boot strategy across system
reboots at the PROM level, by setting up an NVRAM alias. The following example
uses the nvalias command to set up a network device alias for booting DHCP by
default on a Sun Ultra 10 system.
ok nvalias net /pci@1f,4000/network@1,1:dhcp
This alias means that when you type boot net, the system boots by using the DHCP
network book strategy.
2. Determine the method for booting from the network and select one of the
following:
You must have already set up a RARP or DHCP boot server in your network to use
either method to boot successfully.
a. Boot the system from the network by using the DHCP method.
ok boot net[:dhcp]
If you have changed the PROM setting to boot DHCP by default, as in the
preceding nvalias example, you only have to specify boot net.
b. Boot the system from the network by using the RARP method.
ok boot net[:rarp]
Since RARP is the default network boot strategy, you only have to specify boot
net:rarp if you have changed the PROM value to boot DHCP.
3. When you see the syncing file systems... message, press the stop key
sequence for your system again.
Substitute the device name of the file system to be repaired for the devicename variable
in the following procedures. If you need help identifying a system’s device names,
refer to Chapter 30.
2. Follow the instructions in the table, depending on whether you are booting from
the Solaris installation CD or DVD or from the network.
3. Mount the file system that contains the file with an invalid entry.
# mount /dev/dsk/device-name /a
3. When you see the syncing file systems... message, press the stop key
sequence for your system again.
5. Check kadb boot messages to verify that the system has booted with the kernel
debugger.
Rebooting with command: kadb
Boot device: /iommu/sbus/espdma@4,800000/esp@4,8800000/sd@3,0
.
.
.
For more information on system crash dumps, see “Managing System Crash
Information (Tasks)” in System Administration Guide: Advanced Administration.
This chapter describes the procedures for booting an x86 based system.
For information on the procedures associated with booting an x86 system, see “x86:
Booting a System (Task Map)” on page 197.
For overview information about the boot process, see Chapter 10.
For step-by-step instructions on booting a SPARC based system, see Chapter 13.
Boot the Solaris Device Used after changing the hardware “x86: How to Boot the
Configuration Assistant configuration of the system. This Solaris Device Configuration
utility enables you to boot the Assistant” on page 199
Solaris system from a different boot
device, configure new or
misconfigured hardware, or perform
other device-related or boot-related
tasks.
197
Task Description For Instructions
Force a crash dump and reboot the “x86: Forcing a Crash Dump
system - Used to force a crash dump and Rebooting the System”
for troubleshooting purposes. on page 210
In the procedures in this chapter, you might be requested to insert the Solaris Device
Configuration Assistant boot diskette to boot the Configuration Assistant. If your
system’s BIOS supports booting from the CD or DVD, you can, instead, insert the
Solaris installation CD or DVD to boot the Configuration Assistant.
2. If the system displays the Type any key to continue prompt, press any key
to reboot the system.
You can also use the reset button at this prompt. If the system is shut down, turn
the system on with the power switch.
The first menu of the Configuration Assistant is displayed after a few minutes.
1. If the system displays the Type any key to continue prompt, press any key
to reboot the system.
You can also use the reset button at this prompt. If the system is shut down, turn
the system on with the power switch.
The Current Boot Parameters menu is displayed after a few minutes.
1. If the system displays the Type any key to continue prompt, press any key
to reboot the system.
You can also use the reset button at this prompt. If the system is shut down, turn
the system on with the power switch.
The Current Boot Parameters menu is displayed after a few minutes.
5. Perform the maintenance task that required the run level change to S.
1. If the system displays the Type any key to continue prompt, press any key
to reboot the system.
2. Select the Solaris partition (if not marked as active) from the list and press Enter.
If you do not make a selection within five seconds, the active boot partition is
selected automatically.
The Current Boot Parameters menu is displayed after a few minutes.
Enter default directory for Provide an alternate path for the modules
modules: [/platform/i86pc/kernel directory and press Enter. Or, press Enter to
/kernel /usr/kernel]: use the default modules directory path.
Name of system file [etc/system]: Provide the name of an alternate system file
and press Enter. Or, press Enter to use the
default /etc/system file. Type/dev/null
if your /etc/system file has been
damaged.
root filesystem type [ufs]: Press Enter to use the default root (/) file
system. Type: UFS for local disk booting, or
NFS for network booting.
Enter physical name of root device Provide an alternate device name and press
[physical_device_name]: Enter. Or, press Enter to use the default
physical name of the root device bootpath.
If the system is capable of a PXE network boot, you might want to boot the system
directly from the network without using either the Configuration Assistant boot
diskette or the installation CD or DVD.
The menu, Set Network Configuration Strategy, on the Configuration Assistant’s Boot
Tasks Menu, enables you to select the appropriate boot strategy.
1. Determine whether you want to boot from the network by using the
RARP/bootparams method or the DHCP method.
There are two network configuration strategies to choose from, RARP (Reverse
Address Resolution Protocol) or DHCP (Dynamic Host Configuration Protocol).
The default network boot strategy is set to RARP. You can use either strategy
depending on whether a RARP boot server or a DHCP boot server is available on
your network.
The PXE network boot is available only with DHCP.
3. If the system displays the Type any key to continue prompt, press any key
to reboot the system.
10. Select NET as the boot device. Then, press F2_Continue to boot the network
device.
The Solaris boot option screen is displayed.
2. If the system doesn’t respond to any input from the mouse or keyboard, press
the reset key, if it exists, to reboot the system. Or, you can use the power switch
to reboot the system.
1. Stop the system first by using the system stop key sequence.
Use the stop sequence for your system if you don’t know the root password or if
you can’t log in to the system. For more information, see “x86: How to Stop a
System for Recovery Purposes” on page 204.
2. Boot from the Solaris installation CD or DVD (or from the network) to
single-user mode.
b. If the system displays the Type any key to continue prompt, press any
key to reboot the system.
You can also use the reset button at this prompt. If the system is shut down,
turn the system on with the power switch.
The Solaris Device Configuration Assistant screen is displayed.
e. Select the CD-ROM drive or network device. Then press the F2 key
(F2_Continue).
The Current Boot Parameters menu is displayed.
3. Mount the root (/) file system that contains the invalid passwd file.
# mount /dev/dsk/devicename /a
Select one of the identified devices to boot the Solaris kernel and
choose Continue.
> To make a selection use the arrow keys, and press Enter to mark it [X].
1 Solaris Interactive
2 Custom JumpStart
3 Solaris Web Start
Select one of the identified devices to boot the Solaris kernel and
choose Continue.
> To make a selection use the arrow keys, and press Enter to mark it [X].
1 Solaris Interactive
2 Custom JumpStart
3 Solaris Web Start
4. Verify that you can access the kernel debugger by pressing F1-A.
The kadb[0]: prompt is displayed when you enter the kernel debugger.
For more information on system crash dumps, see “Managing System Crash
Information (Tasks)” in System Administration Guide: Advanced Administration.
Note – You must be in text mode to enter the kernel debugger (kadb). So, first exit any
window system.
1. Press F1–A.
kadb[0]:
The kadb[0]: prompt is displayed.
3. Verify that the system has rebooted by logging in at the console login prompt.
This chapter describes the firmware used for booting SPARC based and x86 based
systems. This chapter also provides an overview of the boot process on each platform.
Note – Some older systems might require PROM upgrades before they will work with
the Solaris system software. Contact your local service provider for more information.
213
SPARC: The Boot Process
The following table describes the boot process on SPARC based systems.
Boot PROM 1. The PROM displays system identification information and then runs
self-test diagnostics to verify the system’s hardware and memory.
2. Then, the PROM loads the primary boot program, bootblk, whose
purpose is to load the secondary boot program (that is located in the
ufs file system) from the default boot device.
Boot Programs 3. The bootblk program finds and executes the secondary boot
program, ufsboot, and loads it into memory.
Kernel Initialization 5. The kernel initializes itself and begins loading modules by using
ufsboot to read the files. When the kernel has loaded enough modules
to mount the root (/) file system, the kernel unmaps the ufsboot
program and continues, using its own resources.
6. The kernel creates a user process and starts the /sbin/init process,
which starts other processes by reading the /etc/inittab file.
init 7. The /sbin/init process starts the run control (rc) scripts, which
execute a series of other scripts. These scripts (/sbin/rc*) check and
mount file systems, start various processes, and perform system
maintenance tasks.
Hardware adapters can have an on-board BIOS that displays the physical
characteristics of the device and can be used to access the device.
During the startup sequence, the PC BIOS checks for the presence of any adapter
BIOS, and if found, loads and executes each adapter BIOS. Each individual adapter’s
BIOS runs self-test diagnostics and displays device information.
The following table summarizes the purpose of the primary x86 boot interfaces. See
the sections that follow for a detailed description and example of each boot interface.
Primary Boot Subsystem This menu appears if the disk you are booting from contains
multiple operating systems, including the Solaris operating
system.
Secondary Boot Subsystem This menu appears each time you boot the Solaris release. The
Solaris release is booted automatically unless you choose to
run the Solaris Device Configuration Assistant by interrupting
the autoboot process.
Solaris Device Configuration There are two ways to access the Solaris Device Configuration
Assistant/Boot Diskette Assistant menus:
1. Use the Solaris Device Configuration Assistant boot
diskette or the Solaris installation CD (on systems that can
boot from the CD-ROM drive) to boot the system.
2. Interrupt the autoboot process when you boot the Solaris
software from an installed disk.
Current Boot Parameters This menu appears when you boot the Solaris release from the
Menu disk, CD-ROM, or the network. The menu presents a list of
boot options.
Note – If you need to create the Solaris Device Configuration Assistant boot diskette,
go to http://soldc.sun.com/support/drivers/dca_diskettes.
During the boot process, the boot subsystem menus allow you to customize boot
choices. If the system receives no response during the time-out periods, it continues to
boot automatically using the default selections. You can stop the boot process when
each boot subsystem menu is displayed. Or, you can let the boot process continue
automatically.
During the boot phase, the Solaris Device Configuration Assistant does the following:
■ Displays a list of devices from which to boot. The device marked with an asterisk
(*) is the default boot device.
■ Enables you to perform optional tasks, such as editing autoboot settings and
property settings, and choosing the network configuration strategy.
The following section provides examples of menus that appear during the device
identification phase. The device output varies based on your system configuration.
> To perform a full scan to identify all system hardware, choose Continue.
About navigation...
- The mouse cannot be used.
- If the keyboard does not have function keys or they do not respond,
press ESC. The legend at the bottom of the screen will change to
show the ESC keys to use for navigation.
- The F2 key performs the default action.
If the scanning stalls, press the system’s reset button. When the
system reboots, choose Specific Scan or Help.
#######################
| | | | | |
0 20 40 60 80 100
> To make a selection use the arrow keys, and press Enter to mark it [X].
BIOS 1. When the system is turned on, the BIOS runs self-test diagnostics to
verify the system’s hardware and memory. The system begins to boot
automatically if no errors are found. If errors are found, error messages
are displayed that describe recovery options.
The BIOS of additional hardware devices are run at this time.
2. The BIOS boot program tries to read the first physical sector from the
boot device. This first disk sector on the boot device contains the master
boot record mboot, which is loaded and executed. If no mboot file is
found, an error message is displayed.
Boot Programs 3. The master boot record, mboot, which contains disk information
needed to find the active partition and the location of the Solaris boot
program, pboot, loads and executes pboot.
4. The Solaris boot program, pboot loads bootblk, the primary boot
program, whose purpose is to load the secondary boot program that is
located in the ufs file system.
5. If there is more than one bootable partition, bootblk reads the fdisk
table to locate the default boot partition, and builds and displays a menu
of available partitions. You have a 30-second interval to select an
alternate partition from which to boot. This step only occurs if there is
more than one bootable partition present on the system.
Kernel initialization 8. The kernel initializes itself and begins loading modules by using the
secondary boot program (boot.bin or ufsboot) to read the files.
When the kernel has loaded enough modules to mount the root (/) file
system, the kernel unmaps the secondary boot program and continues,
using its own resources.
9. The kernel creates a user process and starts the /sbin/init process,
which starts other processes by reading the /etc/inittab file.
init 10. The /sbin/init process starts the run control (rc) scripts, which
execute a series of other scripts. These scripts (/sbin/rc*) check and
mount file systems, start various processes, and perform system
maintenance tasks.
This topic map lists the chapters that provide information on managing removable
media.
223
224 System Administration Guide: Basic Administration • April 2004
CHAPTER 17
This chapter provides general guidelines for managing removable media in the Solaris
environment.
You can use both the Common Desktop Environment (CDE) volume management and
the Solaris command line to fully manage removable media.
225
■ Create an fdisk partition and a PCFS file system on removable media on a SPARC
system to facilitate data transfers to x86 systems.
For information on using removable media with File Manager in the Common
Desktop Environment, see Solaris Common Desktop Environment: User’s Guide.
9 Become superuser.
TABLE 17–2 How to Access Data on Removable Media Managed by Volume Manager
Files on the first The removable hard disk and /rmdisk/jaz0 or /rmdisk/zip0
removable hard disk enter volcheck
Files on the first DVD The DVD and wait for a few /dvd/volume-name
seconds
Files on the first The PCMCIA and wait for a few /pcmem/pcmem0
PCMCIA seconds
If your system has more than one type of removable device, see the following table for
their access points.
Media Device Access File Systems With This Path Access Raw Data With This Path
This chapter describes how to access removable media from the command line in the
Solaris environment.
For information on the procedures associated with accessing removable media, see the
following:
■ “Accessing Removable Media (Task Map)” on page 229
■ “Accessing Removable Media on a Remote System (Task Map)” on page 238
1. (Optional) Add the Add the removable media “How to Add a New
removable media drive drive to your system, if Removable Media Drive”
necessary. on page 232
229
Task Description For Instructions
4. (Optional) Copy files or Copy files or directories from “How to Copy Information
directories the media as you would from From Removable Media”
any other location in the file on page 234
system.
7. Eject the Media When you finish, eject the “How to Eject Removable
media from the drive. Media” on page 237
Starting in the Solaris 8 6/00 release, volume manager (vold) actively manages all
removable media devices. This means any attempt to access removable media with
device names such as /dev/rdsk/cntndnsn or /dev/dsk/cntndnsn will be
unsuccessful.
Use this table to identify which removable media name to use with specific Solaris
commands.
For example, a CD or DVD with a UFS file system for a SPARC platform cannot be
recognized by an x86 platform. Likewise, an x86 UFS CD cannot be mounted by
volume management on a SPARC platform. The same limitation applies to diskettes.
(Actually, some architectures share the same bit structure, so occasionally a UFS
format specific to one architecture will be recognized by another architecture, but the
UFS file system structure was not designed to guarantee this compatibility).
To accommodate the different formats, the CD or DVD is split into slices, which are
similar in effect to partitions on hard disks. The 9660 portion is portable, but the UFS
portion is architecture-specific. If you are having trouble mounting a CD or DVD,
particularly if it is an installation CD or DVD, make sure its UFS file system is
appropriate for your system’s architecture (check the label on the CD or DVD).
1. Become superuser.
2. Become superuser.
For instance, if you copy a file from a CD into your file system, you’ll be the owner,
but you won’t have write permissions (because the file never had them on the CD).
You’ll have to change the permissions yourself.
Keep the following in mind when using the xmcd software with CDDA (CD Digital
Audio) support to play musical media:
■ Use xmcd, version 3.1 (or later) on Sun Blade systems because this version has
CDDA support, which must be enabled in order to listen to CDs on these systems.
■ Enable CDDA by launching xmcd, clicking on the options button (it has a hammer
and screwdriver on the button), and then by clicking on “CDDA playback”.
■ When CDDA is enabled, audio is directed to the audio device, so headphones and
external speakers should be connected to the audio device and not to the media
drive itself.
■ CDDA can be enabled on other machines too. Enabling CDDA is required for
playing media on the Sun Blade systems.
Once you install the xmcd software, you can play a musical CD simply by inserting it
into the CD-ROM drive and starting the xmcd control panel.
Caution – Killing the process accessing the media should only be used in emergency
situations.
1. Make local media available Add the removable media “How to Make Local Media
to remote systems drive to your system, if Available to Other Systems”
necessary. on page 238
2. Access removable media on Insert the media into the “How to Access Information
remote systems drive. on Removable Media”
on page 233
1. Become superuser.
system-name The name of the system whose media you will mount.
local-mount-point The local directory onto which you will mount the
remote media.
This chapter describes how to format removable media from the command line in the
Solaris environment.
For information on the procedures associated with formatting removable media, see
“Formatting Removable Media (Task Map)” on page 245.
1. Load unformatted Insert the media into the drive and “How to Load a
media enter the volcheck command. Removable Media”
on page 248
3. (Optional) Add a UFS Add a UFS file system to use the “How to Format
file system diskette for transferring files. Removable Media for
Adding a File System”
on page 250
245
Task Description For Instructions
4. (Optional) Check the Verify the integrity of the file system “How to Check a File
media on the media. System on Removable
Media” on page 252
5. (Optional) Repair bad Repair any bad blocks on the media, if “How to Repair Bad Blocks
blocks on the media necessary. on Removable Media”
on page 253
A Solaris system can format diskettes for use on both Solaris and DOS systems.
However, the hardware platform imposes some limitations. These limitations are
summarized in the following table.
UDFS
UDFS
Diskettes formatted for UFS are restricted to the hardware platform on which they
were formatted. In other words, a UFS diskette formatted on a SPARC based platform
cannot be used for UFS on an x86 platform, nor can a diskette formatted on an x86
platform be used on a SPARC based platform. This is because the SPARC and x86 UFS
formats are different. SPARC uses little-endian bit coding, x86 uses big-endian.
A complete format for SunOS file systems consists of the basic “bit” formatting plus
the structure to support a SunOS file system. A complete format for a DOS file system
consists of the basic “bit” formatting plus the structure to support either an MS-DOS
or an NEC-DOS file system. The procedures required to prepare a diskette for each
type of file system are different. Therefore, before you format a diskette, consider
which procedure to follow. For more information, see “Formatting Removable Media
(Task Map)” on page 245.
On a Solaris system (either SPARC or x86), you can format diskettes with the
following densities.
By default, the diskette drive formats a diskette to a like density. This default means
that a 1.44 Mbyte drive attempts to format a diskette for 1.44 Mbytes, whether the
diskette is in fact a 1.44 Mbyte diskette or not, unless you instruct it otherwise. In
other words, a diskette can be formatted to its capacity or lower, and a drive can
format to its capacity or lower.
PCMCIA memory cards formatted for UFS are restricted to the hardware platform on
which they were formatted. In other words, a UFS PCMCIA memory card formatted
on a SPARC platform cannot be used for UFS on an x86 platform. Likewise, PCMCIA
memory cards formatted on an x86 platform cannot be used on a SPARC platform.
This is because the SPARC and x86 UFS formats are different.
A complete format for UFS file systems consists of the basic “bit” formatting plus the
structure to support a UFS file system. A complete format for a DOS file system
consists of the basic “bit” formatting plus the structure to support either an MS-DOS
or an NEC-DOS file system. The procedures required to prepare a PCMCIA memory
card for each type of file system are different. Therefore, before you format a PCMCIA
memory card, consider which file system you are using.
media was found Volume management detected the media and will
attempt to mount it in the directory described in Table
18–1.
If the media is formatted properly, no error messages
appear in the console.
If the media is not formatted, the “media was found”
message is still displayed, but the error messages similar
to the following appear in the Console:
fd0: unformatted diskette or no diskette in
the drive
fd0: read failed (40 1 0)
fd0: bad format
You must format the media before volume management
can mount it. For more information, see Chapter 19.
no media was found Volume management did not detect the media. Make
sure the media is inserted properly and run volcheck
again. If unsuccessful, check the media, it could be
damaged. You can also try to mount the media manually.
1. Verify that the volume manager is running, which means you can use the shorter
nickname for the device name.
$ ps -ef | grep vold
root 212 1 0 Nov 03 ? 0:01 /usr/sbin/vold
For information on starting vold, see “How to Restart Volume Management
(vold)” on page 233. For information on identifying media device names, see
“Using Removable Media Names” on page 230.
3. (Optional) Label the removable media with an 8-character label to be used in the
Solaris environment.
$ rmformat -b label device-name
For information on creating a DOS label, see mkfs_pcfs(1M).
3. Become superuser.
4. Determine the appropriate file system type and select one of the following:
This example shows how to create a PCFS file system without an fdisk partition.
$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n) y
$ su
# mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette
Construct a new FAT file system on /dev/rdiskette: (y/n)? y
#
If the drive supports bad block management, a best effort is made to rectify the bad
block. If the bad block cannot be rectified despite the best effort mechanism, a message
indicates a failure to repair.
You receive a warning message if you attempt to apply a password on media that does
not support this feature.
This example shows how to disable write protection and remove the password on a
Zip drive.
$ rmformat -W disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
This example shows how to enable read protection and set a password on a Zip drive.
rmformat -R enable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
Please reenter password: xxx
This example shows to disable read protection and remove the password on a Zip
drive.
$ rmformat -R disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
This chapter provides step-by-step instructions for writing and copying data and
audio CDs with the cdrw command.
■ “How to Restrict User Access to Removable Media with RBAC” on page 260
■ “How to Identify a CD Writer” on page 260
■ “How to Check the CD Media” on page 261
■ “How to Create an ISO 9660 File System for a Data CD” on page 262
■ “How to Create a Multi-Session Data CD” on page 263
■ “How to Create an Audio CD” on page 265
■ “How to Extract an Audio Track on a CD” on page 266
■ “How to Copy a CD” on page 267
■ “How to Erase CD-RW Media” on page 267
The cdrw command is available on the Software Supplement for the Solaris 8
Operating Environment 1/01 CD and is also part of the Solaris 9 release.
257
For information on recommended CD-R or CD-RW devices, go to
http://www.sun.com/io_technologies/pci/removable.html.
Term Description
CD-R CD read media that can be written once and after that, can
only be read from.
MMC-compliant record Acronym for Multi Media Command, which means these
recorder comply with a common command set. Programs
that can write to one MMC-compliant recorder should be
able to write to all others.
Red Book CDDA Acronym for Compact Disc Digital Audio, which is an
industry standard method for storing digital audio on
compact discs. It is also known by the term “Red Book”
format. The official industry specification calls for one or
more audio files sampled in 16-bit stereo sound at a
sampling rate of 44.1 kilohertz (kHz).
mkisofs Command for making a ISO file system to write onto a CD.
If any of these problems occur, you can lower the writing speed of the device with the
cdrw -p option.
You can also use the cdrw -C option to use the stated media capacity for copying an
80–minute CD. Otherwise, the cdrw command uses a default value of 74 minutes for
copying an audio CD.
For a discussion of using roles, see “RBAC Roles” in System Administration Guide:
Security Services.
4. Add users who need to use the cdrw command to the newly created role.
If you want to use a specific CD writer, use the -d option. For example:
$ cdrw -a filename.wav -d cdrom2
Use the cdrw -M command to to identify whether the media is blank or whether there
is an existing table of contents.
$ cdrw -M
2. Check that the CD-RW drive is connected properly by listing the device.
$ cdrw -l
Looking for CD devices...
Node Connected Device Device type
----------------------+--------------------------------+-----------------
cdrom1 | YAMAHA CRW8424S 1.0d | CD Reader/Writer
3. (Optional) If you do not see the drive in the list, you might have to do a
reconfiguration boot so that the system recognizes the device.
# touch /reconfigure
# init 6
Or, use the following commands to add the CD-RW device without rebooting the
system.
# drvconfig
# disks
Then restart vold.
# /etc/init.d/vold stop
# /etc/init.d/vold start
Then copy the CD file system onto the CD. For example:
$ cdrw -i ufs_cd
Initializing device...done.
Writing track 1...done.
2. Copy the ISO file system for the first session onto the CD.
$ cdrw -iO infoA
Initializing device...done.
Writing track 1...done.
done.
Finalizing (Can take several minutes)...done.
4. Identify the pathname of the CD media to include in the next write session.
$ eject -n
.
.
.
cdrom0 -> /vol/dev/rdsk/c2t4d0/my_infoA
5. Identify the next writeable address on the CD to write the next session.
% cdrw -M /cdrom
Device : YAMAHA CRW8424S
Firmware : Rev. 1.0d (06/10/99)
6. Create the next ISO file system for the next CD session and write it onto the CD.
$ mkisofs -o infoB -r -C 0,91118 -M /vol/dev/rdsk/c2t4d0/my_infoA
/data/infoB
Total translation table size: 0
Total rockridge attributes bytes: 16602
Total directory bytes: 22528
Path table size(bytes): 86
Max brk space used 20000
97196 extents written (189 Mb)
Creating an Audio CD
You can use the cdrw command to create audio CDs from individual audio tracks or
from .au and .wav files.
sun Sun .au files with data in Red Book CDDA format
wav RIFF (.wav) files with data in Red Book CDDA format
cda .cda files with raw CD audio data, which is 16–bit PCM
stereo at 44.1 kHz sample rate in little-endian byte order)
If no audio format is specified, the cdrw command tries to determine the audio file
format based on the file extension. The case of the characters in the extension is
ignored.
Examples—Creating an Audio CD
The following example shows how to create an audio CD.
$ cdrw -a bark.wav chirp.au meow.wav
Initializing device...done.
Writing track 1...done.
done.
Writing track 2...done.
Writing track 3...done.
done.
Finalizing (Can take several minutes)...done.
The following example shows how to create a multisession audio CD. The CD is
ejected after the first session is written. Re-insert the CD before the next writing
session.
$ cdrw -aO groucho.wav chico.au harpo.wav
Initializing device...done.
Writing track 1...done.
If you don’t use the cdrw -T option to specify the audio file type, cdrw uses the
filename extension to determine the audio file type. For example, the cdrw command
detects that this file is a .wav file.
$ cdrw -x 1 testme.wav
▼ How to Copy a CD
This procedure describes how to extract all the tracks from an audio CD into a
directory and then copy all them onto a blank CD.
Note – By default, the cdrw command copies the CD into the /tmp directory. The
copying might require up to 700 Mbytes of free space. If there is insufficient space in
the /tmp directory for copying the CD, use the -m option to specify an alternate
directory.
Example—Copying a CD
This example describes how to copy one CD to another CD. You must have two
CD-RW devices to do this task.
$ cdrw -c -s cdrom0 -d cdrom1
1. Erase the entire media or just the last session on the CD by selecting one of the
following:
This topic map lists the chapters that provide information on managing software in
the Solaris environment.
269
270 System Administration Guide: Basic Administration • April 2004
CHAPTER 22
The management of software involves adding and removing software from standalone
systems, servers, and their clients. This chapter describes background and other
information about the various tools available for installing and managing software.
This chapter does not describe installing the Solaris software on a new system, nor
does it describe installing or upgrading a new version of the Solaris software. For
information on installing or upgrading Solaris software, see Solaris 9 12/03 Installation
Guide.
271
pkgadd and patchadd Support for Signed
Packages and Patches
Solaris 9 12/03 – This Solaris release enables you to securely download Solaris
packages and patches that include a digital signature by using the updated pkgadd
and patchadd commands.
In previous Solaris releases, you could download the Solaris patch management tools
and use the smpatch command with PatchPro to manage signed patches. For
step-by-step instructions on using the smpatch command to manage signed patches,
see “Managing Signed Patches by Using Solaris Patch Management Tools (Tasks)” in
Signed Patches Administration Guide for PatchPro 2.2.
For step-by-step instructions on using the patchadd command to add signed patches,
see “Adding Signed Patches With patchadd Command (Task Map)” on page 337.
For step-by-step instructions on using the pkgadd command to add signed packages,
see “Adding and Removing Signed Packages (Task Map)” on page 311.
For information on using the prodreg command to administer software packages, see
“Managing Software With the Solaris Product Registry Command-Line Interface (Task
Map)” on page 292.
Signed Patches
All patches that are available for the Solaris 2.6, 7, 8, and 9 releases include a digital
signature. A valid digital signature ensures that the patch has not been modified since
the signature was applied.
Signed patches are stored in Java™ archive format files (abc.jar) and are available
from the SunSolve OnlineSM Web site.
For information about adding signed patches with the smpatch command, see
“Managing Signed Patches by Using Solaris Patch Management Tools (Tasks)” in
Signed Patches Administration Guide for PatchPro 2.2.
For information on using this product to manage software packages, see “Managing
Software With the Solaris Product Registry GUI (Task Map)” on page 288.
Patch Analyzer
When you use the Solaris™ Web Start program to upgrade to a Solaris 9 Update
Release, the patch analyzer performs an analysis on your system to determine which
(if any) patches will be removed or downgraded by upgrading to the Solaris Update
Release. You do not need to use the Patch Analyzer when you upgrade to the Solaris 9
release.
For information on using this tool when you are upgrading to a Solaris 9 update
release, see “Upgrading to a Solaris Update Release (Tasks)” in Solaris 9 12/03
Installation Guide.
For information on starting the Solaris Management Console, see “How to Start the
Console as Superuser or as a Role” on page 54.
The term packaging generically refers to the method for distributing and installing
software products to systems where the products will be used. A package is a
collection of files and directories in a defined format. This format conforms to the
application binary interface (ABI), which is a supplement to the System V Interface
Definition. The Solaris operating environment provides a set of utilities that interpret
this format and provide the means to install a package, to remove a package, or to
verify a package installation.
A patch is a collection of files and directories that replace or update existing files and
directories that are preventing proper execution of the existing software. For more
information about patches, see Chapter 24.
The same holds true for signed patches. A patch with a valid digital signature ensures
that the patch has not been modified since the signature was applied to the patch.
Using signed patches is a secure method of downloading or adding patches because
the digital signature can be verified before the patch is added to your system.
For more information about adding signed patches to your system, see “Adding Signed
Patches With patchadd Command (Task Map)” on page 337.
For information about creating signed packages, see Application Packaging Developer’s
Guide.
A signed package is identical to an unsigned package, except for the digital signature.
The package can be installed, queried, or removed with existing Solaris packaging
tools. A signed package is also binary-compatible with an unsigned package.
Before you can add a package or patch with a digital signature to your system, you
must set up a package keystore with trusted certificates. These certificates are used to
identify that the digital signature on the package or patch is valid.
The following table describes the general terms associated with signed packages and
patches.
Term Definition
Trusted certificate A certificate that holds a public key that belongs to another entity.
The trusted certificate is named as such because the keystore owner
trusts that the public key in the certificate indeed belongs to the
identity identified by the subject or owner of the certificate. The
issuer of the certificate vouches for this trust by signing the
certificate.
Trusted certificates are used when verifying signatures, and when
initiating a connection to a secure (SSL) server.
The process of adding a signed package or patch to your system involves three basic
steps:
1. Adding the certificates to your system’s package keystore with the pkgadm
command
2. (Optional) Listing the certificates with the pkgadm command
3. Adding the package with the pkgadd command or adding the patch with the
patchadd command
For step-by-step instructions on adding signed packages to your system, see “Adding
and Removing Signed Packages (Task Map)” on page 311. For step-by-step
instructions on adding signed patches to your system, see “Adding Signed Patches
With patchadd Command (Task Map)” on page 337.
The following table describes the encryption terminology associated with signed
packages and patches.
PEM The Privacy Enhanced Message (PEM) is a way to encode a file (in
DER or other binary format) using base64 encoding and some
optional headers. Initially used for encoding MIME-type email
messages. PEM is also used extensively for encoding certificates
and private keys into a file that exists on a file system or in an
email message.
Digital certificates, issued and authenticated by Sun Microsystems, are used to verify
that the downloaded package or patch with the digital signature has not been
compromised. These certificates are imported into your system’s keystore.
All Sun certificates are issued by Baltimore Technologies, which recently bought GTE
CyberTrust.
Access to a keystore is protected by a special password that you specify when you
import the Sun certificates into your system’s keystore.
The following table describes the output of the pkgadm listcert command.
Field Description
Issuer Common Name The name of the entity that issued, and
therefore signed, this certificate. For trusted
certificate authority (CA) certificates, the issuer
common name and common name are the
same.
A certificate authority certifies the relationship between public keys that are used to
decrypt the digital signature with the patch and the owner of the public keys.
The Sun Root CA, Sun Class B CA, and the patch signing certificate are included with
the Solaris patch management tools, including PatchPro. These three certificates
provide a certificate chain of trust in the patch verification process whereby the Sun
Root CA trusts the Class B CA, and the Class B CA trusts the patch management
certificate. And, ultimately, the GTE CyberTrust CA trusts the Sun Root CA.
If your system already has a populated Java keystore, you can now export the Sun
Microsystems root CA certificate from the Java keystore with the keytool command.
Then, use the pkgadm command to import this certificate into the package keystore.
Note – The Sun Microsystems root-level certificates are only required when adding
Sun-signed patches and packages.
For step-by-step instructions on importing certificates into the package keystore, see
“How to Import a Trusted Certificate into the Package Keystore (pkgadm addcert)”
on page 311.
For complete instructions on adding signed packages with the pkgadd command, see
“Adding and Removing Signed Packages (Task Map)” on page 311.
The Solaris Web Start program Launch an installer to add products included
in the Solaris 9 media pack. You cannot add
individual software packages.
Solaris Product Registry prodreg Viewer Use the prodreg command to remove or
(command line interface) display information about software products
that were originally installed by using the
Solaris Web Start program or the Solaris
pkgadd command.
Package commands (pkgadd, pkgrm, Incorporate these commands into scripts, set
pkginfo) up optional files to avoid user interaction or
perform special checks, and copy software
packages to spool directories.
When you add a package, the pkgadd command uncompresses and copies files from
the installation media to a local system’s disk. When you remove a package, the
pkgrm command deletes all files associated with that package, unless those files are
also shared with other packages.
Package files are delivered in package format and are unusable as they are delivered.
The pkgadd command interprets the software package’s control files, and then
uncompresses and installs the product files onto the system’s local disk.
Although the pkgadd and pkgrm commands do not log their output to a standard
location, they do keep track of the product that is installed or removed. The pkgadd
and pkgrm commands store information about a package that has been installed or
removed in a software product database.
By updating this database, the pkgadd and pkgrm commands keep a record of all
software products installed on the system.
If you intend to keep multiple versions of a package (for example, multiple versions of
a document processing application), install new versions into a different directory than
the already installed package with the pkgadd command. The directory where a
package is installed is referred to as the base directory. You can manipulate the base
directory by setting the basedir keyword in a special file called an administration
file. For more information on using an administration file and on setting the base
directory, see “Avoiding User Interaction When Adding Packages (pkgadd)”
on page 283 and admin(4).
Note – If you use the upgrade option when installing the Solaris software, the Solaris
installation software consults the software product database to determine the products
that are already installed on the system.
The pkgadd command, by default, checks the current working directory for an
administration file. If the pkgadd command doesn’t find an administration file in the
current working directory, it checks the /var/sadm/install/admin directory for
the specified administration file. The pkgadd command also accepts an absolute path
to the administration file.
Caution – Use administration files judiciously. You should know where a package’s
files are installed and how a package’s installation scripts run before using an
administration file to avoid the checks and prompts that the pkgadd command
normally provides.
The following example shows an administration file that will prevent the pkgadd
command from prompting the user for confirmation before installing the package.
mail=
instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
networktimeout=60
networkretries=3
authentication=quit
keystore=/var/sadm/security
proxy=
basedir=default
You can also assign a special installation directory for a package, which you might do
if you wanted to maintain multiple versions of a package on a system. To do so, set an
alternate base directory in the administration file (by using the basedir keyword),
which specifies where the package will be installed. For more information, see
admin(4).
If prior to installation, you know that the package you want to install is an interactive
package, and you want to store your answers to prevent user interaction during future
installations of this package, you can use the pkgask command to save your response.
For more information on this command, see pkgask(1M).
Once you have stored your responses to the questions asked by the request script,
you can use the pkgadd -r command to install the package without user interaction.
This chapter describes how to add, verify, and remove software packages.
285
TABLE 23–1 Tools or Commands for Managing Software Packages (Continued)
Tool or Command Man Page Description
Note – This procedure assumes that the system is running volume management
(vold). If your system is not running volume management, see Chapter 18 for
information on accessing removable media without volume management.
2. Decide to install from a CD, a DVD, or from the network. Select one of the
following:
■ If you are installing from a CD, insert the CD into the CD-ROM drive.
If you insert the Solaris 9 Languages CD, the Solaris Web Start program starts
automatically. Proceed to Step 6.
■ If you are installing from a DVD, insert the DVD into the DVD-ROM drive.
■ If you are installing from the network, locate the net image of the software you
want to install.
View installed or uninstalled You can view installed or “How to View Installed or
software with the Product uninstalled software with the Uninstalled Software
Registry Product Registry. Information With the Product
Registry GUI” on page 290
Install software with the You can use Product Registry “How to Install Software With
Product Registry to find software and launch the Product Registry GUI”
the Solaris Web Start program, on page 290
which leads you through the
installation of that software.
Uninstall software with the You can uninstall software “How to Uninstall Software
Product Registry with the Product Registry. With the Product Registry
GUI” on page 291
The Solaris Product Registry is a tool to help you manage installed software. After you
have installed the software, Product Registry provides a list of all the installed
software by using the Solaris Web Start program 3.0 or the Solaris pkgadd command.
The Solaris Product Registry GUI interface enables you to do the following:
■ View a list of installed and registered software and some software attributes
■ View all Solaris system products that you installed in their localized version in the
System Software Localizations directory
■ Find and launch an installer
■ Install additional software products
■ Uninstall software and individual software packages
The Solaris Product Registry GUI main window consists of three areas of information:
■ Installed, registered, and removed software
■ Standard attributes of the currently selected software
■ Attributes that are customized and attributes that are internal to the registered
software
3. Click the turner control to the left of the System registry directory in the
Registered Software box.
Notice that the turner control changes from pointing to the right to pointing down.
You can expand or collapse any item in the Registry, except an item that has a text
file icon to its left.
The Software Installed in Registered Software box always contains the following:
■ The configuration software group that you chose when installing the Solaris
release. Software groups that can be displayed include Core, End User System
Support, Developer System Support, Entire Distribution, or Entire Distribution
Plus OEM Support.
■ Additional system software, which is Solaris products that are not part of the
software group you chose.
■ Unclassified software, which is any package that you installed by using the
pkgadd command that is not a Solaris product or part of the software group.
3. Decide if you are installing from a CD, a DVD, or from the network. Select one
of the following:
■ If you are installing from a CD, insert the CD into the CD-ROM drive.
■ If you are installing from a DVD, insert the DVD into the DVD-ROM drive.
■ If you are installing from the network, locate the net image of the software that
you want to install.
4. To view the list of installed and registered software, click the turner control.
5. Click the New Install button at the bottom of the Solaris Product Registry
window.
The Product Registry displays the Select Installer dialog box, which initially points
to the /cdrom directory or the directory you are in.
7. When you find the installer you want, select its name in the Files box.
8. Click OK.
The installer you selected is launched.
9. Follow the directions that are displayed by the installer to install the software.
3. To view the list of installed and registered software, click the turner control.
4. Select directories until you find the name of the software that you want to
uninstall.
5. Read the software attributes to make sure that this software is the software that
you want to uninstall.
View installed or uninstalled You can view software “How to View Installed or
software with prodreg information with the browse Uninstalled Software
subcommand. Information (prodreg)”
on page 293
View software attributes with You can view specific software “How to View Software
prodreg attributes with the info Attributes (prodreg)”
subcommand. on page 296
Check dependencies between You can view the components “How to Check Dependencies
software components with that depend on a specific Between Software
prodreg software component with the Components (prodreg)”
info subcommand. on page 298
Uninstall software with You can remove software from “How to Uninstall Software
prodreg your system with the (prodreg)” on page 302
uninstall subcommand.
The prodreg command is the command-line interface (CLI) to the Solaris Product
Registry. The prodreg command supports several subcommands that enable you to
manage the software on your system.
You can use the prodreg command in a terminal window to perform the following
tasks.
■ View a list of installed and registered software and software attributes
■ View all Solaris system products that you installed in their localized version in the
System Software Localizations directory
■ Identify damaged software
■ Remove software entries from the Solaris Product Registry
■ Uninstall software and individual software packages
For more information on how to manage the Solaris Product Registry by using the
command-line interface, see the man page prodreg(1M).
NAME This field lists the localized name of the software. The
name of the Solaris operating system in this sample
output is the Solaris 9 4/03 release.
% prodreg browse -n 2
3. View the attributes for one of the software components that are listed in the
Solaris Product Registry.
You can view the attributes for one of the software components that are listed in
the output of the prodreg info command in the following ways.
% prodreg info -m "name"
% prodreg info -n 2
1. View the Solaris Product Registry information on the software you want to
check.
% pkginfo component-b-pkg
ERROR: information on "component-b-pkg" was not found
The error message output of the pkginfo component-b-pkg command indicates that
the component-b-pkg package has been removed from the system. The name software
component might not work without the component-b-pkg package.
The ExampleSoft child component EXSOzzt does not have an entry in the NAME
column of the Solaris Product Registry. The ExampleSoft software might be
damaged. Use the prodreg info command with the -u, -i, and -d options to
determine if the ExampleSoft software is damaged.
% prodreg info -u 95842091-725a-8501-ef29-0472985982be -i 1 -d
isDamaged=TRUE
The output of the previous command indicates that the ExampleSoft software is
damaged. Use the -a PKGS option to the prodreg info command to identify the
ExampleSoft software packages.
% prodreg info
-u 95842091-725a-8501-ef29-0472985982be
-i 1 -a PKGS
Use the pkginfo command to verify that the EXSOzzt and EXSOblob packages are
installed on the system.
% pkginfo EXSOzzt
ERROR: information for "EXSOzzt" was not found
% pkginfo EXSOblob
application EXSOblob Example Data
The output of the pkginfo command indicates that the EXSOzzt package is not
installed on the system.
After you uninstall a software component, you can remove the software and all the
child components of that software from the Solaris Product Registry by using the
prodreg unregister -r command.
4. Check the dependencies for the software that you want to uninstall.
# prodreg info -u name-UUID
Title: name
.
.
.
Child Components:
Name UUID #
-------------------------- ------------------------------------ -
component-a component-a-UUID 1
component-b component-b-UUID 1
Required Components:
Name UUID #
-------------------------- ------------------------------------ -
component-a component-a-UUID 1
Required Components:
Name UUID #
-------------------------- ------------------------------------ -
Example Doc 90209809-9785-b89e-c821-0472985982be 1
Example Data EXSOzzt 1
# ls /var/sadm/prod/org.example.ExampleSoft/987573587
/var/sadm/prod/org.example.ExampleSoft/987573587:
No such file or directory
# pkgrm EXSOblob
3. Identify the software that depends on the software you want to reinstall.
# prodreg info -m "name" -a "Dependent Components"
Dependent Components:
Name UUID #
--------------------------- ------------------------------------ -
component-a component-a-UUID 1
Import a certificate Import a trusted certificate with the “How to Import a Trusted Certificate
pkgadm addcert command. into the Package Keystore (pkgadm
addcert)” on page 311
(Optional) Display the details of Display the details of a certificate “How to Display Certificate
one or more certificates with the pkgadm listcert Information (pkgadm listcert)”
command. on page 313
(Optional) Remove a certificate Remove a certificate with the “How to Remove a Certificate
pkgadm removecert command. (pkgadm removecert)”
on page 314
(Optional) Set up a proxy server Specify a proxy server if your system “How to Set Up a Proxy Server
is behind a firewall with a proxy. (pkgadd)” on page 314
Add a signed package After the root certificate is imported, “How to Add a Signed Package
you can add a signed package with (pkgadd)” on page 315
the pkgadd command.
(Optional) Remove a signed Removing a signed package is “How to Remove Software Packages
package identical to removing an unsigned (pkgrm)” on page 324
package.
-storepass storepass Specifies the password that protects the integrity of the
Java keystore.
-keystore certfile Specifies the name and location of the persistent Java
keystore file.
3. Export the Root CA certificate from the Java keystore to a temporary file.
# keytool -export -storepass storepass -alias gtecybertrustca -keystore
gtecybertrustca -keystore /usr/j2se/jre/lib/security/cacerts -file filename
-storepass storepass Specifies the password that protects the integrity of the
Java keystore.
-keystore certfile Specifies the name and location of the keystore file.
Note – View the alias names for certificates with the pkgadm listcert command.
For information about setting up a proxy server, see “How to Set Up a Proxy Server
(pkgadd)” on page 314.
The following example shows how to install a signed package using an HTTP URL as
the device name. The URL must point to a stream-formatted package.
# pkgadd -d http://install/signed-video.pkg
## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete
.
.
.
Add a software packages to the local You can add software packages to “How to Add Software Packages
system the local system with the pkgadd (pkgadd)” on page 317
command.
Add software packages to a spool You can add software packages to a “Adding a Software Package to a
directory spool directory without actually Spool Directory” on page 320
installing the software.
List information about all installed You can list information about “How to List Information About All
software packages installed packages with the Installed Packages (pkginfo)”
pkginfo command. on page 321
Check the integrity of installed You can verify the integrity of install “How to Check the Integrity of
software packages software packages with the pkgchk Installed Software Packages
command. (pkgchk)” on page 322
Remove software packages You can remove unneeded software “How to Remove Software Packages
packages with the pkgrm command. (pkgrm)” on page 324
2. Remove any already installed packages with the same names as the ones you are
adding.
This step ensures that the system keeps a proper record of software that has been
added and removed. There might be times when you want to maintain multiple
versions of the same application on the system. For strategies on maintaining
multiple software copies, see “Guidelines for Removing Packages (pkgrm)”
on page 282, and for task information, see “How to Remove Software Packages
(pkgrm)” on page 324.
The following example shows how to install software packages from a remote system.
In this example, assume that the remote system named package-server has
software packages in the /latest-packages directory. The mount command
mounts the packages locally on /mnt, and the pkgadd command installs the
SUNWpl5u package.
# mount -F nfs -o ro package-server:/latest-packages /mnt
# pkgadd -d /mnt SUNWpl5u
.
If the automounter is running at your site, you do not need to mount the remote
package server manually. Instead, use the automounter path, in this case,
/net/package-server/latest-packages, as the argument to the -d option.
# pkgadd -d /net/package-server/latest-packages SUNWpl5u
.
.
.
Installation of <SUNWpl5u> was successful.
The following example is similar to the previous example, except that it uses the -a
option and specifies an administration file named noask-pkgadd, which is illustrated
in “Avoiding User Interaction When Adding Packages (pkgadd)” on page 283. In this
example, assume that the noask-pkgadd administration file is in the default location,
/var/sadm/install/admin.
# pkgadd -a noask-pkgadd -d /net/package-server/latest-packages SUNWpl5u
.
.
.
Installation of <SUNWpl5u> was successful.
## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete
.
.
.
2. Remove any already spooled packages with the same names as the packages you
are adding.
For information on removing spooled packages, see “Example—Removing a
Spooled Software Package” on page 325.
4. Verify that the package has been copied successfully to the spool directory.
$ pkginfo -d spooldir| grep pkgid
If pkgid is copied correctly, the pkginfo command returns a line of information
about the pkgid. Otherwise, the pkginfo command returns the system prompt.
The following example shows the commands to do this scenario. In this example,
assume that the remote system named package-server has software packages in
the /latest-packages directory. The mount command mounts the package
directory locally on /mnt, and the pkgadd command copies the SUNWpl5p package
from /mnt to the default spool directory (/var/spool/pkg).
# mount -F nfs -o ro package-server:/latest-packages /mnt
# pkgadd -d /mnt -s /var/spool/pkg SUNWpl5p
Transferring <SUNWpl5p> package instance
If the automounter is running at your site, you do not have to mount the remote
package server manually. Instead, use the automounter path, in this case,
/net/package-server/latest-packages, as the argument to the -d option.
# pkgadd -d /net/package-server/latest-packages -s /var/spool/pkg SUNWpl5p
Transferring <SUNWpl5p> package instance
-c Specifies to audit only the file contents, rather than the file
contents and attributes, which is the default.
If no errors occur, the system prompt is returned. Otherwise, the pkgck command
reports the error.
If no errors occur, the system prompt is returned. Otherwise, the pkgck command
reports the error.
Add software packages with You can view or add software “How to Add Software
Admintool packages. Packages With Admintool”
on page 325
Remove software packages You can view or remove “How to Remove Software
with Admintool software packages. Packages With Admintool”
on page 327
The Solaris operating system includes Admintool, which is a graphical user interface
for performing several administration tasks, including adding and removing software
packages. Specifically, you can use Admintool to do the following:
■ Add software packages to a local system
■ Remove software packages from a local system
■ View software already installed on the local system
■ Customize software packages to be installed
■ Specify an alternate installation directory for a software package
3. Start Admintool.
# admintool &
The Users window is displayed.
7. Click Add.
A Command Tool window appears for each package being installed, displaying the
installation output.
The Software window is refreshed to display the packages just added.
2. Start Admintool.
# admintool &
The Users window is displayed.
4. Select the software you want to delete from the local system.
Patch management involves listing or adding Solaris patches from a system running
the Solaris release. Patch management might also involve removing unwanted or
faulty patches. Removing patches is also called backing out patches.
For information on adding patches to diskless client systems, see “Patching Diskless
Client OS Services” on page 138.
Note – Overview information about using the smpatch command with PatchPro has
been removed from this guide. For information about using the smpatch command
with PatchPro, see Signed Patches Administration Guide for PatchPro 2.2.
What Is a Patch?
A patch is a collection of files and directories that replace or update existing files and
directories that are preventing proper execution of the existing software. The existing
software is derived from a specified package format, which conforms to the Application
Binary Interface. For details about packages, see Chapter 22.
329
You can manage patches on your system with the patchadd command. For
step-by-step instructions on adding an unsigned patch to your system, see “Managing
Unsigned Solaris Patches (Task Map)” on page 341.
Patches that are available for the Solaris 2.6, 7, 8, and 9 releases include a digital
signature. Patches without a digital signature, or unsigned patches, are also available,
but eventually, all patches will be signed patches. A valid digital signature ensures that
the patch has not been modified since the signature was applied.
Signed patches are stored in Java archive format (JAR) files and are available from the
SunSolve OnlineSM web site.
In previous Solaris releases, you could use the smpatch command with PatchPro to
add signed patches to your system. For step-by-step instructions on using the
smpatch command, see “Managing Signed Patches by Using Solaris Patch
Management Tools (Tasks)” in Signed Patches Administration Guide for PatchPro 2.2.
In this Solaris release, you can use the patchadd command to add signed patches to
your system. For step-by-step instructions on using the patchadd command, see
“Adding Signed Patches With patchadd Command (Task Map)” on page 337.
For additional overview information about signed patches, see “Signed Packages and
Patches” on page 275.
SunSpectrum contract You have access to the SunSolve database of patches and
customer patch information. They are available from the SunSolve
Online web site or by using anonymous ftp.
These patches are updated nightly.
Not a SunSpectrum contract You have access to a general set of security patches and other
customer recommended patches. These patches are available through
SunSolve Online.
You can access Solaris patches from a web site or by using anonymous ftp.
To access patches from a web site, you need a system that is:
■ Connected to the Internet
■ Capable of running a web browser such as the Netscape™ software.
Access patches from the SunSolve OnlineSM web site by using the following URL:
http://sunsolve.Sun.COM/pub-cgi/show.pl?target=patches/patch-access
You can install either a patch cluster of recommended patches or individual patches
that are freely available. Patch reports are also available.
How do I get this tool? Bundled in Solaris Must download tool Must download tool Run tool from
release (SUNWswmt) from from http://www.sun.
http://www.sun. http://www.sun. com/PatchPro
com/PatchPro com/PatchPro
Solaris release Solaris 2.6, 7, 8, and Solaris 2.6, 7, and 8 Solaris 9 Solaris 2.6, 7, 8, and
availability 9 releases 9
Adds unsigned Yes No Yes, but the patches Yes, but the patches
patches? must be unzipped must be unzipped
first first
Analyzes system for No Yes, both signed and Yes, both signed and Yes, unsigned
required patches and unsigned patches unsigned patches patches only
downloads signed or
unsigned patches
Detailed information about how to install and back out a patch is provided in the
patchadd(1M) and patchrm(1M) man pages. Each patch also contains a README file
that contains information about the patch.
smpatch download and Use these commands to download and apply one “Downloading and Applying
smpatch add or more patches to your system. These Signed Patches to a Solaris
commands also download and apply any System (Task Map)” in Signed
prerequisite patches. Patches Administration Guide
for PatchPro 2.2
ftp and smpatch add Use the ftp command to transfer a patch or “Downloading and Applying
patches to your system. Then, use the smpatch Signed Patches to a Solaris
add command to add the patch or patches to System (Task Map)” in Signed
your system. Patches Administration Guide
for PatchPro 2.2
Solaris Management Console For Solaris 9 systems only – Use this tool when Solaris Management Console
Patches Tool you want the convenience of a GUI tool to online help
manage signed patches.
This chapter provides step-by-step instructions for managing patches in the Solaris
environment.
For overview information about managing patches in the Solaris environment, see
Chapter 24.
Note – Step-by-step instructions for using the smpatch command with PatchPro has
been removed from this guide. For information about using the smpatch command
with PatchPro, see Signed Patches Administration Guide for PatchPro 2.2.
335
Task Description For Instructions
1. Set up the package keystore Import Sun’s Root CA certificate into your “How to Import a Trusted
package keystore. Certificate into Your Package
Keystore (pkgadm addcert)”
on page 337
(Optional) Set up a proxy Specify a proxy server if your system is behind “How to Set Up a Proxy Server
server a firewall with a proxy. (patchadd)” on page 339
2. Download and add the Select one of the following to download and
signed patch add the signed patch to your system with the
patchadd command.
You can manually download and add a signed “How to Manually Download
Solaris patch. and Add a Signed Solaris Patch
(patchadd)” on page 339
2. Export the Root CA certificate from the Java keystore into a temporary file.
For example:
# keytool -export -storepass changeit -alias gtecybertrustca -keystore
gtecybertrustca -keystore /usr/j2se/jre/lib/security/cacerts -file
/tmp/root.crt
Certificate stored in file </tmp/root.crt>
-storepass storepass Specifies the password that protects the integrity of the
Java keystore.
-keystore certfile Specifies the name and location of the keystore file.
3. Import the Root CA certificate into the package keystore from the temporary file.
For example:
# pkgadm addcert -t -f der /tmp/root.crt
Enter Keystore Password: storepass
Keystore Alias: GTE CyberTrust Root
Common Name: GTE CyberTrust Root
Certificate Type: Trusted Certificate
Issuer Common Name: GTE CyberTrust Root
Validity Dates: <Feb 23 23:01:00 1996 GMT>-<Feb 23 23:59:00 ...
MD5 Fingerprint: C4:D7:F0:B2:A3:C5:7D:61:67:F0:04:CD:43:D3:BA:58
SHA1 Fingerprint: 90:DE:DE:9E:4C:4E:9F:6F:D8:86:17:57:9D:D3:91...
This procedure assumes that you have set up the package keystore.
3. Determine if you are going to download a specific patch or patch cluster. Then
select one of the following:
a. Type the patch number (patch-ID) in the “Find Patch” search field. Then, click
on Find Patch.
Entering patch-ID downloads the latest patch revision.
If this patch is freely available, the patch README is displayed. If this patch is
not freely available, an ACCESS DENIED message is displayed.
There are different patch numbers for SPARC and x86 systems, which are listed
in the displayed patch README. Make sure you install the patch that matches
your system architecture.
This procedure assumes that you have set up the package keystore.
2. Identify the HTTP URL for the patch you want to download.
c. Place your mouse over the HTTPS link at the top of the patch page in hover
mode.
The URL for the patch is displayed in the browser status line at the bottom of
the screen.
3. Download and add the signed patch or patches from the SunSolve Online web
site.
For example:
# patchadd "http://sunsolve.central.sun.com/cgi/patchDownload.pl?target=
114684&method=hs"
.
.
.
Downloading patch from ...
+ dwnld_file http://sunsolve.central.sun.com/cgi/patchDownload.pl?target=
114684&method=hs /tmp/patchadd-dwnld /var/sadm/security console patchadd
...........20%...........40%...........60%...........80%...........100%
## Downloading...
## Download Complete
.
.
.
Enter keystore password: xxx
.
.
.
1. (Optional) Display Display information about unsigned patches “How to Display Information
information about unsigned already installed on your system. About Solaris Patches”
patches on page 342
2. Download an unsigned Download an unsigned patch to your system. “How to Download an Unsigned
patch Solaris Patch” on page 344
3. Add an unsigned patch Add an unsigned patch to your system. “How to Add a Unsigned Solaris
Patch (patchadd)” on page 344
4. (Optional) Remove an If necessary, remove an unsigned patch from “How to Remove an Unsigned
unsigned patch your system. Solaris Patch” on page 346
Command Description
patchadd -p, showrev -p Shows all patches that have been applied to a
system.
pkgparam pkgid PATCHLIST Shows all patches that have been applied to the
package identified by pkgid, the name of the
package. For example, SUNWadmap.
Use the following command to verify whether a specific patch is installed on your
system. For example:
$ patchadd -p | grep 111879
If you need to add a patch to a diskless client system, see “Patching Diskless Client OS
Services” on page 138.
When you add a patch, the patch tools call the pkgadd command to install the patch
packages from the patch directory to a local system’s disk. More specifically, the patch
tools do the following:
■ Determine the Solaris version number of the managing host and the target host
■ Update the patch package’s pkginfo file with information about patches
obsoleted by the patch being installed, other patches required by this patch, and
patches incompatible with this patch
During patch installation, the patchadd command keeps a log of the patch
installation in the /var/sadm/patch/patch-ID/log file for current Solaris versions.
The patchadd command will not install a patch under the following conditions:
■ The package is not fully installed on the host.
■ The patch packages architecture differs from the system’s architecture.
■ The patch packages version does not match the installed package’s version.
■ A patch with the same base code and a higher version number is already installed.
■ The patch is incompatible with another, already installed patch. Each installed
patch keeps this information in its pkginfo file.
■ The patch being installed requires another patch that is not installed.
When you add or remove patches with the smpatch command, the command
prompts you for authentication information if you do not specify the information in
the command line.
You can specify authentication information to the smpatch command using the
following syntax:
# smpatch add -p mypassword -u root -- -i patch-ID-revision
The smpatch subcommands, such as add or remove, are separated from the
authentication options and arguments by --.
Or, you can let the smpatch command prompt you for the authentication information.
# /usr/sadm/bin/smpatch add -i patch-ID-revision
Type /? for help, pressing <enter> accepts the default denoted by [ ]
Please enter a string value for: password ::
Loading Tool: com.sun.admin.patchmgr.cli.PatchMgrCli from holoship
Login to holoship as user root was successful.
Download of com.sun.admin.patchmgr.cli.PatchMgrCli from holoship was
successful.
3. Determine if you are going to download a specific patch or patch cluster. Then,
select one of the following:
a. Type the patch number (patch-ID) in the “Find Patch” search field. Then, click
on Find Patch.
Entering patch-ID downloads the latest patch revision.
If this patch is freely available, the patch README is displayed. If this patch is
not freely available, an ACCESS DENIED message is displayed.
There are different patch numbers for SPARC and x86 systems, which are listed
in the displayed patch README. Make sure you install the patch that matches
your system architecture.
1. Become superuser.
This procedure assumes that the patch is has already been downloaded to the
/var/sadm/spool directory and is unzipped.
1. Become superuser.
The patch tools call the pkgadd command to restore packages that were saved from
the initial patch installation.
During the patch removal process, the patchrm command keeps a log of the back out
process in /tmp/backoutlog.process_id. This log file is removed if the patch backs
out successfully.
1. Become superuser.
The following example shows how to remove a Solaris 9 patch with the smpatch
remove command.
# /usr/sadm/bin/smpatch remove -i 115028-01
Authenticating as user: root
.
.
.
This topic map lists the chapters that provide information on managing devices.
349
350 System Administration Guide: Basic Administration • April 2004
CHAPTER 27
Device management in the Solaris environment usually involves adding and removing
peripheral devices from systems, possibly adding a third-party device driver to
support a device, and displaying system configuration information.
351
TABLE 27–1 Where to Find Instructions for Adding a Device
Hot-plugging a SCSI or PCI device “SCSI Hot-Plugging With the cfgadm Command”
on page 366 or “x86: PCI Hot-Plugging With the cfgadm
Command” on page 376
Hot-plugging a USB device “Hot-Plugging USB Devices (Task Map)” on page 415
Adding a CD-ROM or tape device “How to Add a Peripheral Device” on page 359
The Solaris software does not directly communicate with all these devices. Each type
of device requires different data formats, protocols, and transmission rates.
A device driver is a low-level program that allows the operating system to communicate
with a specific piece of hardware. The driver serves as the operating system’s
“interpreter” for that piece of hardware.
The system determines what devices are attached to it at boot time. Then, the kernel
configures itself dynamically, loading needed modules into memory. At this time,
device drivers are loaded when devices, such as disk and tape devices, are accessed.
This process is called autoconfiguration because all kernel modules are loaded
automatically when they are needed.
You can customize the way in which kernel modules are loaded by modifying the
/etc/system file. For instructions on modifying this file, see system(4).
You will use autoconfiguration is used by a system administrator when you add a new
device (and driver) to the system. At this time, you will perform a reconfiguration
boot so that the system will recognize the new device.
At a minimum, this software includes a device driver and its associated configuration
(.conf) file. The .conf files reside in the drv directories. This software might also
include custom maintenance and administrative utilities since the device might be
incompatible with Solaris utilities.
For information on the device names that are used to identify devices on the system,
see “Device Naming Conventions” on page 434.
This message does not always mean that a driver is unavailable for this device. This
message means that no driver is currently attached to the device instance because there
is no device at this node or the device is not in use. Drivers are loaded automatically
when the device is accessed and unloaded when the device is not in use.
For example, the following prtconf output identifies a device at instance #3 and
instance #6, which is probably a disk device at target 3 and a CD-ROM device at
target 6 of the first SCSI host adapter (esp, instance #0).
$ /usr/sbin/prtconf
.
.
.
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1 (driver not attached)
sd, instance #2 (driver not attached)
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
sd, instance #6
.
.
.
You can use the following command to display only the devices that are attached to
the system.
$ prtconf | grep -v not
You can also glean device information from the sysdef output.
Use the sysdef command to display system configuration information that include
pseudo devices, loadable modules, and selected kernel parameters.
# /usr/sbin/sysdef
The dmesg output is displayed as messages on the system console and identifies
which devices are connected to the system since the last reboot.
Use the “How to Add a Peripheral Device” on page 359 procedure to add the
following devices that are not hot-pluggable to a system:
■ CD-ROM
■ Secondary disk drive
■ Tape drive
■ SBUS card
In some cases, you might have to add a third-party device driver to support the new
device.
2. Follow steps 2 and 3 of “How to Add a Device Driver” on page 360 if you need
to add a device driver to support the device.
-i0 Brings the system to the 0 init state, which is the appropriate
state for turning the system power off for adding and
removing devices.
5. Select one of the following to turn off power to the system after it is shut down.
b. For x86 platforms, it is safe to turn off power if the type any key to
continue prompt is displayed.
Refer to the hardware installation guide that accompanies your system for the
location of the power switch.
7. Install the peripheral device, making sure that the device you are adding has a
different target number than the other devices on the system.
You often will find a small switch located at the back of the disk for selecting the
target number.
Refer to the hardware installation guide that accompanies the peripheral device for
information on installing and connecting the device.
9. Verify that the peripheral device has been added by attempting to access the
device.
For information on accessing the device, see Chapter 30.
1. Become superuser.
-d device Identifies the device path name that contains the package.
This chapter provides instructions for dynamically configuring devices in the Solaris
environment. You can add, remove, or replace devices in the Solaris environment
while the system is still running, if the system components support hot-plugging. If
the system components do not support hot-plugging, you can reboot the system to
reconfigure the devices.
For information on hot-plugging USB devices with the cfgadm command, see
“Hot-Plugging USB Devices With the cfgadm Command” on page 426.
You can hot-plug the following devices with the cfgadm command:
361
■ USB devices on SPARC and x86 platforms
■ SCSI devices on SPARC and x86 platforms
■ PCI devices on x86 platforms
The benefit of using the cfgadm command to reconfigure systems components is that
you can add, remove, or replace components while the system is running. An added
benefit is that the cfgadm command guides you through the steps needed to add,
remove, or replace system components.
Note – Not all SCSI and PCI controllers support hot-plugging with the cfgadm
command.
Without any high availability software, you can replace a failed device by manually
stopping the appropriate applications, unmounting noncritical file systems, and then
proceeding with the add or remove operations.
Attachment Points
The cfgadm command displays information about attachment points, which are
locations in the system where dynamic reconfiguration operations can occur.
Attachment points are represented by logical and physical attachment point IDs
(Ap_Ids). The physical Ap_Id is the physical pathname of the attachment point. The
logical Ap_Id is a user-friendly alternative for the physical Ap_Id. For more
information on Ap_Ids, refer to cfgadm(1M).
The logical Ap_Id for a SCSI Host Bus Adapter (HBA), or SCSI controller, is usually
represented by the controller number, such as c0.
In cases where no controller number has been assigned to a SCSI HBA, then an
internally-generated unique identifier is provided. An example of a unique identifier
for a SCSI controller is the following:
fas1:scsi
The logical Ap_Id for a SCSI device usually looks like this:
HBA-logical-apid::device-identifier
In the following example, c0 is the logical Ap_Id for the SCSI HBA:
c0::dsk/c0t3d0
The device identifier is typically derived from the logical device name for the device in
the /dev directory. For example, a tape device with logical device name,
/dev/rmt/1, has the following logical Ap_Id:
c0::rmt/1
If a logical Ap_Id of a SCSI device cannot be derived from the logical name in the
/dev directory, then an internally-generated unique identifier is provided. An
example of an identifier for the /dev/rmt/1 tape device is the following:
c0::st4
The receptacle and occupant states for the SCSI HBA attachment points are as follows:
Receptacle and occupant states for SCSI device attachment points are as follows:
The state of SCSI attachment points is unknown unless there is special hardware to
indicate otherwise. For instructions on displaying SCSI component information, see
“How to Display Information About SCSI Devices” on page 366.
For example, if a system has only one Ethernet card installed in it, the Ethernet card
cannot be detached without losing the network connection. This detachment requires
additional layered software support to keep the network connection active.
For step-by-step instructions on adding or removing a PCI adapter card, see “x86: PCI
Hot-Plugging With the cfgadm Command” on page 376.
7. Add a SCSI device to a SCSI Add a specific SCSI device to “SPARC: How to Add a SCSI
bus a SCSI bus. Device to a SCSI Bus”
on page 370
8. Replace an identical device Replace a device on the SCSI “SPARC: How to Replace an
on a SCSI controller bus with another device of the Identical Device on a SCSI
same type. Controller” on page 371
9. Remove a SCSI device Remove a SCSI device from “SPARC: How to Remove a
the system. SCSI Device” on page 372
These procedures use specific devices as examples to illustrate how to use the cfgadm
command to hot-plug SCSI components. The device information that you supply, and
that the cfgadm command displays, depends on your system configuration.
Note – If the SCSI device is not supported by the cfgadm command, it does not
display in the cfgadm command output.
1. Become superuser.
In the following procedures, only SCSI attachment points are listed. The attachment
points that are displayed on your system depend on your system configuration.
1. Become superuser.
If the unconfigure operation fails, see “How to Resolve a Failed SCSI Unconfigure
Operation” on page 375.
1. Become superuser.
1. Become superuser.
Caution – Disconnecting a SCSI device must be done with caution, particularly when
you are dealing with controllers for disks that contain critical file systems such as root
(/), usr, var, and the swap partition. The dynamic reconfiguration software cannot
detect all cases where a system hang might result. Use this procedure with caution.
1. Become superuser.
Caution – This command suspends all I/O activity on the SCSI bus until the
cfgadm -c connect command is used. The cfgadm command does some basic
checking to prevent critical partitions from being disconnected, but it cannot detect
all cases. Inappropriate use of this command can result in a system hang and could
require a system reboot.
1. Become superuser.
Note – When you add devices, you specify the Ap_Id of the SCSI HBA (controller) to
which the device is attached, not the Ap_Id of the device itself.
1. Become superuser.
1. Become superuser.
3. Replace a device on the SCSI bus with another device of the same type.
# cfgadm -x replace_device c1::dsk/c1t4d0
Replacing SCSI device: /devices/sbus@1f,0/SUNW,fas@1,8800000/sd@4,0
This operation will suspend activity on SCSI bus: c1
1. Become superuser.
4. Verify that the device has been removed from the system.
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
If you use the cfgadm command to remove a system resource, such as a swap device
or a dedicated dump device, an error messages similar to the following is displayed if
the system resource is still active.
Error Message
cfgadm: Component system is busy, try again: failed to offline:
device path
Resource Information
------------------ --------------------------
/dev/dsk/device-name swap area
Cause
You attempted to remove or replace one or more configured swap areas.
Solution
Unconfigure the swap areas on the device that is specified and retry the cfgadm
operation.
Error Message
cfgadm: Component system is busy, try again: failed to offline:
device path
Resource Information
------------------ --------------------------
/dev/dsk/device-name dump device (swap)
Cause
You attempted to remove or replace a dump device that is configured on a swap
area.
Solution
Unconfigure the dump device that is configured on the swap area and retry the
cfgadm operation.
Error Message
cfgadm: Component system is busy, try again: failed to offline:
device path
Resource Information
------------------ --------------------------
/dev/dsk/device-name dump device (dedicated)
Cause
You attempted to remove or replace a dedicated dump device.
Solution
Unconfigure the dedicate dump device and retry the cfgadm operation.
1. Display PCI Slot Display the status of PCI “x86: How to Display PCI Slot
Configuration Information hot-pluggable devices and Configuration Information”
slots on the system. on page 376
2. Remove a PCI adapter card Unconfigure the card, “x86: How to Remove a PCI
disconnect power from the Adapter Card” on page 377
slot, and remove the card
from the system.
3. Add a PCI adapter card Insert the adapter card into a “x86: How to Add a PCI
hot-pluggable slot, connect Adapter Card” on page 377
power to the slot, and
configure the card.
In the examples, only PCI attachment points are listed, for brevity. The attachment
points that are displayed on your system depend on your system configuration.
1. Become superuser.
The logical Ap_Id, pci1:hpc0_slot0, is the logical Ap_Id for hot-pluggable slot,
Slot 7. The component hpc0 indicates the hot-pluggable adapter card for this slot,
and pci1 indicates the PCI bus instance. The Type field indicates the type of PCI
adapter card that is present in the slot.
8. Open the slot latches and remove the PCI adapter card.
4. Determine which slot the PCI adapter card is in once it is inserted. Close the
latches.
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp disconnected unconfigured unknown
pci1:hpc0_slot4 unknown empty unconfigured unknown
Cause
An invalid transition was attempted.
Cause
The specified attachment point was not found.
Solution
Check whether the attachment point is correct. Use the cfgadm command to
display a list of available attachment points. Also check the physical path to see if
the attachment point is still there.
Note – In addition to the cfgadm command, several other commands are helpful
during hot-pluggable operations. The prtconf command displays whether Solaris
recognizes the hardware. After adding hardware, use the prtconf command to verify
that the hardware is recognized. After a configure operation, use the prtconf -D
command to verify that the driver is attached to the newly installed hardware device.
You can use the new RCM script feature to write your own scripts to shut down your
applications, or to cleanly release the devices from your applications during dynamic
reconfiguration. The RCM framework launches a script automatically in response to a
reconfiguration request, if the request impacts the resources that are registered by the
script.
You can also release resources from applications manually before you could
dynamically remove the resource. Or, you could use the cfgadm command with the
-f option to force a reconfiguration operation, but this option might leave your
applications in an unknown state. Also, the manual release of resources from
applications commonly causes errors.
The RCM script feature simplifies and better controls the dynamic reconfiguration
process. By creating an RCM script, you can do the following:
For example, an RCM script for a tape backup application can inform the tape backup
application to close the tape drive or shut down the tape backup application.
The RCM daemon runs one instance of a script at a time. For example, if a script is
running, the RCM daemon does not run the same script until the first script exits.
5. Write the RCM script Write the RCM script based “Tape Backup RCM Script
on the information identified Example” on page 385
in the previous tasks.
6. Install the RCM script Add the script to the “How to Install an RCM
appropriate script directory. Script” on page 383
7. Test the RCM script Test the script by running the “How to Test an RCM Script”
script commands manually on page 384
and by initiating a dynamic
reconfiguration operation.
4. Write the RCM script Write the RCM script based “Tape Backup RCM Script
on the information identified Example” on page 385
in the previous tasks.
5. Install the RCM script Add the script to the “How to Install an RCM
appropriate script directory. Script” on page 383
6. Test the RCM script Test the script by running the “How to Test an RCM Script”
script commands manually on page 384
and by initiating a dynamic
reconfiguration operation.
vendor Is the stock symbol of the vendor that provides the script, or any
distinct name that identifies the vendor.
2. Test the script by running the script commands manually from the command
line.
For example:
$ script-name scriptinfo
$ script-name register
$ script-name preremove resource-name
$ script-name postremove resource-name
3. Make sure each RCM script command in your script prints appropriate output to
stdout.
Caution – Make sure that you are familiar with these commands because they can
alter the state of the system and can cause system failures.
Here are the various outcomes if you use the cfgadm command to remove a tape
device with the RCM script.
■ If you use the cfgadm command and the backup application is not using the tape
device, the operation succeeds.
■ If you use the cfgadm command without the -f option and the backup
application is using the tape device, the operation fails with an error message
similar to the following:
tape backup in progress pid=...
■ If you use the cfgadm -f command and the backup application is using the tape
device, the script stops the backup application and the cfgadm operation succeeds.
use strict;
my ($cmd, %dispatch);
$cmd = shift(@ARGV);
# dispatch table for RCM commands
%dispatch = (
"scriptinfo" => \&do_scriptinfo,
"register" => \&do_register,
"resourceinfo" => \&do_resourceinfo,
"queryremove" => \&do_preremove,
"preremove" => \&do_preremove
);
if (defined($dispatch{$cmd})) {
&{$dispatch{$cmd}};
} else {
exit (2);
}
sub do_register
{
my ($dir, $f, $errmsg);
closedir(RMT);
exit (0);
}
sub do_resourceinfo
{
my ($rsrc, $unit);
$rsrc = shift(@ARGV);
if ($rsrc =~ /^\/dev\/rmt\/([0-9]+)$/) {
$unit = $1;
print "rcm_resource_usage_info=Backup Tape Unit Number $unit\n";
exit (0);
} else {
print "rcm_failure_reason=Unknown tape device!\n";
exit (1);
}
}
sub do_preremove
{
my ($rsrc);
$rsrc = shift(@ARGV);
This chapter provides an overview of Universal Serial Bus (USB) devices and
step-by-step instructions for using USB devices in the Solaris environment.
For information on the procedures associated with using USB devices, see the
following:
■ “Managing USB Devices in the Solaris Environment (Roadmap)” on page 404
■ “Using USB Mass Storage Devices (Task Map)” on page 405
■ “Hot-Plugging USB Devices (Task Map)” on page 415
■ “Using USB Audio Devices (Task Map)” on page 419
■ “Hot-Plugging USB Devices With the cfgadm Command (Task Map)” on page 425
For information on configuring USB printers, see “What’s New in Printing?” in System
Administration Guide: Advanced Administration.
389
What’s New in USB Devices?
The following sections describe USB device enhancements in this Solaris release.
For specific details on the how the USB dual framework works, go to
http://www.sun.com/desktop/whitepapers.html.
Compatibility problems might occur if you attempt to plug a USB device into a port,
directed by a framework that does not recognize a proper driver for that device
because the driver is incompatible. When a framework tries to attach a
framework-incompatible driver for a device, you will see console messages similar to
the following:
The driver for device binding name is not for USBA1.0
This message will appear, for example, when a device operated by a non-Sun driver,
which is compatible with USBA 1.0 framework, is plugged into a port supported by
the original USBA 1.0 framework. The USBA 1.0 framework recognizes the device and
tries to map the correct driver, but the driver is rejected because it is incompatible with
the framework operating the port.
USB 1.1 SPARC and x86 SPARC and x86 SPARC and x86
*Note that this is not the Solaris 8 releases, but the Solaris 8 HW releases, starting with
the Solaris 8 HW 5/03 release. The patch number for the USB dual framework found
in the Solaris 8 HW 5/03 release is 109896.
Sun Blade 100, 150, 1000, Solaris 9 releases, before the All USB devices at 12 Mb/sec
and 2000 Solaris 9 4/04 release, and
Solaris 8 releases before the
Solaris HW 5/03 release
Sun Blade 100, 150, 1000, Solaris 9 4/04 and Solaris 8 USB 1.1 devices at 12 Mb/sec
and 2000 HW 5/03 (connected to any USB ports)
USB 2.0 devices at 12 Mb/sec
(connected to motherboard ports)
USB 2.0 devices at 480 Mb/sec
(connected to ports on add-on PCI
USB 2.0 card)
Sun Blade 1500 and 2500 Solaris 9 4/04 and Solaris 8 USB 1.1 devices at 12 Mb/sec
HW 5/03 (connected to any USB ports)
USB 2.0 devices at 12 Mb/sec
(connected to motherboard ports)
USB 2.0 devices at 480 Mb/sec
(connected to ports on PCI combo
card)
Other Sun SPARC PCI Solaris 9 4/04 and Solaris 8 USB 1.1 devices at 12 Mb/sec
platforms HW 5/03
USB 2.0 devices at 480 Mb/sec
(connected to ports on add-on PCI
USB 2.0 card)
For information about PCI cards verified on the Solaris release, go to:
http://www.sun.com/io_technologies/USB.html
Sun Microsystems platforms that provide support for USB devices include the
following:
■ SPARC based systems with OHCI host controllers that support USB 1.1 provide
low- and full-speed devices:
■ Sun Blade™ systems that run the Solaris 8 or 9 releases.
■ Netra™ X 1/T1 and some Sun Fire™ systems that run the Solaris 9 release.
■ SPARC based systems with OHCI and EHCI host controllers, such as the Sun Blade
1500 or 2500 systems, provide high-speed support for USB 2.0 devices and low-
and full-speed support for USB 1.1 devices. Systems include any PCI-based sun4u
system that run the Solaris 8 HW 5/03 release or Solaris 9 4/04 release, including
the systems listed above when they are equipped with a USB 2.0 PCI card.
■ x86 based systems that run the Solaris 8 or 9 x86 Platform Editions with the
following controller types:
■ OHCI or UHCI host controllers provide USB 1.1 support
■ EHCI and OHCI host controllers together provide USB 1.1 and 2.0 support
■ Use of USB 2.0 devices on ports that are operated by host controller hardware with
EHCI and UHCI on the same chip or PCI card, is not recommended.
For additional USB support information, see “Overview of USB Devices” on page 397.
For a description of USB devices and terminology, see “Overview of USB Devices”
on page 397.
Some of the USB device that are supported on SPARC based and x86 based systems in
this Solaris release are as follows:
■ Mass storage devices – CD-RWs, hard disks, DVD, digital cameras, Zip, diskettes,
and tape drives
■ Keyboard, mouse devices, speakers and microphones
■ Audio devices
For a full listing of USB devices that have been verified on the Solaris release, go to:
http://www.sun.com/io_technologies/USB.html
Additional storage devices might work by modifying the scsa2usb.conf file. For
more information, see the scsa2usb(7D) man page.
Note – USB 1.1 devices will not operate when connected to a USB 2.0 hub that is
connected to a USB 2.0 port.
■ While USB 2.0 devices operate on a USB 1.x port, their performance is significantly
better when connected to a USB 2.0 port.
■ Most USB 2.0 host controllers have one high-speed Enhanced Host Controller
(EHCI) and one or more low- or full-speed OpenHCI Host Controller (OHCI)
embedded controllers. Devices connected to a USB 2.0 port are dynamically
Note – USB 2.0 storage devices connected to a port on a USB 2.0 PCI card, and that
were used with a prior Solaris release in the same hardware configuration, can
change device names after upgrading to this release. This change occurs because
these devices are now seen as USB 2.0 devices and are taken over by the EHCI
controller. The controller number, w in /dev/[r]dsk/cwtxdysz, is changed for
these devices.
For more information on USB 2.0 device support, see the ehci(7D) and usba(7D)
man pages.
Bus-Powered Devices
Bus-powered hubs use power from the USB bus to which they are connected, to
power devices connected to them. Special care must be taken to not overload these
hubs, since the power these hubs offer to their downstream devices is limited.
■ Do not cascade bus-powered hubs. For example, do not connect one bus-powered
hub to another bus-powered hub.
■ Avoid connecting bus-powered devices to bus-powered hubs, except for
low-speed, low-power devices, such as keyboards or mice. Connecting
high-powered devices such as disks, speakers, or microphones to a bus-powered
hub could cause power-shortages for all devices connected to that hub. This
scenario could cause these devices to behave unpredictably.
For more information on using USB mass storage devices, see the scsa2usb(7D)
man page.
If you have problems accessing a device that was connected while the system is
running, try the following command:
# devfsadm
■ Do not move devices around if the system has been powered down by a suspend
operation. For more information, see “SPARC: USB Power Management”
on page 403.
■ If a device has been hot removed while in use by applications and is no longer
available, then stop the applications. Use the prtconf command to see whether
the device node has been removed.
Support for ugen is only available on ports operated by the USBA 1.0 framework.
To discover whether a port is operated by the USBA 1.0 framework, plug the
device into the port. Then, issue the prtconf -D command. The prtconf -D
hierarchy tree shows the device on the port, which is currently unbound to a
driver, as device. Traverse up the prtconf hierarchy tree until you see an entry that
has a driver with ohci, ehci, or uhci in its name. The ohci, ehci, or uhci entry
represents the host controller. If the host controller driver name begins with
usba10_, the devices in it’s subtree are operated by the USBA 1.0 framework.
For more information, refer to the ugen(7D) man page and the USB DDK at:
http://developers.sun.com/solaris/developer/support/driver/usb.html
■ Digi Edgeport USB support – Provides support for several Digi Edgeport USB to
serial port converter devices.
■ New devices are accessed as /dev/term/[0-9]* and /dev/cua/[0-9]*.
■ USB serial ports are usable as any other serial port would be, except that they
cannot serve as a local serial console. The fact that their data is run through a
USB port is transparent to the user.
If there are USB 2.0 and USB 1.x devices on the system, the EHCI and OHCI drivers
hand-off device control depending upon the type of device that is connected to the
system.
■ The USB 2.0 PCI card has one EHCI controller and one or more OHCI controllers.
■ A USB 1.1 device is dynamically assigned to the OHCI controller when it is plugged
in. A USB 2.0 device is dynamically assigned to the EHCI controller when it is
plugged in.
USB connectors are designed to fit only one type of cable, one way. The primary
design motivation for USB was to alleviate the need for multiple connector types for
different devices. This design reduces the clutter on the back panel of a system.
This table lists specific USB devices that are supported in the Solaris environment.
HID control on audio devices SPARC based and x86 based systems.
Keyboards and mouse devices SPARC based and x86 based systems.
Acronym Definition
USB employs a topology in which hubs provide attachment points for USB devices.
The host controller contains the root hub, which is the origin of all USB ports in the
system. For more information about hubs, see “USB Host Controller and Root Hub”
on page 402.
System
Printer
Figure 29–1 shows a system with three active USB ports. The first USB port connects a
Zip drive. The second USB port connects an external hub, which in turn, connects a
cdrw device and a composite keyboard/mouse device. As a composite device, this
keyboard contains a USB controller, which operates both the keyboard and an attached
mouse. The keyboard and the mouse share a common USB bus address because they
are directed by the same USB controller.
Figure 29–1 also shows an example of a hub and a printer as a compound device. The
hub is an external hub that is enclosed in the same casing as the printer. The printer is
permanently connected to the hub. The hub and printer have separate USB bus
addresses.
The device tree path name for some of the devices that are displayed in Figure 29–1
are listed in this table.
Mouse /pci@1f,4000/usb@5/hub@2/device@1/mouse@1
Printer /pci@1f,4000/usb@5/hub@3/printer@1
The Human Interface Device (HID) class contains devices that are user-controlled such
as keyboards, mouse devices, and joysticks. The Communication Device class contains
devices that connect to a telephone, such as modems or an ISDN interface. Other
device classes include the Audio, Monitor, Printer, and Storage Device classes. Each
USB device contains descriptors that reflect the class of the device. A device class
specifies how its members should behave in configuration and data transfer. You can
obtain additional class information from http://www.usb.org.
Driver binding is achieved by using the compatible name properties. For more
information, refer to 3.2.2.1 of the IEEE 1275 USB binding and Writing Device Drivers.
A driver can either bind to the entire device and control all the interfaces, or can bind
to just one interface. If no vendor or class driver claims the entire device, a generic
USB multi-interface driver is bound to the device-level node. This driver attempts to
bind drivers to each interface by using compatible names properties, as defined in
section 3.3.2.1 of the IEEE 1275 binding specification.
The Solaris USB Architecture (USBA) adheres to the USB 1.1 and USB 2.0
specifications plus Solaris driver requirements. The USBA model is similar to Sun
Common SCSI Architecture (SCSA). The USBA is a thin layer that provides a generic
USB transport-layer abstraction to client drivers, providing them with services that
implement core generic USB functionality.
USBA
Host controller
drivers
Bus with
devices
The USB host controller has an embedded hub called the root hub. The ports that are
visible at the system’s back panel are the ports of the root hub. The USB host controller
is responsible for the following:
■ Directing the USB bus. Individual devices cannot arbitrate for the bus.
■ Polling the devices by using a polling interval that is determined by the device.
The device is assumed to have sufficient buffering to account for the time between
the polls.
■ Sending data between the USB host controller and its attached devices.
Peer-to-peer communication is not supported.
The USB framework makes a best effort to power manage all devices on SPARC-based
systems with power management enabled. Power managing a USB device means that
the hub driver suspends the port to which the device is connected. Devices that
support remote wake up can notify the system to wake up everything in the device’s
path, so that the device can be used. The host system could also wake up the device if
an application sends an I/O to the device.
All HID (keyboard, mouse, speakers, microphones), hub, and storage devices are
power-managed by default if they support remote wake up capability. A USB printer
is power-managed only between two print jobs. Devices that are directed by the
generic USB driver (UGEN) are power managed only when they are closed.
When power management is running to reduce power consumption, USB leaf devices
are powered down first. After all devices that are connected to a hub’s ports are
powered down, the hub is powered down after some delay. To achieve the most
efficient power management, do not cascade many hubs.
Using USB devices USB devices must be “Using USB Mass Storage
formatted before file systems Devices (Task Map)”
can be created and mounted. on page 405
Add USB audio devices Use this map to identify tasks “Using USB Audio Devices
associated with adding USB (Task Map)” on page 419
audio devices.
Prepare to use a USB mass Prepare to use a USB mass “Preparing to Use a USB Mass
storage device storage device with vold Storage Device With vold
running. Running” on page 407
Display USB device Use the prtconf command “How to Display USB Device
information to display information about Information (prtconf)”
USB devices. on page 408
Format a USB mass storage Format a USB mass storage “How to Format a USB Mass
device device so that you can put Storage Device Without vold
data on it. Running” on page 410
Mount a USB mass storage Mount a USB mass storage “How to Mount or Unmount
device device with vold running. a USB Mass Storage Device
With vold Running”
on page 411
(Optional) Disable USB device Disable USB device drivers if “How to Disable Specific USB
drivers you do not want the USB Drivers” on page 414
support on your system.
(Optional) Remove unused Remove unused USB device “How to Remove Unused
USB device links links with the devfsadm USB Device Links”
command. on page 414
Note – For up-to-date information on using USB mass storage devices in this Solaris
release, see “USB Mass Storage Devices” on page 395.
An easy way to find out which framework is operating your device is to use the
prtconf -D command before and after plugging in your device. By using this
method, you’ll find your device in the latter output. The USBA 1.0 framework is
operating your device if the prtconf entry above it says usba10_scsa2usb.
scsa2usb implies the original framework.
For a complete list of USB devices that are supported in the Solaris environment, see
http://www.sun.com/io_technologies/USB.html.
These devices can be managed with or without volume management. For information
on managing devices with volume management, see vold(1M).
Note – CDE’s File Manager does not fully support USB diskettes at this time. However,
you can open, rename, and format diskettes that contain a UFS file system from File
Manager’s Removable Media Manager. You can only open diskettes that contain a
PCFS file system from the Removable Media Manager. If a diskette contains either
type of file system, you can successfully drag and drop files between the diskette and
File Manager.
Volume management (vold) sees the USB diskette device as a SCSI removable media
device. Volume management makes the device available for access under the
/rmdisk directory.
For more information on how to use USB diskette devices, see Chapter 17.
If you connect a USB mass storage device to a system running this Solaris release and
the system is unable to use it, you can check the /kernel/drv/scsa2usb.conf file
to see if there is a matching, commented entry for this device. Follow the information
given in the scsa2usb.conf file to see if a particular device can be supported by
using the override information. For a listing of recommended USB mass storage
devices, go to http://www.sun.com/io_technologies/USB.html.
Note – You must include the /usr/dt/man directory in your MANPATH variable to
display the man pages that are listed in this section. You must also have the
/usr/dt/bin directory in your path and have CDE running to use these commands,
or have a DISPLAY variable set to use these commands remotely.
The following table identifies the commands that Removable Media Manager uses to
manage storage devices from the CDE environment.
After the USB device is formatted, it is usually mounted under the /rmdisk/label
directory. For more information on configuring removable storage devices, see
rmmount.conf(4) or vold.conf(4).
The following procedures describe how to manage USB mass storage devices without
vold running. The device nodes are created under the /dev/rdsk directory for
character devices and under the /dev/dsk directory for block devices. Device links
are created when the devices are hot-plugged. For more information, see
scsa2usb(7D).
Or, use the following procedure to keep vold running, but do not register the USB
mass storage devices with vold.
1. Become superuser.
Caution – If you comment out this line and other SCSI or ATAPI Zip, Peerless or
other removable devices are in the system, vold registration for these devices
would be disabled as well.
On a SPARC system, the prtconf output should look similar to the following:
$ prtconf
usb, instance #0
On an x86 system, the PCI card number, made up of the vendor ID and device ID, is
displayed instead of usb in the prtconf output. For example, pci1022,7460,
instance #0, is displayed instead of usb, instance #0.
You can use the prtconf command’s -D option to display additional driver
information. This information can be used to tell which ports and devices are being
driven by the USBA 1.0 framework, as displayed in the following example:
$ prtconf -D
.
.
.
SUNW,Sun-Blade-1500
.
.
.
1
pci, instance #0 (driver name: pcisch)
isa, instance #0 (driver name: ebus)
.
.
.
2
usb, instance #0 (driver name: ohci)
usb, instance #1 (driver name: ohci)
.
.
.
3
pci, instance #0 (driver name: pci_pci)
4
usb, instance #0 (driver name: usba10_ohci)
usb, instance #1 (driver name: usba10_ohci)
usb, instance #0 (driver name: usba10_ehci)
storage, instance #9 (driver name: usba10_scsa2usb)
disk, instance #9 (driver name: usb_sd)
firewire, instance #0 (driver name: hci1394)
.
.
.
1. See “How to Prepare to Use USB Mass Storage Devices Without vold Running”
on page 408 for information on disabling vold.
6. Determine the file system type and select one of the following:
2. Select one of the following to mount or unmount a USB mass storage device.
a. Mount a USB mass storage device by using the device aliases listed
previously.
Note – The eject command also unmounts the device if the device is not
unmounted already. The command also terminates any active applications that
access the device.
2. Become superuser.
4. Select one of the following to mount or unmount a USB mass storage device.
Be careful that device types are disabled on both frameworks. You cannot disable
device types on one framework only. The following table identifies some USB device
types and their corresponding drivers.
storage scsa2usb
printer usbprn
serial usbser_edge
If you disable a driver for a USB device that is still connected to the system, you will
see a console message similar to the following:
usba10: WARNING: usba: no driver found for device name
1. Become superuser.
Add a USB mass storage Add a USB mass storage “How to Add a USB Mass
device device with vold running. Storage Device With vold
Running” on page 416
Remove a USB mass storage Remove a USB mass storage “How to Remove a USB Mass
device device with vold running. Storage Device With vold
Running” on page 416
Add a USB camera Add a USB camera to access “How to Add a USB Camera”
digital images. on page 417
Hot-plugging a device means the device is added or removed without shutting down
the operating system or powering off the system. All USB devices are hot-pluggable.
When you hot-plug a USB device, the device is immediately seen in the system’s
device hierarchy, as displayed in the prtconf command output. When you remove a
USB device, the device is removed from the system’s device hierarchy, unless the
device is in use.
If the USB device is in use when it is removed, the hot-plug behavior is a little
different. If a device is in use when it is unplugged, the device node remains, but the
driver controlling this device stops all activity on the device. Any new I/O activity
issued to this device is returned with an error.
In this situation, the system prompts you to plug in the original device. If the device is
no longer available, stop the applications. After a few seconds, the port will become
available again.
Note – Data integrity might be impaired if you remove an active or open device.
Always close the device before removing, except the console keyboard and mouse,
which can be moved while active.
3. Restart vold.
# pkill -HUP vold
1. If needed, see “How to Prepare to Use USB Mass Storage Devices Without vold
Running” on page 408 for information on disabling vold.
6. Start vold.
# /etc/init.d/volmgt start
1. If needed, see “How to Prepare to Use USB Mass Storage Devices Without vold
Running” on page 408 for information on disabling vold.
2. Become superuser.
1. Become superuser.
6. View and manipulate the image files created by the USB camera.
# /usr/dt/bin/sdtimage P7220001.JPG &
Add USB audio devices Add a USB microphone and “How to Add USB Audio
speakers. Devices” on page 421
Identify your system’s Identify which audio device is “How to Identify Your
primary audio device your primary audio device. System’s Primary Audio
Device” on page 421
Change the primary USB You might want to make one “How to Change the Primary
audio device particular audio device the USB Audio Device”
primary audio device if you on page 422
remove or change your USB
audio devices.
Remove unused USB device If you remove a USB audio “How to Remove Unused
links device while the system is USB Device Links”
powered off, the /dev/audio on page 414
device might be pointing to a
/dev/sound/* device that
doesn’t exist.
Solve USB audio problems Use this section if no sound “Solving USB Audio
comes from the USB speakers. Problems” on page 424
Some audio devices can set volume under software control. A STREAMS module,
usb_ah, is pushed on top of the HID driver for managing this function.
The primary audio device is /dev/audio. You can verify that /dev/audio is
pointing to USB audio by using the following command:
% mixerctl
Device /dev/audioctl:
Name = USB Audio
Version = 1.0
Config = external
After you connect your USB audio devices, you access them with the audioplay and
audiorecord command through the /dev/sound/N device links.
Note that the /dev/audio and /dev/sound/N devices can refer to speakers,
microphones, or combo devices. If you refer to the incorrect device type, the command
will fail. For example, the audioplay command will fail if you try to use it with a
microphone.
You can select a specific default audio device for most Sun audio applications, such as
audioplay and audiorecord, by setting the AUDIODEV shell variable or by
specifying the -d option for these commands. However, setting AUDIODEV does not
work for third-party applications that have /dev/audio hardcoded as the audio file.
When you plug in a USB audio device, it automatically becomes the primary audio
device, /dev/audio, unless /dev/audio is in use. For instructions on changing
/dev/audio from onboard audio to USB audio and vice versa, refer to “How to
Change the Primary USB Audio Device” on page 422, and usb_ac(7D).
1. Become superuser.
5. Verify that the primary audio device link is pointing to the onboard audio.
# ls -lt /dev/audio*
lrwxrwxrwx 1 root other 7 Jul 23 15:49 /dev/audio -> sound/0
lrwxrwxrwx 1 root other 10 Jul 23 15:49 /dev/audioctl ->
sound/0ctl
# ls -lt /dev/sound/*
lrwxrwxrwx 1 root other 66 Jul 23 14:21 /dev/sound/0 ->
../../devices/pci@1f,4000/ebus@1/SUNW,CS4231@14,200000:sound,audio
lrwxrwxrwx 1 root other 69 Jul 23 14:21 /dev/sound/0ctl ->
../../devices/pci@1f,4000/ebus@1/SUNW,CS4231@14,200000:sound,audioctl
#
7. (Optional) Unload all the audio drivers that can be unloaded before plugging in
another USB audio device.
b. Display the audio driver information to verify that no audio drivers are
currently loaded.
# modinfo | grep -i audio
60 78048000 bb6e - 1 audiosup (Audio Device Support 1.12)
61 78152000 39a97 - 1 mixer (Audio Mixer 1.49)
62 78118000 bf9f - 1 amsrc1 (Audio Sample Rate Conv. #1 1.3)
128 7805e000 14968 54 1 audiocs (CS4231 mixer audio driver 1.21)
#
Display USB bus information Display information about “How to Display USB Bus
USB devices and buses. Information (cfgadm)”
on page 427
Configure a USB device Configure a USB device that “How to Configure a USB
was previously unconfigured. Device” on page 428
Logically disconnect a USB You can logically disconnect a “How to Logically Disconnect
device USB device if you are not a USB Device” on page 429
physically near the system.
Reset a USB device Reset a USB device to “How to Reset a USB Device”
logically remove and recreate on page 430
the device.
Change the default Change the default “How to Change the Default
configuration of a configuration of a Configuration of a
multi-configuration USB multi-configuration USB Multi-Configuration USB
device device. Device” on page 430
The cfgadm command displays information about attachment points, which are
locations in the system where dynamic reconfiguration operations can occur. An
attachment point consists of:
■ An occupant, which represents a hardware resource, such as a USB device, that
might be configured into the system, and
■ A receptacle, which is the location that accepts the occupant, such as a USB port.
Attachment points are represented by logical and physical attachment point IDs
(Ap_Ids). The physical Ap_Id is the physical pathname of the attachment point. The
logical Ap_Id is a user-friendly alternative for the physical Ap_Id. For more
information on Ap_Ids, see cfgadm_usb(1M).
The cfgadm command provides the following USB device status information.
The following sections describe how to hot-plug a USB device through the software
with the cfgadm command. All of the sample USB device information in these
sections has been truncated to focus on relevant information.
Use the following cfgadm command to display specific USB device information. For
example:
% cfgadm -l -s "cols=ap_id:info"
Ap_Id Information
usb0/4.5.1 Mfg: Inside Out Networks Product: Edgeport/421 NConfigs: 1
Config: 0 : ...
usb0/4.5.2 Mfg: <undef> Product: <undef> NConfigs: 1 Config: 0 ...
usb0/4.5.3 Mfg: Mitsumi Product: Apple USB Mouse NConfigs: 1 Config: 0 ...
usb0/4.5.4 Mfg: NMB Product: NMB USB KB/PS2 M NConfigs: 1 Config: 0
usb0/4.5.5 Mfg: Hagiwara Sys-Com Product: SmartMedia R/W NConfigs: 1
Config: 0 : ...
1. Become superuser.
1. Become superuser.
1. Become superuser.
1. Become superuser.
1. Become superuser.
This chapter provides information about how to access the devices on a system.
Accessing Devices
You need to know how to specify device names when using commands to manage
disks, file systems, and other devices. In most cases, you can use logical device names
to represent devices that are connected to the system. Both logical and physical device
names are represented on the system by logical and physical device files.
433
How Devices Are Managed
The devfsadm command manages the special device files in the /dev and /devices
directories. By default, the devfsadm command attempts to load every driver in the
system and attach to all possible device instances. Then, devfsadm creates the device
files in the /devices directory and the logical links in the /dev directory. In addition
to managing the /dev and /devices directories, the devfsadm command also
maintains the path_to_inst(4) instance database.
Both reconfiguration boot processing and updating the /dev and /devices
directories in response to dynamic reconfiguration events is handled by devfsadmd,
the daemon version of the devfsadm command. This daemon is started from the
/etc/rc* scripts when a system is booted.
Many administration commands take arguments that refer to a disk slice or file
system.
/dev/[r]dsk/cwtxdysz
Raw device interfaces transfer only small amounts of data at a time. Block device
interfaces include a buffer from which large blocks of data are read at once.
The following table shows which interface is required for some commonly used disk
and file system commands.
TABLE 30–1 Device Interface Type Required by Some Frequently Used Commands
FCAL (SPARC)
ATA (SPARC/x86)
The conventions for both types of controllers are explained in the following
subsections.
cwtxdysz
Slice number (0 to 7) or fdisk partition number (0 to 4)
Drive number
Physical bus target number
Logical controller number
On a SPARC based system with directly connected disks such as the IDE disks on a
Ultra10, the naming convention is the same as that for systems with bus-oriented
controllers.
For SCSI controllers, x is the target address set by the switch on the back of the unit,
and y is the logical unit number (LUN) of the drive attached to the target. If the disk
has an embedded controller, y is usually 0.
For SCSI controllers, w is the target address set by the switch on the back of the unit,
and x is the logical unit number (LUN) of the drive attached to the target. If the disk
has an embedded controller, x is usually 0.
/dev/rmt/xy
Optional density
l low
m medium
h high
u ultra
c compressed
Drive number (0-n)
Raw magnetic tape device directory
Devices directory
The first tape device connected to the system is 0 (/dev/rmt/0). Tape density values
(l, m, h, c, and u) are described in Chapter 52.
The logical device name that represents the removable media devices on a system are
described in Chapter 18.
This topic map lists the chapters that provide information on managing disks.
441
442 System Administration Guide: Basic Administration • April 2004
CHAPTER 32
This chapter provides overview information about Solaris disk slices and introduces
the format utility.
For instructions on how to add a disk to your system, see Chapter 34 or Chapter 35.
443
SPARC: Multiterabyte Volume Support With EFI
Disk Label
Solaris 9 4/03 – This Solaris release provides support for disks that are larger than 1
terabyte on systems running a 64-bit Solaris kernel. The Extensible Firmware Interface
(EFI) disk label is not available for disks connected to a system running a 32-bit Solaris
kernel, such as a system running the Solaris x86 Platform Edition.
The EFI label provides support for physical disks and virtual disk volumes. This
release also includes updated disk utilities for managing disks greater than 1 terabyte.
The UFS file system is compatible with the EFI disk label, and you can create a UFS
file system greater than 1 terabyte. For information on creating a multiterabyte UFS
file system, see “SPARC: Support of Multiterabyte UFS File Systems” on page 527.
The unbundled Sun QFS file system is also available if you need to create file systems
greater than 1 terabyte. For information on the Sun QFS file system, see
http://docs.sun.com/db/doc/816-2542-10.
The Solaris Volume Manager software can also be used to manage disks greater than 1
terabyte in this Solaris release. For information on using Solaris Volume Manager, see
Solaris Volume Manager Administration Guide.
The VTOC label is still available for disks less than 1 terabyte in size. If you are only
using disks smaller than 1 terabyte on your systems, managing disks will be the same
as in previous Solaris releases. In addition, you can use the format-e command to
label a disk less than 1 terabyte with an EFI label. For more information, see
“Example—Labeling a Disk Less Than 1 Terabyte with an EFI Label” on page 473.
If the system is already installed, connect the “SPARC: Adding a System Disk or a
disk to the system and perform a Secondary Disk (Task Map)” on page 485
reconfiguration boot.
Repartition the disk with the format utility, if “SPARC: How to Create Disk Slices and Label
necessary. a Disk” on page 488
Create disk volumes, and if needed, create soft “Storage Management Concepts” in Solaris
partitions with Solaris Volume Manager. Volume Manager Administration Guide
Create UFS file systems for the new disk with “SPARC: How to Create File Systems”
the newfs command. on page 493
Now, you must use a slightly different procedure to clone or copy disks larger than 1
terabyte so that the UUID of cloned disks are unique. For example:
1. Use the dd command to clone the disk with an EFI label:
# dd if=/dev/rdsk/c0t0d0 of=/dev/rdsk/c0t2d0 bs=128k
Caution – If you do not create a new label for the cloned disk, other software products
might corrupt data on EFI-labeled disks if they encounter duplicate UUIDs.
Cause
You attempted to create a partition on a SCSI device that is larger than 2 terabytes.
Solution
Create a partition on a SCSI device that is less than 2 terabytes.
Error Message
Dec 3 09:26:48 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/
sf@1,0/ssd@w50020f23000002a4,0 (ssd1):
Dec 3 09:26:48 holoship disk has 2576941056 blocks, which is too large
for a 32-bit kernel
Cause
You attempted to boot a system running a 32-bit SPARC kernel with a disk greater
than 1 terabyte.
Solution
Boot a system running a 64-bit SPARC kernel with a disk greater than 1 terabyte.
Error Message
Dec 3 09:12:17 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/
sf@1,0/ssd@w50020f23000002a4,0 (ssd1):
Dec 3 09:12:17 holoship corrupt label - wrong magic number
Cause
You attempted to add this disk to a system running an older Solaris release.
Solution
Add this disk to a system running the Solaris release that supports the EFI disk
label.
For general information about Solaris Volume Manager, see “Storage Management
Concepts” in Solaris Volume Manager Administration Guide. For information on soft
partitioning, see “Soft Partitions (Overview)” in Solaris Volume Manager Administration
Guide.
Disk Terminology
Before you can effectively use the information in this section, you should be familiar
with basic disk architecture. In particular, you should be familiar with the following
terms:
Cylinder The set of tracks with the same nominal distance from the
axis about which the disk rotates.
Disk controller A chip and its associated circuitry that controls the disk
drive.
Disk label The first sector of a disk that contains disk geometry and
partition information.
For additional information, see the product information from your disk’s
manufacturer.
Note – Slices are sometimes referred to as partitions. This book uses slice but certain
interfaces, such as the format utility, refer to slices as partitions.
Slices are set up slightly differently on SPARC and x86 platforms. The following table
summarizes the differences.
Whole disk is devoted to Solaris environment. Disk is divided into fdisk partitions, one
fdisk partition per operating system.
VTOC – Disk is divided into 8 slices, VTOC – The Solaris fdisk partition is
numbered 0–7. divided into 10 slices, numbered 0–9.
EFI – Disk is divided into 7 slices, numbered
0–6.
The Solaris release places ten slices, numbered 0–9, on a Solaris fdisk partition as
shown in the following table.
Do not use the following areas of the disk for raw data slices, which are sometimes
created by third-party database applications:
■ Block 0 where the disk label is stored
■ Slice 2, which represents the entire disk with a VTOC label
Note – A slice cannot be split between two or more disks. However, multiple swap
slices on separate disks are allowed.
For instance, a single disk might hold the root (/) file system, a swap area, and the
/usr file system, while another disk holds the /export/home file system and other
file systems that contain user data.
In a multiple disk arrangement, the disk that contains the operating system software
and swap space (that is, the disk that holds the root (/) and /usr file systems and the
slice for swap space) is called the system disk. Other disks are called secondary disks or
non-system disks.
When you arrange a system’s file systems on multiple disks, you can modify file
systems and slices on the secondary disks without having to shut down the system or
reload operating system software.
When you have more than one disk, you also increase input-output (I/O) volume. By
distributing disk load across multiple disks, you can avoid I/O bottlenecks.
Each system configuration can use slices in a different way. The following table lists
some examples.
0 root root
1 swap swap
2 — —
3 /export —
6 /usr /usr
7 /export/home /home
For more information about system configurations, see “Overview of System Types”
on page 120.
Note – The Solaris installation program provides default slice sizes based on the
software you select for installation.
The format utility is a system administration tool that is used to prepare hard disk
drives for use on your Solaris system.
The following table shows the features and associated benefits that the format utility
provides.
Feature Benefit
Repairs defective sectors Allows administrators to repair disk drives with recoverable
errors instead of sending the drive back to the manufacturer
Formats and analyzes a disk Creates sectors on the disk and verifies each sector
Partitions a disk Divides a disk into slices so individual file systems can be
created on separate slices
Labels a disk Writes disk name and configuration information to the disk
for future retrieval (usually for repair operations)
The main reason a system administrator uses the format utility is to divide a disk
into disk slices. These steps are covered in Chapter 34 and Chapter 35.
See the following section for guidelines on using the format utility.
Format a disk ■ Any existing data is destroyed when you “How to Format a Disk”
reformat a disk. on page 467
■ The need for formatting a disk drive has
dropped as more and more
manufacturers ship their disk drives
formatted and partitioned. You might not
need to use the format utility when you
add a disk drive to an existing system.
■ If a disk has been relocated and is
displaying a lot of disk errors, you can
attempt to reformat it, which will
automatically remap any bad sectors.
Replace a system ■ Data from the damaged system disk must “SPARC: How to Connect a
disk be restored from a backup medium. System Disk and Boot”
Otherwise, the system will have to be on page 486 or “x86: How
reinstalled by using the installation to Connect a System Disk
and Boot” on page 496 or if
program.
the system must be
reinstalled, Solaris 9 12/03
Installation Guide
Divide a disk into ■ Any existing data is destroyed when you “SPARC: How to Create
slices repartition and relabel a disk with Disk Slices and Label a
existing slices. Disk” on page 488 or “x86:
■ Existing data must be copied to backup How to Create Disk Slices
and Label a Disk”
media before the disk is repartitioned and
on page 505
restored.
Add a secondary ■ Any existing data must be restored from “SPARC: How to Connect a
disk to an existing backup media if the secondary disk is Secondary Disk and Boot”
system reformatted or repartitioned. on page 487 or “x86: How
to Connect a Secondary
Disk and Boot” on page 497
Formatting a Disk
In most cases, disks are formatted by the manufacturer or reseller. So, they do not
need to be reformatted when you install the drive. To determine if a disk is formatted,
use the format utility. For more information, see “How to Determine if a Disk is
Formatted” on page 467.
If you determine that a disk is not formatted, use the format utility to format the
disk.
A small percentage of total disk space that is available for data is used to store defect
and formatting information. This percentage varies according to disk geometry, and
decreases as the disk ages and develops more defects.
Formatting a disk might take anywhere from a few minutes to several hours,
depending on the type and size of the disk.
If you fail to label a disk after you create slices, the slices will be unavailable because
the operating system has no way of “knowing” about the slices.
Partition Table
An important part of the disk label is the partition table, which identifies a disk’s slices,
the slice boundaries (in cylinders), and the total size of the slices. You can display a
disk’s partition table by using the format utility. The following table describes
partition table terminology.
Tag 0=UNASSIGNED 1=BOOT A numeric value that usually describes the file
2=ROOT 3=SWAP 4=USR system mounted on this partition.
5=BACKUP 7=VAR
8=HOME 11=RESERVED
Partition flags and tags are assigned by convention and require no maintenance.
For more information on displaying the partition table, see “How to Display Disk Slice
Information” on page 469 or “How to Examine a Disk Label” on page 473.
The partition table displayed by the format utility contains the following
information:
Part Partition (or slice number). See Table 32–7 for a description of this
column.
Tag Partition tag. See Table 32–7 for a description of this column.
Flags Partition flag. See Table 32–7 for a description of this column.
Cylinders The starting and ending cylinder number for the slice.
Blocks The total number of cylinders and the total number of sectors per slice
in the far right column.
The following is an example of a EFI disk label displayed by using the prtvtoc
command.
# prtvtoc /dev/rdsk/c4t1d0s0
* /dev/rdsk/c4t1d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 2576941056 sectors
* 2576940989 accessible sectors
*
* Flags:
* 1: unmountable
* 10: read-only
Dimensions This section describes the physical dimensions of the disk drive.
Flags This section describes the flags listed in the partition table
section. For a description of partition flags, see Table 32–7.
Partition (or Slice) Table This section contains the following information:
Partition Partition (or slice number). For a description of this column, see
Table 32–7.
Tag Partition tag. For a description of this column, see Table 32–7.
Flags Partition flag. For a description of this column, see Table 32–7.
Mount Directory The last mount point directory for the file system.
This temporary slice donates, or “frees,” space when you expand a slice, and receives,
or “hogs,” the discarded space when you shrink a slice. For this reason, the donor slice
is sometimes called the free hog.
The free hog slice exists only during installation or when you run the format utility.
There is no permanent free hog slice during day-to-day operations.
For information on using the free hog slice, see “SPARC: How to Create Disk Slices
and Label a Disk” on page 488 or “x86: How to Create Disk Slices and Label a Disk”
on page 505.
Identify the disks on a system If you are not sure of the types “How to Identify the Disks on
of disks on a system, use the a System” on page 464
format utility to identify the
disk types.
Display slice information Display slice information by “How to Display Disk Slice
using the format utility. Information” on page 469
463
Task Description For Instructions
Label the disk Create the disk label by using “How to Label a Disk”
the format utility. on page 471
Examine the disk label Examine the disk label by “How to Examine a Disk
using the prtvtoc command. Label” on page 473
Recover a corrupted disk label You can attempt to recover a “How to Recover a Corrupted
disk label that was damaged Disk Label” on page 475
due to a system or power
failure.
Repair a defective disk sector Identify a defective disk sector “How to Identify a Defective
by using the format utility. Sector by Using Surface
Analysis” on page 481
If necessary, fix a defective Fix a defective disk sector by “How to Repair a Defective
disk sector using the format utility. Sector” on page 482
2. Identify the disks that are recognized on the system with the format utility.
# format
The format utility displays a list of disks that it recognizes under AVAILABLE
DISK SELECTIONS.
The format output associates a disk’s physical and logical device name to the disk’s
marketing name, which appears in angle brackets <>. See the example below. This
method is an easy way to identify which logical device names represent the disks that
are connected to your system. For a description of logical and physical device names,
see Chapter 30.
The following example uses a wildcard to display the disks that are connected to a
second controller.
# format /dev/rdsk/c2*
AVAILABLE DISK SELECTIONS:
0. /dev/rdsk/c2t10d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
/sbus@3,0/SUNW,fas@3,8800000/sd@a,0
1. /dev/rdsk/c2t11d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
/sbus@3,0/SUNW,fas@3,8800000/sd@b,0
2. /dev/rdsk/c2t14d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus@3,0/SUNW,fas@3,8800000/sd@e,0
3. /dev/rdsk/c2t15d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus@3,0/SUNW,fas@3,8800000/sd@f,0
Specify disk (enter its number):
The format output identifies that disk 0 (target 3) is connected to the first SCSI host
adapter (espdma@...), which is connected to the first SBus device (sbus@0...). The
output also associates both the physical and logical device name to the disk’s
marketing name, SUN2.1G.
The following example shows how to identify the disks on an x86 based system.
# format
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 615 alt 2 hd 64 sec 63>
/pci@0,0/pci-ide@7,1/ata@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63>
/pci@0,0/pci-ide@7,1/ata@0/cmdk@1,0
The format output identifies that disk 0 is connected to the first PCI host adapter
(pci-ide@7...), which is connected to the ATA device (ata...). The format output
on an x86 based system does not identify disks by their marketing names.
Disk is newly added and you didn’t perform a Go to Chapter 34 or Chapter 35.
reconfiguration boot
Disk is not properly connected to the system Connect the disk to the system by using
your disk hardware documentation.
Formatting a Disk
Disks are formatted by the manufacturer or reseller. They usually do not need to be
reformatted when you install the drive.
3. Type the number of the disk that you want to check from the list displayed on
your screen.
Specify disk (enter its number): 0
4. Verify that the disk you chose is formatted by noting the following message.
[disk formatted]
3. Type the number of the disk that you want to format from the list displayed on
your screen.
Specify disk (enter its number): 0
4. To begin formatting the disk, type format at the format> prompt. Confirm the
command by typing y.
format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes
5. Verify that the disk format is successful by noting the following messages.
Beginning format. The current time Tue ABC xx xx:xx:xx xxxx
Formatting...
done
Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18
Example—Formatting a Disk
The following example shows how to format the disk c0t3d0.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number):1
Selecting c0t3d0
[disk formatted]
format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes
Beginning format. The current time is Thu Dec 6 09:54:40 2001
Formatting ...
done
Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18
Note – The format utility uses the term partition instead of slice.
3. Type the number of the disk for which you want to display slice information
from the list displayed on your screen.
Specify disk (enter its number):1
7. Verify the displayed slice information by identifying specific slice tags and
slices.
For a detailed description of the slice information in these examples, see Chapter 32.
The following example shows the slice information on a disk with an EFI label.
# format
Searching for disks...done
Specify disk (enter its number): 9
selecting c4t1d0
[disk formatted]
format> partition
partition> print
Current partition table (original):
partition> q
format> q
Part Tag Flag First Sector Size Last Sector
0 root wm 34 300.00GB 629145633
1 usr wm 629145634 300.00GB 1258291233
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 usr wm 1258291234 628.77GB 2576924637
8 reserved wm 2576924638 8.00MB 2576941021
The format utility attempts to automatically configure any unlabeled SCSI disk. If the
format utility is able to automatically configure an unlabeled disk, it displays a
message like the following:
c0t0d1: configured with capacity of 4.00GB
Tip – For information on labeling multiple disks with the same disk label, see “Label
Multiple Disks by Using the prtvtoc and fmthard Commands” on page 483.
3. Type the number of the disk that you want to label from the list displayed on
your screen.
Specify disk (enter its number):1
b. If the disk is labeled and you want to change the disk type, or if the format
utility was not able to automatically configure the disk, follow steps 6-7 to set
the disk type and label the disk.
8. Label the disk. If the disk is not labeled, the following message is displayed.
Disk not labeled. Label it now? y
Otherwise, you are prompted with this message:
Ready to label disk, continue? y
Example—Labeling a Disk
The following example shows how to automatically configure and label a 1.05-Gbyte
disk.
# format
c1t0d0: configured with capacity of 1002.09MB
The following example shows the disk label information for disk with an EFI label.
# prtvtoc /dev/rdsk/c3t1d0s0
* /dev/rdsk/c3t1d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 2479267840 sectors
* 2479267773 accessible sectors
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 34 262144 262177
1 3 01 262178 262144 524321
6 4 00 524322 2478727100 2479251421
8 11 00 2479251422 16384 2479267805
The first step to recovering a corrupted disk label is to label the disk with the correct
geometry and disk type information. You can complete this step through the normal
disk labeling method, by using either automatic configuration or manual disk type
specification.
3. Type the number of the disk that you need to recover from the list displayed on
your screen.
Specify disk (enter its number): 1
a. If the disk was configured successfully, follow steps 5 and 6. Then go to step
12.
b. If the disk was not configured successfully, follow steps 7-11. Then go to step
12.
6. If the format utility was able to find a backup label and the backup label
contents appear satisfactory, use the backup command to label the disk with the
backup label.
format> backup
Disk has a primary label, still continue? y
7. If the format utility was not able to automatically configure the disk, specify
the disk type by using the type command.
format> type
The Available Drives Type menu is displayed.
8. Select 0 to automatically configure the disk, or select a disk type from the list of
possible disk types.
Specify disk type (enter its number)[12]: 12
9. If the disk was successfully configured, reply with no when the format utility
asks if you want to label the disk.
Disk not labeled. Label it now? no
11. If the format utility was able to find a backup label and the backup label
contents appear satisfactory, use the backup command to label the disk with the
backup label.
format> backup
Disk has a primary label, still continue? y
Searching for backup labels...found.
Restoring primary label
The disk label has been recovered.
13. Verify the file systems on the recovered disk by using the fsck command.
For information on using the fsck command, see Chapter 43.
Note – Sun cannot guarantee that its format utility will work properly with all
third-party disk drivers. If the disk driver is not compatible with the Solaris format
utility, the disk drive vendor should supply you with a custom format program.
This section discusses what to do if some of this software support is missing. Typically,
you discover that software support is missing when you invoke the format utility
and find that the disk type is not recognized.
Supply the missing software as described in this section, and then refer to the
appropriate configuration procedure for adding system disks or secondary disks in
Chapter 34 or Chapter 35.
If your disk is unrecognized, use a text editor to create an entry in format.dat for
the disk. You need to gather all the pertinent technical specifications about the disk
and its controller before you start. This information should have been provided with
the disk. If not, contact the disk manufacturer or your supplier.
3. Modify the /etc/format.dat file to include an entry for the third-party disk
by using the format.dat information that is described in Chapter 36.
Use the disk’s hardware product documentation to gather the required
information.
After the reconfiguration boot, invoke the format utility. The format utility will
attempt to configure the disk and, if successful, alert the user that the disk was
configured. For step-by-step instructions on configuring a SCSI disk drive
automatically, see “How to Automatically Configure a SCSI Drive” on page 479.
Here’s an example of a partition table for a 1.3-Gbyte SCSI disk drive that was
displayed by the format utility.
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 96 64.41MB (97/0/0)
1 swap wu 97 - 289 128.16MB (193/0/0)
2 backup wu 0 - 1964 1.27GB (1965/0/0)
6 usr wm 290 - 1964 1.09GB (1675/0/0)
For more information on using SCSI automatic configuration, see Chapter 36.
2. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
-in Brings the system down to init level 0, the power-down state.
-g30 Notifies logged-in users that they have n seconds before the system
begins to shut down.
4. Turn off the power to the system and all external peripheral devices.
5. Make sure that the disk you are adding has a different target number than the
other devices on the system.
6. Connect the disk to the system and check the physical connections.
Refer to the disk’s hardware installation guide for installation details.
10. Invoke the format utility and select the disk that you want to configure
automatically.
# format
Searching for disks...done
c1t0d0: configured with capacity of 1002.09MB
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 1
The preceding console message indicates that block 179 might be defective.
Relocate the bad block by using the format utility’s repair command or use the
analyze command with the repair option enabled.
2. Unmount the file system in the slice that contains the defective sector.
# umount /dev/dsk/device-name
For more information, see mount(1M).
In this example, the series of numbers under Inquiry: represent the hexadecimal
value of the inquiry data that is displayed to the right of the numbers.
# format -M
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
For information on the procedures associated with adding a disk to a SPARC based
system, see “SPARC: Adding a System Disk or a Secondary Disk (Task Map)”
on page 485.
For overview information about disk management, see Chapter 32. For step-by-step
instructions on adding a disk to an x86 based system, see Chapter 35.
1. Connect the disk and boot System Disk “SPARC: How to Connect a
System Disk and Boot”
Connect the new disk and
on page 486
boot from a local or remote
Solaris CD or DVD.
485
Task Description For Instructions
2. Create slices and label the Create disk slices and label “SPARC: How to Create Disk
disk the disk if the disk Slices and Label a Disk”
manufacturer has not already on page 488
done so.
3. Create file systems Create UFS file systems on the “SPARC: How to Create File
disk slices with the newfs Systems” on page 493
command. You must create
the root (/) or /usr file
system, or both, for a system
disk.
5. Install boot block System Disk Only. Install the “SPARC: How to Install a
boot block on the root (/) file Boot Block on a System Disk”
system, so that the system can on page 494
boot.
A secondary disk does not contain the root (/) and /usr file systems. A secondary
disk usually contains space for user files. You can add a secondary disk to a system for
more disk space, or you can replace a damaged secondary disk. If you replace a
secondary disk on a system, you can restore the old disk’s data on the new disk.
2. Make sure that the disk you are adding has a different target number than the
other devices on the system.
You will often find a small switch located at the back of the disk for this purpose.
4. Follow the instructions in the following table, depending on whether you are
booting from a local Solaris CD or DVD or a remote Solaris CD or DVD from
the network.
From a Solaris CD or DVD in a local drive 1. Make sure the CD or DVD is in the drive.
2. Boot from the media to single-user mode:
ok boot cdrom -s
2. If the disk type is unsupported by the Solaris software, add the device driver for
the disk by following the instructions included with the hardware.
For information on creating a format.dat entry for the disk, see “How to Create
a format.dat Entry” on page 478, if necessary.
3. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
The /reconfigure file causes the SunOS software to check for the presence of
any newly installed peripheral devices when you power on or boot your system
later.
-gn Notifies logged-in users that they have n seconds before the system
begins to shut down.
The ok prompt is displayed after the Solaris operating system is shut down.
5. Turn off the power to the system and all external peripheral devices.
6. Make sure that the disk you are adding has a different target number than the
other devices on the system.
You will often find a small switch located at the back of the disk for this purpose.
7. Connect the disk to the system and check the physical connections.
Refer to the disk’s hardware installation guide for installation details.
3. Type the number of the disk that you want to repartition from the list displayed
on your screen.
Specify disk (enter its number): disk-number
disk-number is the number of the disk that you want to repartition.
9. Identify the free hog partition (slice) and the sizes of the slices when prompted.
When adding a system disk, you must set up slices for:
■ root (slice 0) and swap (slice 1)
■ /usr (slice 6)
After you identify the slices, the new partition table is displayed.
For an example of creating disk slices, see “SPARC: Example—Creating Disk Slices
and Labeling a System Disk” on page 490.
10. Make the displayed partition table the current partition table by answering y
when asked.
Okay to make this the current partition table[yes]? y
If you do not want the current partition table and you want to change it, answer no
and go to Step 6.
12. Label the disk with the new partition table after you have finished allocating
slices on the new disk.
Ready to label disk, continue? yes
The following example shows how to use the format utility to divide a 1.15 terabyte
disk with an EFI label into 3 slices.
# format
.
.
.
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
Part Tag Flag First Sector Size Last Sector
0 root wm 0 0 0
1 usr wm 0 0 0
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 usr wm 0 0 0
8 reserved wm 2576924638 8.00MB 2576941021
Do you wish to continue creating a new partition
table based on above table[yes]? y
Free Hog partition[6]? 4
Enter size of partition 0 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 1 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 2 [0b, 34e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 3 [0b, 838860834e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 5 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Enter size of partition 6 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Part Tag Flag First Sector Size Last Sector
0 unassigned wm 0 0 0
partition> q
System Disk You need to restore the root (/) and /usr file systems on the
disk. Go to Chapter 49.
After the root (/) and /usr file systems are restored, install
the boot block. Go to “SPARC: How to Install a Boot Block on
a System Disk” on page 494.
Secondary Disk You might need to restore file systems on the new disk. Go to
Chapter 49.
If you are not restoring file systems on the new disk, you are
finished adding a secondary disk. See Chapter 40 for
information on making the file systems available to users.
3. Verify that the boot blocks are installed by rebooting the system to run level 3.
# init 6
For information on the procedures associated with adding a disk to an x86 based
system, see “x86: Adding a System Disk or a Secondary Disk (Task Map)” on page 495.
For overview information about disk management, see Chapter 32. For step-by-step
instructions on adding a disk to a SPARC based system, see Chapter 34.
1. Connect the disk and boot System Disk “x86: How to Connect a
System Disk and Boot”
Connect the new disk and
on page 496
boot from a local or remote
Solaris CD or DVD.
495
Task Description For Instructions
2. Create slices and label the Create disk slices and label “x86: How to Create a Solaris
disk the disk if the disk fdisk Partition” on page 499
manufacturer has not already and “x86: How to Create Disk
done so. Slices and Label a Disk”
on page 505
3. Create File Systems Create UFS file systems on the “x86: How to Create File
disk slices with the newfs Systems” on page 506
command. You must create
the root (/) or /usr file
system (or both) for a system
disk.
5. Install Boot Block System Disk Only. Install the “x86: How to Install a Boot
boot block on the root (/) file Block on a System Disk”
system so that the system can on page 507
boot.
A secondary disk doesn’t contain the root (/) and /usr file systems. A secondary disk
usually contains space for user files. You can add a secondary disk to a system for
more disk space, or you can replace a damaged secondary disk. If you replace a
secondary disk on a system, you can restore the old disk’s data on the new disk.
3. Connect the replacement system disk to the system and check the physical
connections.
Refer to the disk’s hardware installation guide for installation details.
4. Follow steps a-e if you are booting from a local Solaris CD or DVD or a remote
Solaris CD or DVD from the network.
If you are booting from the network, skip step a.
a. If you are booting from a local Solaris CD or DVD, insert the Solaris
installation CD or DVD into the drive.
b. Insert the Solaris boot diskette into the primary diskette drive (DOS drive A).
c. Press any key to reboot the system if the system displays the Type any key
to continue prompt. Or, use the reset button to restart the system if the
system is shut down.
The Boot Solaris screen is displayed after a few minutes.
d. Select the CD-ROM drive or net(work) as the boot device from the Boot
Solaris screen.
The Current Boot Parameters screen is displayed.
2. If the disk is unsupported by the Solaris software, add the device driver for the
disk by following the instructions included with the hardware.
3. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
-i0 Brings the system down to run level 0, the power-down state.
-gn Notifies logged-in users that they have n seconds before the system
begins to shut down.
5. Turn off the power to the system and all external peripheral devices.
6. Make sure that the disk you are adding has a different target number than the
other devices on the system.
You will often find a small switch located at the back of the disk for this purpose.
7. Connect the disk to the system and check the physical connections.
Refer to the disk’s hardware installation guide for installation details.
x86 only – Solaris slices are sometimes called partitions. This book uses the term slice,
but some Solaris documentation and programs might refer to a slice as a partition.
4. Type the number of the disk on which to create a Solaris fdisk partition from
the list displayed on your screen.
Specify disk (enter its number): disk-number
disk-number is the number of the disk on which you want to create a Solaris fdisk
partition.
6. Create and activate a Solaris fdisk partition that spans the entire disk by
specifying y at the prompt. Then, go to step 14.
The recommended default partitioning for your disk is:
7. Specify n at the prompt if you do not want the Solaris fdisk partition to span
the entire disk.
To select this, please type "y". To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. n
Total disk size is 2694 cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE
FOLLOWING:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection: 1
10. Identify the percentage of the disk to be reserved for the Solaris fdisk partition.
Keep in mind the size of any existing fdisk partitions when you calculate this
percentage.
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). nn
13. Update the disk configuration and exit the fdisk menu from the selection menu.
Selection: 4
3. Type the number of the disk that you want to repartition from the list displayed
on your screen.
Specify disk (enter its number): disk-number
disk-number is the number of the disk that you want to repartition.
9. Identify the free hog partition (slice) and the sizes of the slices when prompted.
When adding a system disk, you must set up slices for:
■ root (slice 0) and swap (slice 1) and/or
■ /usr (slice 6)
After you identify the slices, the new partition table is displayed.
10. Make the displayed partition table the current partition table by answering yes
when asked.
Okay to make this the current partition table[yes]? yes
If you don’t want the current partition table and you want to change it, answer no
and go to Step 6.
12. Label the disk with the new partition table after you have finished allocating
slices on the new disk.
Ready to label disk, continue? yes
System Disk You need to restore the root (/) and /usr file systems on the
disk. Go to Chapter 49.
After the root (/) and /usr file systems are restored, install
the boot block. Go to “x86: How to Install a Boot Block on a
System Disk” on page 507.
Secondary Disk You might need to restore file systems on the new disk. Go to
Chapter 49.
If you are not restoring file systems on the new disk, you are
finished adding a secondary disk. See Chapter 40 for
information on making the file systems available to users.
3. Verify that the boot blocks are installed by rebooting the system to run level 3.
# init 6
For a overview of when to use the format utility, see Chapter 32.
Keep the following guidelines in mind when using the format utility and you want
to preserve the existing data:
■ Back up all files on the disk drive.
■ Save all your defect lists in files by using the format utility’s dump command. The
file name should include the drive type, model number, and serial number.
509
■ Save the paper copies of the manufacturer’s defect list that was shipped with your
drive.
Command or
Item Menu? Description
disk Command Lists all of the system’s drives. Also lets you choose
the disk you want to use in subsequent operations.
This disk is referred to as the current disk.
partition Menu Creates and modifies slices. For more information, see
“The partition Menu” on page 512.
fdisk Menu x86 platform only: Runs the fdisk program to create
a Solaris fdisk partition.
inquiry Command Prints the vendor, product name, and revision level of
the current drive (SCSI disks only).
Sub-Command Description
change ‘n’ partition Lets you specify the following information for the new slice:
■ Identification tag
■ Permission flags
■ Starting cylinder
■ Size
modify Lets you change all the slices in the slice table. This command
is preferred over the individual change ‘x’ partition
commands.
name Lets you specify a name for the current slice table.
label Writes the slice map and the label to the current disk.
Change Active partition Lets you specify the partition to be used for booting. This
menu item identifies where the first stage boot program looks
for the second stage boot program.
Exit Writes a new version of the partition table and exits the
fdisk menu.
Cancel Exits the fdisk menu without modifying the partition table.
ANALYZE MENU:
read - read only test (doesn’t harm SunOS)
refresh - read then write (doesn’t harm data)
test - pattern testing (doesn’t harm data)
write - write then read (corrupts data)
compare - write, read, compare (corrupts data)
purge - write, read, write (corrupts data)
verify - write entire disk, then verify (corrupts data)
print - display data buffer
setup - set analysis parameters
config - show analysis parameters
quit
analyze>
Sub-Command Description
read Reads each sector on the current disk. Repairs defective blocks as a
default.
refresh Reads then writes data on the current disk without harming the data.
Repairs defective blocks as a default.
test Writes a set of patterns to the disk without harming the data. Repairs
defective blocks as a default.
write Writes a set of patterns to the disk then reads the data on the disk back.
Destroys existing data on the disk. Repairs defective blocks as a default.
compare Writes a set of patterns to the disk, reads the data back, and then
compares it to the data in the write buffer. Destroys existing data on the
disk. Repairs defective blocks as a default.
purge Removes all data from the disk so that the data can’t be retrieved by any
means. Data is removed by writing three distinct patterns over the entire
disk (or a section of the disk). If the verification passes, a hex-bit pattern
is written over the entire disk (or a section of the disk).
Repairs defective blocks as a default.
verify Writes unique data to each block on the entire disk in the first pass.
Reads and verifies the data in the next pass. Destroys existing data on
the disk. Repairs defective blocks as a default.
DEFECT MENU:
primary - extract manufacturer’s defect list
grown - extract manufacturer’s and repaired defects lists
both - extract both primary and grown defects lists
print - display working list
dump - dump working list to file
quit
defect>
Sub-Command Description
primary Reads the manufacturer’s defect list from the disk drive and updates the
in-memory defect list.
grown Reads the grown defect list, which are defects that have been detected
during analysis, and then updates the in-memory defect list.
both Reads both the manufacturer’s defect list and the grown defect list, and
then updates the in-memory defect list.
Adding an entry to the format.dat file can save time if the disk drive will be used
throughout your site. To use the format.dat file on other systems, copy the file to
each system that will use the specific disk drive that you added to the format.dat
file.
You should modify the /etc/format.dat file for your system if you have one of the
following:
■ A disk that is not supported by the Solaris operating system
■ A disk with a slice table that is different from the Solaris operating system’s default
configuration
Note – Do not alter default entries in the /etc/format.dat file. If you want to alter
the default entries, copy the entry, give it a different name, and make the appropriate
changes to avoid confusion.
Keyword Use
disk_type Defines the controller and disk model. Each disk_type definition contains
information that concerns the physical geometry of the disk. The default data file
contains definitions for the controllers and disks that the Solaris operating system
supports.
You need to add a new disk_type only if you have an unsupported disk. You
can add as many disk_type definitions to the data file as you want.
partition Defines a slice table for a specific disk type. The slice table contains the slice
information, plus a name that lets you refer to it in the format utility. The default
format.dat file contains default slice definitions for several kinds of disk
drives. Add a slice definition if you recreated slices on any of the disks on your
system. Add as many slice definitions to the data file as you need.
The keyword itself is assigned the name of the disk type. This name appears in the
disk’s label, and is used to identify the disk type whenever the format utility is run.
Enclose the name in double quotation marks to preserve any white space in the name.
The following table describes the identifiers that must also be assigned values in all
disk_type definitions.
Identifier Description
ctlr Identifies the controller type for the disk type. Currently, the supported
values are SCSI and ATA.
ncyl Specifies the number of data cylinders in the disk type. This determines
how many logical cylinders of the disk the system will be allowed to
access.
acyl Specifies the number of alternate cylinders in the disk type. These
cylinders are used by the format utility to store information such as the
defect list for the drive. You should always leave at least two cylinders for
alternates.
pcyl Specifies the number of physical cylinders in the disk type. This number is
used to calculate the boundaries of the disk media. This number is usually
equal to ncyl plus acyl.
nhead Specifies the number of heads in the disk type. This number is used to
calculate the boundaries of the disk media.
nsect Specifies the number of data sectors per track in the disk type. This
number is used to calculate the boundaries of the disk media. Note that
this is only the data sectors. Any spares are not reflected in the number of
data sections per track.
rpm The rotations per minute of the disk type. This information is put in the
label and later used by the file system to calculate the optimal placement
of file data.
Other identifiers might be necessary, depending on the controller. The following table
describes the identifiers that are required for SCSI controllers.
Identifier Description
fmt_time A number that Indicates how long it takes to format a given drive. See the
controller manual for more information.
cache A number that controls the operation of the on-board cache while the format
utility is operating. See the controller manual for more information.
trks_zone A number that specifies how many tracks you have per defect zone, to be used
in alternate sector mapping. See the controller manual for more information.
asect A number that specifies how many sectors are available for alternate mapping
within a given defect zone. See the controller manual for more information.
disk_type = "SUN2.1G" \
: ctlr = SCSI : fmt_time = 4 \
: ncyl = 2733 : acyl = 2 : pcyl = 3500 : nhead = 19 : nsect = 80 \
: rpm = 5400 : bpt = 44823
disk_type = "SUN2.9G" \
: ctlr = SCSI : fmt_time = 4 \
: ncyl = 2734 : acyl = 2 : pcyl = 3500 : nhead = 21 : nsect = 99 \
The partition keyword in the format.dat file is assigned the name of the slice
table. Enclose the name in double quotation marks to preserve any white space in the
name. The following table describes the identifiers that must be assigned values in all
slice tables.
Identifier Description
disk The name of the disk_type that this slice table is defined for. This name must
appear exactly as it does in the disk_type definition.
ctlr The disk controller type that this slice table can be attached to. Currently, the
supported values are ATA for ATA controllers and SCSI for SCSI controllers.
The controller type that is specified here must also be defined for the
disk_type that you specified in the disk_type definition.
The other identifiers in a slice definition describe the actual slice information. The
identifiers are the numbers 0 through 7. These identifiers are optional. Any slice that is
not explicitly assigned is set to 0 length. The value of each of these identifiers is a pair
of numbers separated by a comma. The first number is the starting cylinder for the
slice, and the second is the number of sectors in the slice. The following are some
examples of slice definitions:
partition = "SUN1.3G" \
: disk = "SUN1.3G" : ctlr = SCSI \
: 0 = 0, 34000 : 1 = 25, 133280 : 2 = 0, 2672400 : 6 = 123, 2505120
partition = "SUN2.1G" \
: disk = "SUN2.1G" : ctlr = SCSI \
: 0 = 0, 62320 : 1 = 41, 197600 : 2 = 0, 4154160 : 6 = 171, 3894240
partition = "SUN2.9G" \
: disk = "SUN2.9G" : ctlr = SCSI \
: 0 = 0, 195426 : 1 = 94, 390852 : 2 = 0, 5683986 : 6 = 282, 5097708
You can specify the information as an integer that represents the logical block number.
You can specify the number in any base, but the default is decimal. The maximum
operator (a dollar sign, $) can also be used here to let the format utility select the
appropriate value. Logical block format is used by the SunOS disk drivers in error
messages.
If any of the cylinder/head/sector numbers are not specified, the value is assumed to
be zero. You can also use the maximum operator in place of any of the numbers and
let the format utility select the appropriate value. The following are some examples
of cylinder, head, and sector entries:
Enter defective block number: 34/2/3
Enter defective block number: 23/1/
Enter defective block number: 457//
Enter defective block number: 12345
Enter defective block number: Oxabcd
Enter defective block number: 334/$/2
Enter defective block number: 892//$
The format utility always prints block numbers, in both formats. Also, the help
facility shows you the upper and lower bounds of the block number expected, in both
formats.
For example, use p to enter the partition menu from the format menu. Then, enter
p to display the current slice table.
format> p
PARTITION MENU:
0 - change ‘0’ partition
1 - change ‘1’ partition
2 - change ‘2’ partition
3 - change ‘3’ partition
4 - change ‘4’ partition
5 - change ‘5’ partition
6 - change ‘6’ partition
7 - change ‘7’ partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
quit
partition> p
For example, if you want to identify a specific partition table for a disk, you can use
the name sub-command available from the partition menu:
partition> name
Enter table name (remember quotes): "new disk3"
The man pages associated with the format utility include the following:
■ format(1M) - Describes the basic format utility capabilities and provides
descriptions of all command-line variables.
■ format.dat(4) - Describes disk drive configuration information for the format
utility.
This topic map lists the chapters that provide information on managing file systems.
525
526 System Administration Guide: Basic Administration • April 2004
CHAPTER 38
The management of file systems is one of your most important system administration
tasks.
527
Previously, UFS file systems were limited to approximately 1 terabyte on both 64-bit
and 32-bit systems. All UFS file system commands and utilities have been updated to
support multiterabyte UFS file systems.
For example, the ufsdump command has been updated with a larger block size for
dumping large UFS file systems:
# ufsdump 0f /dev/md/rdsk/d97 /dev/md/rdsk/d98
DUMP: Date of this level 0 dump: Tue Jan 07 14:23:36 2003
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/md/rdsk/d98 to /dev/md/rdsk/d97.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Forcing larger tape block size (2048).
DUMP: Writing 32 Kilobyte records
DUMP: Estimated 4390629500 blocks (2143862.06MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
Administering UFS file systems that are less than 1 terabyte remains the same. No
administration differences exist between UFS file systems that are less than one
terabyte and file systems that are greater than 1 terabyte.
You can initially create a UFS file system that is less than 1 terabyte and specify that it
can eventually be expanded into a multiterabyte file system by using the newfs -T
option. This option sets the inode and fragment density to scale appropriately for a
multiterabyte file system.
Using the newfs -T option when you create a UFS file system less than 1 terabyte on
a system running a 32-bit kernel enables you to eventually expand this file system
with the growfs command when you boot this system under a 64-bit kernel. For
more information, see newfs(1M).
You can use the growfs command to expand a UFS file system to the size of the slice
or the volume without loss of service or data. For more information, see growfs(1M).
Two new related features are multiterabyte volume support with the EFI disk label
and multiterabyte volume support with Solaris Volume Manager. For more
information, see “SPARC: Multiterabyte Volume Support With EFI Disk Label”
on page 444 and the Solaris Volume Manager Administration Guide
Before you can create a multiterabyte UFS file system, verify that you have done either
of the following:
■ Created a multiterabyte disk partition with the format utility or the Solaris
installation utilities.
■ Set up a multiterabyte volume with Solaris Volume Manager.
1. Become superuser.
1. Become superuser.
1. Become superuser.
4. Expand the UFS file system for the disk or volume to greater than 1 terabyte.
For example:
growfs -v /dev/md/rdsk/d98
/usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d98 2516631552
/dev/md/rdsk/d98: 2516631552 sectors in 68268 cylinders of 144 tracks,
256 sectors
1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 921888, 1843744, 2765600, 3687456, 4609312, 5531168, 6453024, 737...
8296736,
Initializing cylinder groups:
......................................................
super-block backups for last 10 cylinder groups at:
2507714848, 2508636704, 2509558560, 2510480416, 2511402272, 2512324128,
2513245984, 2514167840, 2515089696, 2516011552,
Cause
You attempted to mount a UFS file system that is greater than 1 terabyte on a
system running a Solaris release prior to the Solaris 9 8/03 release.
Solution
Mount a UFS file system that is greater than 1 terabyte on a system running the
Solaris 9 8/03 or later release.
Error Message
"File system was not set up with the multi-terabyte format." "Its size
cannot be increased to a terabyte or more."
Cause
You attempted to expand a file system that was not created with the newfs -T
command.
Solution
1. Back up the data for the file system that you want to expand to greater than one
terabyte.
2. Re-create the file system with the newfs command to create a multiterabyte file
system.
3. Restore the backup data into the newly created file system.
You can use the runat command to add attributes and execute shell commands in the
extended attribute name space, which is a hidden attribute directory that is associated
with the specified file.
To use the runat command to add attributes to a file, you first have to create the
attributes file.
$ runat filea cp /tmp/attrdata attr.1
Many Solaris file system commands have been modified to support file system
attributes by providing an attribute-aware option that you can use to query, copy, or
find file attributes. For more information, see the specific man page for each file
system command.
UFS Snapshots
You can use the fssnap command to create a read-only snapshot of a file system. A
snapshot is a file system’s temporary image that is intended for backup operations.
Concurrent writes are restricted to the special case of file rewrites. If the file is being
extended, writing is single threaded as before. Generally, databases pre-allocate files
and seldomly extend them thereafter. Therefore, the effects of this enhancement are
evident during normal database operations.
Consider running your I/O database applications with direct I/O enabled if you are
already using UFS to store database tables. Use your database administrative
procedures to enable direct I/O, if possible. If there is no way to enable direct I/O
through your database product, use the mount -forcedirectio option to enable
direct I/O for each file system. Or, use the directio(3C) library call to enable direct
I/O.
There was no mechanism to update this information, which is part of general UDF file
systems, in previous Solaris releases.
The new UDF specific options for the labelit command, specified with the -o
option, are the following:
■ lvinfo1 - Identifies the person who is creating the file system
■ lvinfo2 - Identifies the organization that is responsible for creating the file system
■ lvinfo3 - Identifies the contact information for media that contains the UDF file
system
Usually, you can tell from the context which meaning is intended.
The Solaris operating system uses the virtual file system (VFS) architecture, which
provides a standard interface for different file system types. The VFS architecture
enables the kernel to handle basic operations, such as reading, writing, and listing
files, and makes it easier to add new file systems.
To identify the file system type, see “Determining a File System’s Type” on page 552.
UFS UNIX file system (based on the BSD Fast File system that was
provided in the 4.3 Tahoe release). UFS is the default disk-based file
system for the Solaris operating system.
Before you can create a UFS file system on a disk, you must format
the disk and divide it into slices. For information on formatting
disks and dividing disks into slices, see Chapter 32.
HSFS High Sierra, Rock Ridge, and ISO 9660 file system. High Sierra is
the first CD-ROM file system. ISO 9660 is the official standard
version of the High Sierra File System. The HSFS file system is used
on CD-ROMs, and is a read-only file system. Solaris HSFS supports
Rock Ridge extensions to ISO 9660, which, when present on a
CD-ROM, provide all UFS file system features and file types, except
for writability and hard links.
PCFS PC file system, which allows read and write access to data and
programs on DOS-formatted disks that are written for DOS-based
personal computers.
Each type of disk-based file system is customarily associated with a particular media
device, as follows:
■ UFS with hard disk
These associations are not, however, restrictive. For example, CD-ROMs and diskettes
can have UFS file systems created on them.
With NFS, you can administer distributed resources (files or directories) by exporting
them from a server and mounting them on individual clients. For more information,
see “The NFS Environment” on page 551.
If you want to improve the performance and scalability of an NFS or CD-ROM file
system, you should use the CacheFS file system. The CacheFS software is a general
purpose caching mechanism for file systems that improves NFS server performance
and scalability by reducing server and network load.
Designed as a layered file system, the CacheFS software provides the ability to cache
one file system on another. In an NFS environment, CacheFS software increases the
client per server ratio, reduces server and network loads, and improves performance
for clients on slow links, such as Point-to-Point Protocol (PPP). You can also combine a
CacheFS file system with the AutoFS service to help boost performance and scalability.
For detailed information about the CacheFS file system, see Chapter 41.
The UDF file system is provided as dynamically loadable, 32–bit and 64–bit modules,
with system administration utilities for creating, mounting, and checking the file
system on both SPARC and x86 platforms. The Solaris UDF file system works with
supported ATAPI and SCSI DVD drives, CD-ROM devices, and disk and diskette
drives. In addition, the Solaris UDF file system is fully compliant with the UDF 1.50
specification.
The following features are not included in the UDF file system:
■ Support for write-once media, CD-RW, and DVD-RAM, with either the sequential
disk-at-once and incremental recording
■ UFS components such as quotas, ACLs, transaction logging, file system locking,
and file system threads, which are not part of the UDF 1.50 specification
TMPFS is the default file system type for the /tmp directory in the Solaris operating
system. You can copy or move files into or out of the /tmp directory, just as you
would in a UFS file system.
The TMPFS file system uses swap space as a temporary backing store. If a system with
a TMPFS file system does not have adequate swap space, two problems can occur:
■ The TMPFS file system can run out of space, just as regular file systems do.
■ Because TMPFS allocates swap space to save file data (if necessary), some
programs might not execute because of insufficient swap space.
For information about creating TMPFS file systems, see Chapter 39. For information
about increasing swap space, see Chapter 42.
For information on how to create LOFS file systems, see Chapter 39.
Caution – Do not delete the files in the /proc directory. The deletion of processes from
the /proc directory does not kill them. Remember, /proc files do not use disk space,
so there is little reason to delete files from this directory.
FIFOFS (first-in first-out) Named pipe files that give processes common access to
data
FDFS (file descriptors) Provides explicit names for opening files using file
descriptors
mountall mountall(1M) Mounts all file systems that are specified in the
virtual file system table (/etc/vfstab)
File System or
Directory File System Type Description
root (/) UFS The top of the hierarchical file tree. The root directory
contains the directories and files that are critical for
system operation, such as the kernel, the device drivers,
and the programs used to boot the system. The root
directory also contains the mount point directories
where local and remote file systems can be attached to
the file tree.
/usr UFS System files and directories that can be shared with
other users. Files that run only on certain types of
systems are in the /usr file system (for example,
SPARC executables). Files that can be used on all types
of systems, such as the man pages, are in the
/usr/share directory.
/export/home or NFS, UFS The mount point for users’ home directories, which
/home store user work files. By default the /home directory is
an automounted file system. On standalone systems,
the /home directory might be a UFS file system on a
local disk slice.
/var UFS System files and directories that are likely to change or
grow over the life of the local system. These include
system logs, vi and ex backup files, and uucp files.
/tmp TMPFS Temporary files, which are cleared each time the system
is booted or the /tmp file system is unmounted.
/etc/mnttab MNTFS A file system that provides read-only access to the table
of mounted file systems for the local system.
/var/run TMPFS A file system for storing temporary files that are not
needed after the system is booted.
The root (/) and /usr file systems are needed to run a system. Some of the most basic
commands in the /usr file system (like mount) are included in the root (/) file system
so that they are available when the system boots or is in single-user mode and /usr is
not mounted. For more detailed information on the default directories for the root (/)
and /usr file systems, see Chapter 44.
Swap Space
The Solaris operating system uses some disk slices for temporary storage rather than
for file systems. These slices are called swap slices, or swap space. Swap space is used as
virtual memory storage areas when the system does not have enough physical
memory to handle current processes.
Since many applications rely on swap space, you should know how to plan for,
monitor, and add more swap space when needed. For an overview about swap space
and instructions for adding swap space, see Chapter 42.
State flags Show the state of the file system: clean, stable, active,
logging, or unknown. These flags eliminate unnecessary
file system checks. If the file system is “clean,” “stable,” or
“logging,” file system checks are not run.
Extended fundamental types Provides 32-bit user ID (UID), group ID (GID), and device
(EFT) numbers.
For detailed information about the UFS file system structure, see Chapter 44.
UFS Logging
UFS logging bundles the multiple metadata changes that make up a complete UFS
operation into a transaction. Sets of transactions are recorded in an on-disk log, and
then applied to the actual UFS file system’s metadata.
At reboot, the system discards incomplete transactions, but applies the transactions for
completed operations. The file system remains consistent because only completed
transactions are ever applied. This consistency remains even when a system crashes,
which normally interrupts system calls and introduces inconsistencies into a UFS file
system.
The log is allocated from free blocks on the file system, and it is sized at approximately
1 Mbyte per 1 Gbyte of file system, up to a maximum of 64 Mbytes. The log is
continually flushed as it fills up. The log is also flushed when the file system is
unmounted or as a result of any lockfs command.
UFS logging is enabled by default on file systems greater than 1 terabyte in size.
In some operating systems, a file system with logging enabled is known as a journaling
file system.
For information on default file system parameters as well as procedures for creating
new UFS file systems, see Chapter 39.
Using UFS direct I/O might benefit applications, such as database engines, that do
their own internal buffering. Starting with the Solaris 8 1/01 release, UFS direct I/O
has been enhanced to allow the same kind of I/O concurrency seen when accessing
raw devices. Now you can get the benefit of file system naming and flexibility with
very little performance penalty. Check with your database vendor to see if they can
enable UFS direct I/O in their product configuration options.
Direct I/O can also be enabled on a file system by using the forcedirectio option
to the mount command. Enabling direct I/O is a performance benefit only when a file
system is transferring large amounts of sequential data.
The default behavior is no forced direct I/O on a UFS file system. For more
information, see mount_ufs(1M).
When you mount a file system, any files or directories in the underlying mount point
directory are unavailable as long as the file system is mounted. These files are not
permanently affected by the mounting process, and they become available again when
the file system is unmounted. However, mount directories are typically empty,
because you usually do not want to obscure existing files.
For example, the following figure shows a local file system, starting with a root (/) file
system and the sbin, etc, and opt subdirectories.
ttydefs
To access a local file system from the /opt file system that contains a set of unbundled
products, you must do the following:
■ First, you must create a directory to use as a mount point for the file system you
want to mount, for example, /opt/unbundled.
■ Once the mount point is created, you can mount the file system (by using the
mount command), which makes all of the files and directories in
/opt/unbundled available, as shown in the following figure.
For step-by-step instructions on how to mount file systems, see Chapter 40.
app1 app2
rc0 ufs group
file1 file1
shutdown mount system
file2 file2
ttydefs
file3 file3
Mount point
File system
A default /etc/vfstab file is created when you install a system, depending on the
selections you make when installing system software. However, you can edit the
/etc/vfstab file on a system whenever you want. To add an entry, the main
information you need to specify is the device where the file system resides, the name
of the mount point, the type of the file system, whether you want the file system to
mount automatically when the system boots (by using the mountall command), and
any mount options.
In the preceding example, the last entry specifies that a UFS file system on the
/dev/dsk/c0t3d0s7 slice will be automatically mounted on the /test mount point
when the system boots. Note that, for root (/) and /usr, the mount at boot field
value is specified as no, because these file systems are mounted by the kernel as part
of the boot sequence before the mountall command is run.
For descriptions of each of the /etc/vfstab fields and information on how to edit
and use the file, see Chapter 40.
NFS makes the actual physical location of the resource irrelevant to the user. Instead of
placing copies of commonly used files on every system, NFS allows you to place one
copy on one system’s disk and let all other systems access it from the network. Under
NFS, remote files are virtually indistinguishable from local ones.
A system becomes an NFS server if it has resources to share on the network. A server
keeps a list of currently shared resources and their access restrictions (such as
read/write or read-only access).
When you share a resource, you make it available for mounting by remote systems.
For information on how to share resources, see Chapter 40. For a complete description
of NFS, see “Managing Network File Systems (Overview)” in System Administration
Guide: Resource Management and Network Services.
Automounting or AutoFS
You can mount NFS file system resources by using a client-side service called
automounting (or AutoFS), which enables a system to automatically mount and
unmount NFS resources whenever you access them. The resource remains mounted as
long as you remain in the directory and are using a file. If the resource is not accessed
for a certain period of time, it is automatically unmounted.
With AutoFS, you can specify multiple servers to provide the same file system. This
way, if one of the servers is down, AutoFS can try to mount from another machine.
For complete information on how to set up and administer AutoFS, see System
Administration Guide: IP Services.
mount-point Specifies the mount point name of the file system for
which you want to know the file system type. For
example, the /var directory.
The following example uses the /etc/mnttab file to determine the file system type of
the currently mounted diskette (which was mounted by vold).
$ grep /floppy /etc/mnttab
/vol/dev/diskette0/unnamed_floppy /floppy/unnamed_floppy pcfs rw,
nohidden,nofoldcase,dev=16c0009 89103376
$
This chapter describes how to create UFS, temporary (TMPFS), and loopback (LOFS)
file systems. For UFS file systems, this chapter shows you how to create a file system
on a hard disk by using the newfs command. Because TMPFS and LOFS are virtual
file systems, you actually “access” them by mounting them.
Note – For instructions on how to create UFS and DOS file systems on removable
media, see Chapter 17.
555
Note – Solaris device names use the term slice (and the letter s in the device name) to
refer to the slice number. Slices are also called “partitions.”
You need to create UFS file systems only occasionally, because the Solaris operating
system automatically creates them as part of the installation process. You need to
create (or re-create) a UFS file system when you want to do the following:
■ Add or replace disks
■ Change the existing partitioning structure
■ Do a full restoration of a file system
The newfs command is the standard way to create UFS file systems. The newfs
command is a convenient front-end to the mkfs command, which actually creates the
new file system. The newfs command reads parameter defaults, such as tracks per
cylinder and sectors per track, from the disk label that will contain the new file
system. The options you choose are passed to the mkfs command to build the file
system.
Minimum free space ((64 Mbytes/partition size) * 100), rounded down to the
nearest integer and limited to between 1% and 10%,
inclusively
b. You need to know the device name of the slice that will contain the file
system.
For information on finding disks and disk slice numbers, see Chapter 33.
-b size Specifies the block size for the file system, either 4096 or
8192 bytes per block. The default is 8192.
-i bytes Specifies the number of bytes per inode. The default varies
depending on the disk size. For more information, see
newfs(1M).
device-name Specifies the disk device name on which to create the new
file system.
Caution – Be sure you have specified the correct device name for the slice before
performing this step. If you specify the wrong slice, you will erase its contents
when the new file system is created. This error might cause the system to panic.
3. To verify the creation of the UFS file system, check the new file system.
# fsck /dev/rdsk/device-name
The device-name argument specifies the name of the disk device that contains the
new file system.
The fsck command checks the consistency of the new file system, reports any
problems, and prompts you before it repairs the problems. For more information
on the fsck command, see Chapter 43 or fsck(1M).
If you create multiple TMPFS file systems, be aware that they all use the same system
resources. Files created under one TMPFS file system use up the space available for
any other TMPFS file system, unless you limit TMPFS sizes by using the -o size
option of the mount command.
2. Create the directory that you want to mount as the TMPF file system, if
necessary.
-o size=number Specifies the size limit of the TMPFS file system in Mbytes.
To set up the system to automatically mount a TMPFS file system when it boots,
see “Example—Mounting a TMPFS File System at Boot Time” on page 559.
For more information on the /etc/vfstab file, see “Field Descriptions for the
/etc/vfstab File” on page 566.
Caution – Be careful when creating LOFS file systems. Because LOFS file systems are
virtual file systems, the potential for confusing both users and applications is
enormous.
2. Create the directory you want to mount as an LOFS file system, if necessary.
# mkdir loopback-directory
4. Create the mount point where you want to mount the LOFS file system, if
necessary.
# mkdir /mount-point
Caution – Make sure the loopback entries are the last entries in the /etc/vfstab file.
Otherwise, if the /etc/vfstab entry for a loopback file system precedes the file
systems to be included in it, the loopback file system cannot be mounted.
For more information on the /etc/vfstab file, see “Field Descriptions for the
/etc/vfstab File” on page 566.
The following table provides guidelines on mounting file systems based on how you
use them.
563
Mount Type Needed Suggested Mount Method
Local or remote file systems that need to be The mount command that you enter manually
mounted infrequently from the command line.
Local file systems that need to be mounted The /etc/vfstab file, which mounts the file
frequently system automatically when the system is
booted in multi-user state.
Remote file systems that need to be mounted ■ The /etc/vfstab file, which
frequently, such as home directories automatically mounts the file system when
the system is booted in multi-user state.
■ AutoFS, which automatically mounts or
unmounts the file system when you access
or change out of the directory.
You can mount media that contains a file system by inserting the media into the drive
and running the volcheck command if necessary. For more information on mounting
removable media, see Chapter 17.
mountall mountall(1M) Mounts all file systems that are specified in the
/etc/vfstab file. The mountall command runs
automatically when the system enters multiuser
mode.
umountall mountall(1M) Unmounts all file systems that are specified in the
/etc/vfstab file.
The umount and umountall commands will not unmount a file system that is busy.
A file system is considered busy if one of the following is true:
■ A user is accessing a file or directory in the file system.
■ If a program has a file open in that file system.
■ If the file system is shared.
For a complete list of mount options for each file system type, refer to the specific
mount man pages (for example, mount_ufs(1M)).
hard | soft NFS Specifies the procedure if the server does not
respond. The soft option indicates that an error
is returned. The hard option indicates that the
retry request is continued until the server
responds. The default is hard.
device to fsck The raw (character) device name that corresponds to the UFS file system
identified by the device to mount field (for example,
/dev/rdsk/c0t0d0s0). This field determines the raw interface that is
used by the fsck command. Use a dash (-) when there is no applicable
device, such as for a read-only file system or a remote file system.
mount point Identifies where to mount the file system (for example, /usr).
fsck pass The pass number used by the fsck command to decide whether to
check a file system. When the field contains a dash (-), the file system is
not checked.
When the field contains a zero, UFS file systems are not checked but
non-UFS file systems are checked. When the field contains a value
greater than zero, the file system is always checked.
All file systems with a value of 1 in this field are checked one at a time
in the order they appear in the vfstab file. When the fsck command is
run on multiple UFS file systems that have fsck pass values greater
than one and the preen option (-o p) is used, the fsck command
automatically checks the file systems on different disks in parallel to
maximize efficiency. Otherwise, the value of the pass number does not
have any effect.
mount at boot Set to yes or no for whether the file system should be automatically
mounted by the mountall command when the system is booted. Note
that this field has nothing to do with AutoFS. The root (/), /usr and
/var file systems are not mounted from the vfstab file initially. This
field should always be set to no for these file systems and for virtual file
systems such as /proc and /dev/fd.
mount options A list of comma-separated options (with no spaces) that are used for
mounting the file system. Use a dash (-) to indicate no options. For a list
of commonly used mount options, see Table 40–2.
3. Edit the /etc/vfstab file and add an entry. Make sure that you do the
following:
Note – Since the root (/) file system is mounted read-only by the kernel during the
boot process, only the remount option (and options that can be used in
conjunction with remount) affect the root (/) entry in the /etc/vfstab file.
The following example shows how to mount the /export/man directory from the
system pluto as an NFS file system on mount point /usr/man. A device to fsck
nor a fsck pass is specified because it’s an NFS file system. In this example, mount
options are ro (read-only) and soft.
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
pluto:/export/man - /usr/man nfs - yes ro,soft
The following example shows how to mount the root (/) file system on a loopback
mount point, /tmp/newroot. LOFS file systems must always be mounted after the
file systems that are in the LOFS file system.
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
/ - /tmp/newroot lofs - yes -
All the file systems with a device to fsck entry are checked and fixed, if necessary,
before they are mounted.
The following example shows how to mount all the local systems that are listed in the
/etc/vfstab file.
# mountall -l
# mount
/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=...
/usr on /dev/dsk/c0t0d0s6 read/write/setuid/intr/largefiles/xattr/...
/proc on /proc read/write/setuid/dev=38c0000 on Sun Feb 2 18:20:07 2003
/etc/mnttab on mnttab read/write/setuid/dev=3980000 on Sun Feb 2 ...
/dev/fd on fd read/write/setuid/dev=39c0000 on Sun Feb 2 18:20:10 2003
/var/run on swap read/write/setuid/xattr/dev=1 on Sun Feb 2 18:20:11 2003
/tmp on swap read/write/setuid/xattr/dev=2 on Sun Feb 2 18:20:15 2003
/export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr...
/datab on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/ ...
The following example shows how to mount all of the remote file systems that are
listed in the /etc/vfstab file.
-o mount-options Specifies mount options that you can use to mount a UFS
file system. For a list of options, see Table 40–2 or
mount_ufs(1M).
/dev/dsk/device-name Specifies the disk device name for the slice that contains the
file system (for example, /dev/dsk/c0t3d0s7). To get
slice information for a disk, see “How to Display Disk Slice
Information” on page 469.
This procedure assumes that the file system is in the /etc/vfstab file.
4. Remove or move any large files in this file system to another file system, if
necessary.
-o mount-options Specifies mount options that you can use to mount an NFS
file system. See Table 40–2 for the list of commonly used
mount options or mount_nfs(1M) for a complete list of
options.
server:/directory Specifies the server’s host name that contains the shared
resource, and the path to the file or directory to mount.
/dev/dsk/device-name Specifies the device name of the whole disk (for example,
/dev/dsk/c0t0d0p0).
The following example shows how to mount the first logical drive in the extended
DOS slice read-only on /mnt.
# mount -F pcfs -o ro /dev/dsk/c0t0d0p0:2 /mnt
Note – File systems are automatically unmounted as part of the system shutdown
procedure.
You can use the umount -f option to forcibly unmount a file system that is busy in an
emergency situation. This practice is not recommended under normal circumstances
because the unmounting of a file system with open files could cause a loss of data.
This option is only available for UFS and NFS file systems.
2. List all the processes that are accessing the file system so that you know which
processes you are going to stop.
# fuser -c [ -u ] /mount-point
-c Reports on files that are mount points for file systems and
any files within those mounted file systems.
/mount-point Specifies the name of the file system for which you want to
stop processes.
Note – You should not stop a user’s processes without first warning the user.
4. Verify that there are no processes that are accessing the file system.
# fuser -c /mount-point
Note – The root (/), /usr, and /var file systems can be unmounted only during a
shutdown, since the system needs these file systems to function.
1. Make sure that you have met the prerequisites listed in “Prerequisites for
Unmounting File Systems” on page 575.
The following example shows how to unmount the file system on slice 7.
# umount /dev/dsk/c0t0d0s7
The following example shows how to forcibly unmount the /export file system.
# umount -f /export
#
All file systems are unmounted, except for those file systems that are busy.
This chapter describes how to set up and maintain CacheFS™ file systems.
1. Create and mount a Create the cache and mount “Creating and Mounting a
CacheFS file system the file system in the cache. CacheFS File System (Task
Map)” on page 582
579
Task Description For Instructions
3. (Optional) Pack and unpack Determine whether you want “Packing a Cached File
a CacheFS file system to pack the cache and use System (Task Map)”
packing lists. Packing the on page 593
cache ensures that certain files
and directories are always
updated in the cache.
Network
The back file system is the file system that you specify to be mounted in the cache,
which can be either NFS or HSFS (High Sierra File System). When the user attempts to
access files that are part of the back file system, those files are placed in the cache. The
front file system is the file system that is mounted in the cache and is accessed from the
local mount point. The front file system type must be UFS.
To the user, the initial request to access a file in a CacheFS file system might seem slow,
but subsequent uses of the same file are faster.
TABLE 41–1 CacheFS File System Parameters and Their Default Values
Typically, you should not change any of these parameter values. They are set to
default values to achieve optimal cache behavior. However, you might want to modify
the maxblocks and maxfiles values if you have some room in the front file system
that is not used by the cache, and you want to use it for some other file system. You do
so by using the cfsadmin command. For example:
$ cfsadmin -o maxblocks=60
1. Share the file system to be Verify that the file system you share(1M)
cached want to cache is shared.
2. Create the cache Use the cfsadmin command “How to Create the Cache”
to create the cache. on page 583
Note – After you have created the cache, do not perform any operations within the
cache directory itself. Doing so could cause conflicts within the CacheFS software.
Mount Type for CacheFS File System Frequency of CacheFS Mount Type
Using the mount command Every time the system reboots in order to
access the same file system.
Editing the /etc/vfstab file Only once. The /etc/vfstab file remains
unchanged after the system reboots.
Choose the method of mounting file systems that best suits your environment.
You can mount only file systems that are shared. For information on sharing file
systems, see share(1M).
Note – The caching of the root (/) and /usr file systems is not supported in a CacheFS
file system.
fstype Indicates the file system type of the back file system, which
can be either NFS or HSFS.
/cache-directory Indicates the name of the UFS directory where the cache
resides. This name is the same name you specified when
you created the cache in “How to Create the Cache”
on page 583.
/back-filesystem Specifies the mount point of the back file system to cache. If
the back file system is an NFS file system, you must specify
the host name of the server from which you are mounting
the file system and the name of the file system to cache,
separated by a colon. For example, merlin: /data/abc.
The following example shows how to make a Solaris 9 SPARC CD (HSFS file system)
available as a CacheFS file system named /cfssrc. Because you cannot write to the
CD, the ro argument is specified to make the CacheFS file system read-only. This
example assumes that vold is not running.
# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /sol9
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/sol9 /dev/dsk/c0t6d0s0 /cfssrc
# ls /cfssrc
Copyright Solaris_9
The following example shows how to mount a CD as a CacheFS file system with vold
running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/cdrom/epson /vol/dev/dsk/c0t2d0/epson /drvrs
The following example uses the demandconst option to specify consistency checking
on demand for the NFS CacheFS file system /docs, whose back file system is
merlin:/docs. For more information, see “Consistency Checking of a CacheFS File
System” on page 590.
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,demandconst merlin:/docs /docs
2. Using an editor, specify the file systems to be mounted in the /etc/vfstab file.
See the example that follows.
For more information on the /etc/vfstab file, see “Field Descriptions for the
/etc/vfstab File” on page 566.
5. Verify that the entry was made correctly by changing to the file system you
mounted in the cache, and then list the contents, as follows:
# cd /filesystem
# ls
For more information about AutoFS and how to edit the maps, refer to “Task
Overview for Autofs Administration” in System Administration Guide: Resource
Management and Network Services.
1. Modify a CacheFS file Modify CacheFS file system “Modifying a CacheFS File
system behavior by unmounting, System” on page 588
deleting, or re-creating the
cache.
2. Display CacheFS file system Display information about “How to Display Information
information CacheFS file systems by using About a CacheFS File System”
the cfsadmin command. on page 589
4. Delete a CacheFS file Delete a CacheFS file system “How to Delete a CacheFS
system by using the umount File System” on page 590
command and the cfsadmin
command.
5. Check the integrity of a Check the integrity of a “How to Check the Integrity
CacheFS file system CacheFS file system by using of a CacheFS File System”
the fsck_cachefs on page 592
command.
If you are using the /etc/vfstab file to mount file systems, you modify the cache by
editing the file system options in the /etc/vfstab file. If you are using AutoFS, you
modify the cache by editing the file system options in the AutoFS maps.
In the following example, the cache is deleted, re-created, and then mounted again
with the demandconst option specified for the /docs file system.
# shutdown -g30 -y
.
.
.
# fsck /local
# mount /local
# cfsadmin -d all /local/mycache
# cfsadmin -c /local/mycache
# init 6
.
.
.
console login:
password:
# mount -F cachefs -o backfstype=nfs,cachedir=/local/cache1,demandconst
merlin:/docs /docs
#
2. Display information about all file systems cached under a specified cache.
# cfsadmin -l /cache-directory
/cache-directory is the name of the directory where the cache resides.
2. Mount the file system in the cache and specify cache consistency checking.
# mount -F cachefs -o backfstype=nfs,cachedir=/directory,demandconst
server:/file-system /mount-point
cache-ID Indicates the name of the CacheFS file system, which is the
last line of the cfsadmin -l output. For more information,
see “How to Display Information About a CacheFS File
System” on page 589. You can delete all the CacheFS file
systems in a particular cache by specifying all for
cache-ID.
6. Update the resource counts for the cache by running the fsck -F cachefs
command.
For more information, see “How to Check the Integrity of a CacheFS File System”
on page 592.
-o noclean Forces a check on the CacheFS file systems only. Does not
make any repairs.
/cache-directory Indicates the name of the directory where the cache resides.
Pack files in the cache Identify files and directories “How to Pack Files in the
to be loaded in the cache and Cache” on page 594
pack them. Packing ensures
that current copies of these
files are available in the cache.
Create a packing list Create a packing list if you do “How to Create a Packing
not want to specify each List” on page 596
individual file that you want
packed in the cache.
Pack files in the cache with a Specify the name of the “How to Pack Files in the
packing list packing list of the files to be Cache With a Packing List”
packed in the cache. on page 597
Unpack files or packing lists Remove a file from the cache “How to Unpack Files or
from the cache that is no longer needed. Packing Lists From the
Cache” on page 597
Display packed files View information about the “How to Display Packed Files
information files that you’ve packed, Information” on page 595
including their packing status.
You can specify files and directories to be loaded in the cache with the cachefspack
command. This command ensures that current copies of these files are available in the
cache.
You can print out a brief help summary of all the cachefspack options by using the
-h option as follows:
$ cachefspack -h
Must select 1 and only 1 of the following 5 options
-d Display selected filenames
-i Display selected filenames packing status
-p Pack selected filenames
-u Unpack selected filenames
-U Unpack all files in directory ’dir’
-f Specify input file containing rules
-h Print usage information
-r Interpret strings in LIST rules as regular expressions
-s Strip ’./’ from the beginning of a pattern name
-v Verbose option
files - a list of filenames to be packed/unpacked
filename Specifies the name of the files or directory you want packed in
the cache. When you specify a directory, all of its
subdirectories are also packed. For more information, see
cachefspack(1M).
The following example shows three files being packed in the cache.
$ cachefspack -p projects updates master_plan
cached-filename-or-directory Specifies the name of the file or directory for which to display
information.
In the following example, the /data/abc directory contains the bin subdirectory.
The bin subdirectory has three files: big, medium, and small. Although the big and
small files are specified to be packed, they are not. The medium file is successfully
packed.
$ cd /data/abc
$ cachefspack -i bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO
cachefspack: file /bin/medium marked packed YES,
packed YES
cachefspack: file /bin/small marked packed YES,
packed NO
.
.
.
If you use the -iv options together, you get additional information as to whether the
file or directory specified has been flushed from the cache. For example:
$ cd /data/bin
$ cachefspack -iv bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO,
nocache YES
cachefspack: file /bin/medium marked packed YES,
packed YES, nocache NO
The last line of the preceding example shows that the directory contents have not been
flushed from the cache.
This feature saves the time of having to specify each individual file that you want
packed in the cache.
■ The path identified with the BASE statement is the directory where you have items
you want to pack.
-u Specifies that you want the file or files unpacked. You must
specify a filename with this option.
For more information about the cachefspack command, see the man page.
The following example shows several files being unpacked from the cache.
$ cd /data/abc/bin/big
$ cachefspack -u big small medium
The following example shows how to unpack a packing list, which is a file that
contains the path to a directory of files, as follows:
$ cachefspack -uf list.pkg
The following example uses the -U option to specify that all files in a cache directory
being unpacked.
$ cachefspack -U /local/mycache
You cannot unpack a cache that does not have at least one file system mounted. With
the -U option, if you specify a cache that does not contain mounted file systems, you
see output similar to the following:
$ cachefspack -U /local/mycache
cachefspack: Could not unpack cache /local/mycache, no mounted
filesystems in the cache.
Cause
You might not have the correct permissions to access the file or directory.
Action
Set the correct permissions.
Cause
You might not have the correct file or directory.
Action
Check for a possible typo.
cachefspack: pathname - can’t open directory: stale NFS file handle
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Action
Verify that the file or directory on the server is still accessible.
cachefspack: pathname - can’t open directory: interrupted system
call
Cause
You might have inadvertently pressed Control-C while issuing the command.
Action
Reissue the command.
cachefspack: pathname - can’t open directory: I/O error
Cause
You might have a hardware problem.
Action
Check your hardware connections.
cachefspack: error opening dir
Cause
You might not have the correct file or directory. The path identified after the BASE
command in the file format could be a file and not a directory. The path specified
must be a directory.
Action
Check for a possible typo. Check the path identified after the BASE command in
your file format. Make sure the path identifies a directory, not a file.
cachefspack: unable to get shared objects
Cause
The executable might be corrupt or in a format that is not recognizable.
Action
Replace the executable.
cachefspack: filename - can’t pack file: permission denied
Cause
You might not have the correct file or directory.
Action
Check for a possible typo.
cachefspack: filename- can’t pack file: stale NFS file handle
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Action
Verify that the file or directory on the server is still accessible.
cachefspack: filename- can’t pack file: interrupted system call
Cause
You might have inadvertently pressed Control-C while issuing the command.
Action
Reissue the command.
cachefspack: filename- can’t pack file: I/O error
Cause
You might have a hardware problem.
Action
Check your hardware connections.
cachefspack: filename- can’t pack file: no space left on device.
Cause
The cache is out of disk space.
Action
You need to increase the size of the cache by increasing disk space.
cachefspack: filename - can’t unpack file: permission denied
Cause
You might not have the correct permissions to access the file or directory.
Action
Set the correct permissions.
cachefspack: filename - can’t unpack file: no such file or directory
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Action
Verify that the file or directory on the server is still accessible.
cachefspack: filename - can’t unpack file: interrupted system call
Cause
You might have pressed Control-C inadvertently while issuing the command.
Action
Reissue the command.
cachefspack: filename- can’t unpack file I/O error
Cause
You might have a hardware problem.
Action
Check your hardware connections.
cachefspack: only one ‘d’, ‘i’, ‘p’, or ‘u’ option allowed
Cause
You entered more than one of these options in a command session.
Action
Select one option for the command session.
cachefspack: can’t find environment variable.
Cause
You forgot to set a corresponding environment variable to match the $ in your
configuration file.
Action
Define the environment variable in the proper location.
cachefspack: skipping LIST command - no active base
Cause
A LIST command is present in your configuration file that has no corresponding
BASE command.
Action
Define the BASE command.
Locate the log file Locate the log file with the “How to Locate the CacheFS
cachefslog command. Log File” on page 604
View the cache size View the cache size by using “How to View the Working
the cachefswssize Set (Cache) Size” on page 605
command.
View the cache statistics View the statistics by using “How to View CacheFS
the cachefsstat command. Statistics” on page 606
These statistics will help you determine the trade-off between your cache size and the
desired performance of the cache.
Note – You can issue the CacheFS statistics commands from any directory. You must be
superuser to issue the cachefswssize command.
The CacheFS statistics begin accumulating when you create the log file. When the
work session is over, stop the logging by using the cachefslog -h command, as
described in “How to Stop CacheFS Logging” on page 605.
Before using the CacheFS statistics commands, you must do the following:
■ Set up your cache by using the cfsadmin command.
■ Decide on an appropriate length of time to allow statistical information to collect in
the log file you create. The length of time should equal a typical work session. For
example, a day, a week, or a month.
■ Select a location or path for the log file. Make sure that there is enough space to
allow for the growth of the log file. The longer you intend to allow statistical
information to collect in the log file, the more space you need.
Note – The following procedures are presented in a recommended order. The order is
not required.
-f Sets up logging.
log-file-path Specifies the location of the log file. The log file is a
standard file you create with an editor, such as vi.
/mount-point Designates the mount point (CacheFS file system) for which
statistics are being collected.
/mount-point specifies the CacheFS file system for which you want to view the
statistics.
The following example shows what you would see if a log file has been set up. The
location of the log file is /var/tmp/stufflog.
$ cachefslog /home/stuff
/var/tmp/stufflog: /home/stuff
The following example shows that no log file has been set up for the specified file
system.
$ cachefslog /home/zap
not logged: /home/zap
If you get a system response other than the one specified here, you did not
successfully stop logging. Check to see if you are using the correct log file name and
mount point.
2. View the current cache size and highest logged cache size.
# cachefswssize log-file-path
For more information, see cachefswssize(1M).
/home/sam
end size: 10688k
high water size: 10704k
/
end size: 1736k
high water size: 1736k
/opt
end size: 128k
high water size: 128k
/nfs/saturn.dist
end size: 1472k
/data/abc
end size: 7168k
high water size: 7168k
/nfs/venus.svr4
end size: 4688k
high water size: 5000k
/data
end size: 4992k
high water size: 4992k
cache hit rate The rate of cache hits versus cache misses, followed by the actual
number of hits and misses. A cache hit occurs when the user wants to
perform an operation on a file or files, and the file or files are actually in
the cache. A cache miss occurs when the file is not in the cache. The load
on the server is the sum of cache misses, consistency checks, and
modifications (modifies).
/mount-point specifies the CacheFS file system for which you want to view the
statistics.
609
Swap Space and Virtual Memory
The Solaris software uses some disk slices for temporary storage rather than for file
systems. These slices are called swap slices. Swap slices are used as virtual memory
storage areas when the system does not have enough physical memory to handle
current processes.
The virtual memory system maps physical copies of files on disk to virtual addresses
in memory. Physical memory pages that contain the data for these mappings can be
backed by regular files in the file system, or by swap space. If the memory is backed
by swap space it is referred to as anonymous memory because there is no identity
assigned to the disk space that is backing the memory.
The Solaris environment uses the concept of virtual swap space, a layer between
anonymous memory pages and the physical storage (or disk-backed swap space) that
actually back these pages. A system’s virtual swap space is equal to the sum of all its
physical (disk-backed) swap space plus a portion of the currently available physical
memory.
The TMPFS file system allocates space in the /tmp directory from the system’s swap
resources. This feature means that as you use up space in the /tmp directory, you are
also using up swap space. So if your applications use the /tmp directory heavily and
you do not monitor swap space usage, your system could run out of swap space.
Use the following if you want to use TMPFS but your swap resources are limited:
■ Mount the TMPFS file system with the size option (-o size) to control how much
swap resources TMPFS can use.
■ Use your compiler’s TMPDIR environment variable to point to another larger
directory.
If you are using a volume manager to manage your disks, such as Solaris Volume
Manager, do not configure your dedicated dump device to be under the control of
Solaris Volume Manager. You can keep your swap areas under Solaris Volume
Manager’s control, which is a recommended practice. However, for accessibility and
performance reasons, configure another disk as a dedicated dump device outside of
Solaris Volume Manager’s control.
For example, the following swap -l output shows that this system’s swap space is
almost entirely consumed or at 100% allocation.
% swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 136,1 16 1638608 88
For information on adding more swap space to your system, see “How to Create a
Swap File and Make It Available” on page 616.
malloc error O
The following message means TMPFS ran out of physical memory while attempting to
create a new file or directory.
directory: File system full, memory allocation failed
Starting in the Solaris 9 release, the installation program allocates swap space starting
at the first available disk cylinder (typically cylinder 0). This placement provides
maximum space for the root (/) file system during the default disk layout and enables
the growth of the root (/) file system during an upgrade.
For general guidelines on allocating swap space, see “Planning for Swap Space”
on page 613.
You can allocate additional swap space to the system by creating a swap file. For
information about creating a swap file, see “Adding More Swap Space” on page 615.
An entry for a swap device in the /etc/vfstab file contains the following:
■ The full path name of the swap slice or swap file
■ File system type of swap
The file system that contains a swap file must be mounted before the swap file is
activated. So, in the /etc/vfstab file, make sure that the entry that mounts the file
system comes before the entry that activates the swap file.
Consult your application vendor for swap space requirements for their applications.
If you are unable to determine swap space requirements from your application
vendor, use the following general guidelines based on your system type to allocate
swap space:
In addition to the general guidelines, consider allocating swap or disk space for the
following:
■ A dedicated dump device.
Use the swap -l command to identify a system’s swap areas. Activated swap devices
or files are listed under the swapfile column.
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 136,1 16 1638608 1600528
The used value plus the available value equals the total swap space on the system,
which includes a portion of physical memory and swap devices (or files).
You can use the amount of available and used swap space (in the swap -s output) as
a way to monitor swap space usage over time. If a system’s performance is good, use
swap -s to see how much swap space is available. When the performance of a system
slows down, check the amount of available swap space to see if it has decreased. Then
you can identify what changes to the system might have caused swap space usage to
increase.
When using this command, keep in mind that the amount of physical memory
available for swap usage changes dynamically as the kernel and user processes lock
down and release physical memory.
Note – The swap -l command displays swap space in 512-byte blocks and the swap
-s command displays swap space in 1024-byte blocks. If you add up the blocks from
swap -l and convert them to Kbytes, the result will be less than used + available
(in the swap -s output) because swap -l does not include physical memory in its
calculation of swap space.
The output from the swap -s command is summarized in the following table.
Keyword Description
bytes allocated The total amount of swap space in 1024-byte blocks that is
currently allocated as backing store (disk-backed swap space).
reserved The total amount of swap space in 1024-byte blocks that is not
currently allocated, but claimed by memory for possible future
use.
used The total amount of swap space in 1024-byte blocks that is either
allocated or reserved.
Alternative ways to add more swap space are to repartition an existing disk or add
another disk. For information on how to repartition a disk, see Chapter 32.
Option Description
-n Creates an empty file. The size is noted, but the disk blocks are not
allocated until data is written to them.
Caution – Use the -n option only when you create an NFS swap file.
5. Add an entry for the swap file to the /etc/vfstab file that specifies the full
path name of the file, and designates swap as the file system type, as follows:
/path/filename - - swap - no -
3. Edit the /etc/vfstab file and delete the entry for the swap file.
4. Recover the disk space so that you can use it for something else.
# rm /path/filename
If the swap space is a file, remove it. Or, if the swap space is on a separate slice and
you are sure you will not need it again, make a new file system and mount the file
system.
For information on mounting a file system, see Chapter 40.
For information about fsck error messages, see “Resolving UFS File System
Inconsistencies (Tasks)” in System Administration Guide: Advanced Administration.
For background information on the UFS file system structures referred to in this
chapter, see Chapter 44.
619
File systems can be inconsistent because of abrupt termination of the operating system
in these ways:
■ Power failure
■ Accidental unplugging of the system
■ Turning off the system without proper shutdown procedure
■ A software error in the kernel
File system inconsistencies, while serious, are not common. When a system is booted,
a check for file system consistency is automatically performed (with the fsck
command). Most of the time, this file system check repairs problems it encounters.
The fsck command places files and directories that are allocated but unreferenced in
the lost+found directory. A inode number is assigned as the name of unreferenced
file and directory. If the lost+found directory does not exist, the fsck command
creates it. If there is not enough space in the lost+found directory, the fsck
command increases its size.
The possible state flag values are described in the following table.
FSACTIVE When a file system is mounted and then modified, the state flag is set to
FSACTIVE. The file system might contain inconsistencies. A file system is
marked as FSACTIVE before any modified metadata is written to the disk.
When a file system is unmounted gracefully, the state flag is set to
FSCLEAN. A file system with the FSACTIVE flag must be checked by the
fsck command because it might be inconsistent.
FSBAD If the root (/) file system is mounted when its state is not FSCLEAN or
FSSTABLE, the state flag is set to FSBAD. The kernel will not change this
file system state to FSCLEAN or FSSTABLE. If a root (/) file system is
flagged FSBAD as part of the boot process, it will be mounted read-only.
You can run the fsck command on the raw root device. Then remount the
root (/) file system with read and write access.
FSCLEAN If a file system is unmounted properly, the state flag is set to FSCLEAN. Any
file system with an FSCLEAN state flag is not checked when the system is
booted.
FSLOG If a file system is mounted with UFS logging, the state flag is set to FSLOG.
Any file system with an FSLOG state flag is not checked when the system is
booted.
FSSTABLE The file system is (or was) mounted but has not changed since the last
checkpoint (sync or fsflush) that normally occurs every 30 seconds. For
example, the kernel periodically checks if a file system is idle and, if so,
flushes the information in the superblock back to the disk and marks it as
FSSTABLE. If the system crashes, the file system structure is stable, but
users might lose a small amount of data. File systems that are marked as
FSSTABLE can skip the checking before mounting. The mount command
will not mount a file system for read and write access if the file system state
is not FSCLEAN, FSSTABLE, or FSLOG.
The following table shows how the state flag is modified by the fsck command,
based on its initial state.
When a user program does an operation to change the file system, such as a write, the
data to be written is first copied into an in-core buffer in the kernel. Normally, the disk
update is handled asynchronously. The user process is allowed to proceed even
though the data write might not happen until long after the write system call has
returned. Thus, at any given time, the file system, as it resides on the disk, lags behind
the state of the file system that is represented by the in-core information.
The disk information is updated to reflect the in-core information when the buffer is
required for another use or when the kernel automatically runs the fsflush daemon
(at 30-second intervals). If the system is halted without writing out the in-core
information, the file system on the disk might be in an inconsistent state.
A file system can develop inconsistencies in several ways. The most common causes
are operator error and hardware failures.
Problems might result from an unclean shutdown, if a system is shut down improperly,
or when a mounted file system is taken offline improperly. To prevent unclean
shutdowns, the current state of the file systems must be written to disk (that is,
“synchronized”) before you shut down the system, physically take a disk pack out of a
drive, or take a disk offline.
Inconsistencies can also result from defective hardware or problems with the disk or
controller firmware. Blocks can become damaged on a disk drive at any time, or a disk
controller can stop functioning correctly.
For information about UFS file system structures, see “The Structure of Cylinder
Groups for UFS File Systems” on page 645.
Superblock Checks
The superblock stores summary information, which is the most commonly corrupted
component in a UFS file system. Each change to the file system inodes or data blocks
also modifies the superblock. If the CPU is halted and the last command is not a sync
command, the superblock almost certainly becomes corrupted.
For more information about the structure of the UFS file system, see “The Structure of
Cylinder Groups for UFS File Systems” on page 645.
The summary information in the superblock includes a count of the total number of
free blocks within the file system. The fsck command compares this count to the
number of free blocks it finds within the file system. If the counts do not agree, the
fsck command replaces the count in the superblock with the actual free-block count.
Inodes
The list of inodes is checked sequentially starting with inode 2 (inode 0 and inode 1
are reserved). Each inode is checked for inconsistencies in the following:
■ Format and type
■ Link count
■ Duplicate block
■ Bad block numbers
■ Inode size
Discrepancies between the link count stored in the inode and the actual link count as
determined by the fsck command might be of three types:
■ The stored count is not 0 and the actual count is 0.
This condition can occur if no directory entry exists for the inode. In this case, the
fsck command puts the disconnected file in the lost+found directory.
■ The stored count is not 0 and the actual count is not 0, but the counts are unequal.
This condition can occur if a directory entry has been added or removed, but the
inode has not been updated. In this case, the fsck command replaces the stored
link count with the actual link count.
■ The stored count is 0 and the actual count is not 0.
In this case, the fsck command changes the link count of the inode to the actual
count.
The fsck command compares each block number claimed by an inode to a list of
allocated blocks. If another inode already claims a block number, the block number is
put on a list of duplicate blocks. Otherwise, the list of allocated blocks is updated to
include the block number.
If there are any duplicate blocks, the fsck command makes a second pass of the inode
list to find the other inode that claims each duplicate block. (A large number of
duplicate blocks in an inode might be caused by an indirect block not being written to
the file system.) It is not possible to determine with certainty which inode is in error.
The fsck command prompts you to choose which inode should be kept and which
should be cleared.
Bad block numbers in an inode might be caused by an indirect block not being written
to the file system. The fsck command prompts you to clear the inode.
Each inode contains a 64-bit size field. This field shows the number of characters (data
bytes) in the file associated with the inode. A rough check of the consistency of the size
field of an inode is done by using the number of characters shown in the size field to
calculate how many blocks should be associated with the inode, and then comparing
that to the actual number of blocks claimed by the inode.
Indirect Blocks
Indirect blocks are owned by an inode. Therefore, inconsistencies in an indirect block
affect the inode that owns it. Inconsistencies that can be checked are the following:
■ Blocks already claimed by another inode
■ Block numbers outside the range of the file system
These consistency checks listed are also performed for indirect blocks.
Data Blocks
An inode can directly or indirectly reference three kinds of data blocks. All referenced
blocks must be of the same kind. The three types of data blocks are the following:
■ Plain data blocks
■ Symbolic-link data blocks
■ Directory data blocks
Plain data blocks contain the information stored in a file. Symbolic-link data blocks
contain the path name stored in a symbolic link. Directory data blocks contain
directory entries. The fsck command can check only the validity of directory data
blocks.
The directory inode number entry for “..” must be the second entry in the directory
data block. The directory inode number value must be equal to the inode number of
the parent directory (or the inode number of itself if the directory is the root directory).
If the directory inode numbers for “.” and “..” are incorrect, the fsck command
replaces them with the correct values. If there are multiple hard links to a directory,
the first hard link found is considered the real parent to which “..” should point. In
this case, the fsck command recommends that you have it delete the other names.
Disconnected Directories
The fsck command checks the general connectivity of the file system. If a directory is
found that is not linked to the file system, the fsck command links the directory to
the lost+found directory of the file system. This condition can occur when inodes
are written to the file system, but the corresponding directory data blocks are not.
The last line of fsck output describes the following information about the file system:
Before using the fsck command, you might want to refer to “Syntax and Options for
the fsck Command” on page 636 and “Resolving UFS File System Inconsistencies
(Tasks)” in System Administration Guide: Advanced Administration for information on
resolving fsck error messages.
Keep the following points in mind when running the fsck command to check UFS
file systems:
■ A file system should be inactive when using fsck to check that file system. File
system changes waiting to be flushed to disk or file system changes that occur
during the fsck checking process can be interpreted as file system corruption and
may not be a reliable indication of a problem.
■ A file system must be inactive when using fsck to repair that file system. File
system changes waiting to be flushed to disk or file system changes that occur
during the fsck repairing process might cause the file system to become corrupted
or might cause the system to crash.
■ Unmount a file system before using fsck on that file system, to ensure that it is
inactive and that all file system data structures are consistent as possible. The only
exceptions are for the active root (/) and /usr file systems, because they must be
mounted to run fsck.
■ If you need to repair the root (/) or /usr file systems, boot the system from an
alternate device, if possible, so that these file systems are unmounted and inactive.
For step-by-step instructions on running fsck on the root (/) or /usr file system,
see “How to Check the root (/) or /usr File Systems From an Alternate Boot
Device” on page 629.
2. For systems with mirrored root (/) file systems only: Detach the root (/) mirror
before booting from the alternate device or you risk corrupting the file system.
For information on detaching the root (/) mirror, see “Working with Submirrors”
in Solaris Volume Manager Administration Guide.
3. Identify the device, such as /dev/dsk/c0t0d0s0, of the root (/) or /usr file
system that needs to be checked.
You’ll need to supply this device name when booted from an alternate device. It
will more difficult to identify this device when you are already booted from the
alternate device.
4. Boot the system with the root (/) or /usr file system that needs to be checked
from an alternate device, such as a local CD or the network, in single-user mode
to ensure that there is no activity on these file systems.
For example:
# init 0
ok boot net -s
.
.
.
#
5. Check the device that contains the root (/) or /usr file system as identified in
step #3.
If the hardware for the file system to be checked or repaired has changed, the
device names might have changed. Be sure to check that the fsck -n message
Last Mounted on ... indicates the expected device for the file system.
For example, the root file system to be checked is /dev/dsk/c0t0d0s0.
# fsck -n /dev/rdsk/c0t0d0s0
** /dev/rdsk/c0t0d0s0 (NO WRITE)
** Last Mounted on /
.
.
.
fsck /dev/rdsk/c0t0d0s0
** /dev/rdsk/c0t0d0s0
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
.
.
.
7. If necessary, run the fsck command again if you see messages similar to the
following, FILE SYSTEM STATE NOT SET TO OKAY or FILE SYSTEM
MODIFIED.
The fsck command might be unable to fix all errors in one execution.
If fsck cannot repair all of the problems after running it several times, see “Fixing
a UFS File System That the fsck Command Cannot Repair” on page 633.
8. Mount the repaired file system to see if there are any files in the lost+found
directory.
Individual files put in the lost+found directory by the fsck command are
renamed with their inode numbers. If possible, rename the files and move them
where they belong. You might be able to use the grep command to match phrases
within individual files and the file command to identify file types.
Eventually, remove unidentifiable files or directories left in the lost+found
directory so it doesn’t fill it up unnecessarily.
10. For systems with mirrored root (/) file systems only: Reattach the root (/) mirror.
2. Unmount the local file system first to ensure that there is no activity on the file
system.
Specify the mount point directory or /dev/dsk/device-name as arguments to the
fsck command. Any inconsistency messages are displayed.
For example:
# umount /export/home
# fsck /dev/rdsk/c0t0d0s7
** /dev/dsk/c0t0d0s7
** Last Mounted on /export/home
.
4. If necessary, run the fsck command again if you see the following messages,
FILE SYSTEM STATE NOT SET TO OKAY or FILE SYSTEM MODIFIED.
The fsck command might be unable to fix all errors in one execution.
If fsck cannot repair all of the problems after running it several times, see “Fixing
a UFS File System That the fsck Command Cannot Repair” on page 633.
5. Mount the repaired file system to see if there are any files in the lost+found
directory.
Individual files put in the lost+found directory by the fsck command are
renamed with their inode numbers. If possible, rename the files and move them
where they belong. You might be able to use the grep command to match phrases
within individual files and the file command to identify file types.
Eventually, remove unidentifiable files or directories left in the lost+found
directory so it doesn’t fill it up unnecessarily.
You can run the fsck -o p command to preen the file systems after an unclean
shutdown. In this mode, the fsck command does not look at the clean flag and does a
full check. These actions are a subset of the actions that the fsck command takes
when it runs interactively.
Pay attention to the information displayed by the fsck command. This information
might help you fix the problem. For example, the messages might point to a damaged
directory. If you delete the directory, you might find that the fsck command runs
cleanly.
For information about restoring complete file systems, see Chapter 49.
If you cannot fully repair a file system but you can mount it read-only, try using the
cp, tar, or cpio commands to retrieve all or part of the data from the file system.
If hardware disk errors are causing the problem, you might need to reformat and
divide the disk into slices again before re-creating and restoring file systems. Check
that the device cables and connectors are functional before replacing the disk device.
Hardware errors usually display the same error again and again across different
commands. The format command tries to work around bad blocks on the disk. If the
disk is too severely damaged, however, the problems might persist, even after
reformatting. For information about using the format command, see format(1M).
For information about installing a new disk, see Chapter 34 or Chapter 35.
For more information about the superblock, see “The Superblock” on page 646.
If the superblock in the root (/) file system becomes damaged and you cannot restore
it, you have two choices:
■ Reinstall the system
■ Boot from the network or local CD, and attempt the following steps. If these steps
fail, recreate the root (/) file system with the newfs command and restore it from a
backup copy.
2. Determine whether the bad superblock is in the root (/) or /usr file system and
select one of the following:
b. Change to a directory outside the damaged file system and unmount the file
system if the bad superblock is not in the root (/) or /usr file system.
# umount /mount-point
Caution – Be sure to use the newfs -N in the next step. If you omit the -N
option, you will destroy all of the data in the file system and replace it with an
empty file system.
The following table describes the directories that are contained in the root (/) file
system.
Directory Description
637
TABLE 44–1 Default Directories in the root (/) File System (Continued)
Directory Description
/etc/lib Dynamic linking libraries that are needed when /usr is not
available
/usr Mount point for the /usr file system. For more information,
see Table 44–2.
/var/apache Scripts, icons, logs, and cache pages for Apache web server
/var/opt Root of a subtree for varying files that are associated with
software packages
/var/run Temporary system files that are not needed across system
reboots. A TMPFS-mounted directory.
/var/tmp Directory for temporary files that are not cleared during
boot sequence
The following table describes the default directories in the /usr file system.
Directory Description
kvm Obsolete
oasys Files for the Form and Menu Language Interpreter (FMLI)
execution environment
sbin/sparcv7 and sparcv9 32-bit and 64–bit versions of commands on SPARC systems
Directory Description
The following sections provide additional information about the organization and
function of these blocks.
The Superblock
The superblock stores much of the information about the file system, which includes
the following:
■ Size and status of the file system
■ Label, which includes file system name and volume name
■ Size of the file system logical block
■ Date and time of the last update
■ Cylinder group size
■ Number of data blocks in a cylinder group
■ Summary data block
■ File system state
■ Path name of the last mount point
Because the superblock contains critical data, multiple superblocks are made when the
file system is created.
Inodes
An inode contains all the information about a file except its name, which is kept in a
directory. An inode is 128 bytes. The inode information is kept in the cylinder
information block, and contains the following:
■ The type of the file:
The array of 15 disk addresses (0 to 14) points to the data blocks that store the contents
of the file. The first 12 are direct addresses. That is, they point directly to the first 12
logical storage blocks of the file contents. If the file is larger than 12 logical blocks, the
13th address points to an indirect block, which contains direct block addresses instead
of file contents. The 14th address points to a double indirect block, which contains
addresses of indirect blocks. The 15th address is for triple indirect addresses. The
following figure shows this chaining of address blocks starting from the inode.
Inode
Address 0 Indirect
array 11 block
12
Double Storage
Indirect blocks
13 indirect
block
block
.
14 .
.
Indirect
block
For a regular file, the data blocks contain the contents of the file. For a directory, the
data blocks contain entries that give the inode number and the file name of the files in
the directory.
Free Blocks
Blocks that are not currently being used as inodes, as indirect address blocks, or as
storage blocks are marked as free in the cylinder group map. This map also keeps
track of fragments to prevent fragmentation from degrading disk performance.
To give you an idea of the appearance of a typical UFS file system, the following figure
shows a series of cylinder groups in a generic UFS file system.
Logical block size is set to the page size of the system by default. The default logical
block size is 8192 bytes (8 Kbytes) for UFS file systems. The UFS file system supports
block sizes of 4096 or 8192 bytes (4 or 8 Kbytes). The recommended logical block size
is 8 Kbytes.
SPARC only – You can specify only the 8192–byte block size on the sun4u platform.
To choose the best logical block size for your system, consider both the performance
desired and the available space. For most UFS systems, an 8-Kbyte file system
provides the best performance, offering a good balance between disk performance and
the use of space in primary memory and on disk.
As a general rule, to increase efficiency, use a larger logical block size for file systems
where most of the files are very large. Use a smaller logical block size for file systems
where most of the files are very small. You can use the quot -c file-system command
on a file system to display a complete report on the distribution of files by block size.
However, the page size set when the file system is created is probably best in most
cases.
The ability to allocate fragments of blocks to files, rather than just whole blocks, saves
space by reducing fragmentation of disk space that results from unused holes in blocks.
You define the fragment size when you create a UFS file system. The default fragment
size is 1 Kbyte. Each block can be divided into 1, 2, 4, or 8 fragments, which results in
fragment sizes from 8192 bytes to 512 bytes (for 4-Kbyte file systems only). The lower
bound is actually tied to the disk sector size, typically 512 bytes.
For multiterabyte file systems, the fragment size must be equal to the file system block
size.
Note – The upper bound for the fragment is the logical block size, in which case the
fragment is not a fragment at all. This configuration might be optimal for file systems
with very large files when you are more concerned with speed than with space.
When choosing a fragment size, look at the trade-off between time and space: a small
fragment size saves space, but requires more time to allocate. As a general rule, to
increase storage efficiency, use a larger fragment size for file systems where most of the
files are large. Use a smaller fragment size for file systems where most of the files are
small.
Free space is important because file access becomes less and less efficient as a file
system gets full. As long as an adequate amount of free space exists, UFS file systems
operate efficiently. When a file system becomes full, using up the available user space,
only root can access the reserved free space.
Rotational Delay
This parameter is obsolete for modern disks. If you need to use this parameter, the
default value provided when the file system is created is probably best for most cases.
Optimization Type
The optimization type parameter is set to either space or time.
■ Space – When you select space optimization, disk blocks are allocated to minimize
fragmentation and disk use is optimized.
■ Time – When you select time optimization, disk blocks are allocated as quickly as
possible, with less emphasis on their placement. When there is enough free space,
it is relatively easy to allocate disk blocks effectively, without resulting in too much
fragmentation. The default is time.
You can change the value of the optimization type parameter for an existing file
system by using the tunefs command.
The default number of bytes per inode is 2048 bytes (2 Kbytes) if the file system is less
than one Gbyte. If the file system is larger than one Gbyte, the following formula is
used:
If you have a file system with many symbolic links, they can lower the average file
size. If your file system is going to have many small files, you can give this parameter
a lower value. Note, however, that having too many inodes is much better than
running out of inodes. If you have too few inodes, you could reach the maximum
number of files on a disk slice that is practically empty.
The following table describes the options and arguments for the newfs command.
Option Description
-s size The size of the file system in sectors. The default is to use the
entire partition.
-t ntrack The number of tracks per cylinder on the disk. The default is
determined from the disk label.
-b bsize The logical block size of the file system, which is either 4096 or
8192 bytes. The default is 8192 bytes. The sun4u architecture does
not support the 4096 block size.
-c cgsize The number of disk cylinders per cylinder group, which ranges
from 16 to 256. The default value is calculated by dividing the
number of sectors in the file system by the number of sectors in 1
Gbyte, and then multiplying the result by 32. The default value is
always between 16 to 256.
Use the mkfs command to override the default value.
This option is not applicable for disks with EFI labels and is
ignored.
-m free The minimum percentage of free disk space to maintain in the file
system (between 1% and 99%, inclusively). This space is off limits
to regular users. Once the file system is filled to this threshold,
only the superuser can continue writing to the file system.
The default is ((64 Mbytes/partition size) * 100), rounded down to
the nearest integer and limited between 1% and 10%, inclusively.
This parameter can be modified after the file system is created by
using the tunefs command.
-r rpm The speed of the disk, in revolutions per minute. This setting is
driver- or device-specific.
This parameter is converted to revolutions per second before it is
passed to the mkfs command.
This option is not applicable for disks with EFI labels and is
ignored.
-i nbpi The number of bytes per inode to use in computing how many
inodes to create for the file system. For the default values, see
“Number of Inodes (Files)” on page 651.
-o opt Optimization type to use for allocating disk blocks to files: space
or time. The default is time.
-a apc The number of alternate sectors per disk cylinder to reserve for
bad block placement for SCSI devices only. The default is 0.
This option is not applicable for disks with EFI labels and is
ignored.
-C maxcontig The maximum number of blocks, belonging to one file, that will
be allocated contiguously before inserting a rotational delay. The
default varies from drive to drive. Drives without internal (track)
buffers (or drives or controllers that don’t advertise the existence
of an internal buffer) default to 1. Drives with buffers default to 7.
This parameter is limited in the following way:
blocksize x maxcontig must be <= maxphys
maxphys is a read-only kernel variable that specifies the maximum
block transfer size (in bytes) that the I/O subsystem is capable of
satisfying. This limit is enforced by the mount command, not by
newfs or mkfs command.
This parameter also controls clustering. Regardless of the value of
rotdelay, clustering is enabled only when maxcontig is greater than
1. Clustering allows higher I/O rates for sequential I/O and is
described in tunefs(1M).
raw_device The special character (raw) device file name of the partition that
will contain the file system. This argument is required.
The generic mkfs command is located in the /usr/sbin directory. For a description
of the arguments and options, see mkfs(1M).
This topic map lists the chapters that provide information on backing up and restoring
files and file systems.
657
658 System Administration Guide: Basic Administration • April 2004
CHAPTER 46
This chapter provides guidelines and planning information for backing up and
restoring file systems by using the ufsdump and ufsrestore commands.
UFS Snapshots
The Solaris 9 release includes the fssnap command for backing up file systems while
the file system is mounted.
659
You can use the fssnap command to create a read-only snapshot of a file system. A
snapshot is a file system’s temporary image that is intended for backup operations.
This chapter describes the ufsdump and ufsrestore commands for backing up and
restoring UFS file systems. Other commands are available for copying files and file
systems for the purpose of sharing or transporting files. The following table provides
pointers to all commands that copy individual files and file systems to other media.
Back up all file systems for systems Solstice Backup software Solstice Backup 5.1
on a network from a backup server Administration Guide
Copy, list, and retrieve files on tape tar, cpio, or pax Chapter 51
or diskette
root (/) – slice 0 This file system contains the At regular intervals such as weekly
kernel and possibly the or daily
/var directory. The /var
directory might include
frequently modified files
such as mail and
accounting files.
/export/home – slice 7 This file system contains the More often than root (/) or /usr,
directories and perhaps as often as once a day,
subdirectories of all users depending on your site’s needs
on the standalone system.
root (/) – slice 0 This file system Once a day to once a month depending
contains the kernel and on your site’s needs.
executables.
If you frequently add and remove users
and systems on the network, you have to
change configuration files in this file
system. In this case, you should do a full
backup of the root (/) file system at
intervals between once a week and once a
month.
If your site keeps user mail in the
/var/mail directory on a mail server,
which client systems then mount, you
might want to back up root (/) daily. Or,
backup the /var directory, if it is a
separate file system.
/export – slice 3 This file system can Once a day to once a month, depending
contain the kernel and on your site’s needs.
executables for diskless
Because the information in this file
clients.
system is similar to the server’s root
directory in slice 0, the file system does
not change frequently. You need to back
up this file system only occasionally,
unless your site delivers mail to client
systems. Then, you should back up
/export more frequently.
/usr – slice 6, /opt An optional file system Once a day to once a month, depending
generally used to store on your site’s needs.
non-system software.
These file systems are fairly static and
need to be backed up once a week to
once a month.
Full Copies a complete file All data is in one place Requires large numbers
system or directory of backup tapes that
take a long time to
write. Takes longer to
retrieve individual files
because the drive has to
move sequentially to the
point on the tape where
the file is located. You
might have to search
multiple tapes.
Incremental Copies only those files Easier to retrieve small Finding which
in the specified file changes in file systems incremental tape
system that have contains a file can take
changed since a time. You might have to
previous backup go back to the last full
backup.
1. Identify the file Identify which file systems need to be “Planning Which File
systems to back up backed up on a daily, weekly, or Systems to Back Up”
monthly basis. on page 661
2. Determine the type of Determine the type of backup you “Choosing the Type of
backup need for the file systems at your site. Backup” on page 663
5. (Optional) Restore the Restoring the root (/) or /usr file “How to Restore the root
root (/) or /usr file system is more complicated than (/) and /usr File Systems”
system restoring a non critical file system. You on page 708
need to boot from a local CD or from
the network while these file systems
are being restored.
Term Definition
Incremental backup Copies only those files in the specified file system that have
changed since a previous backup. Incremental backup types
include the following:
■ Daily, cumulative – Copies a day’s worth of file changes
on Monday. Then, overwrites Monday’s backup with file
changes from Tuesday, Wednesday, and so on.
■ Daily, incremental – Copies a day’s worth of file changes
so that you have distinct tapes of Monday’s changes,
Tuesday’s changes, and so on.
■ Weekly cumulative – Copies the files that have changed
during the week and includes the previous week’s file
changes.
■ Weekly incremental – Copies the files that have changed
during the week since the previous weekly backup.
To restore different versions Do daily incremental This schedule saves all files
of files (for example, file backups every working day modified that day, as well as those
systems that are used for files still on disk that were modified
Do not reuse the same tape
word processing) since the last backup of a lower
for daily incremental
level. However, with this schedule,
backups
you should use a different tape each
day because you might otherwise
be unable to restore the needed
version of the file.
For example, a file that changed on
Tuesday, and again on Thursday,
goes onto Friday’s lower-level
backup appearing as it did
Thursday night, not Tuesday night.
If a user needs the Tuesday version,
you cannot restore it unless you
have a Tuesday backup tape (or a
Wednesday backup tape). Similarly,
a file that is present on Tuesday and
Wednesday, but removed on
Thursday, does not appear on the
Friday lower-level backup.
To back up a number of file Consider staggering the This way you’re not doing all level
systems on the same server schedule for different file 0 backups on the same day.
systems.
To minimize tapes Increase the level of Only changes from day to day are
incremental backups that saved on each daily tape.
are done across the week.
Put each day’s and week’s To do so, use the no rewind option
incremental backups onto of the ufsdump command, such as
the same tape. specifying /dev/rmt/0n.
In the preceding example, you could have used other numbers in the 1–9 range to
produce the same results. The key is using the same number Monday through
Thursday, with any lower number on Friday. For example, you could have specified
levels 4, 4, 4, 4, 2 or 7, 7, 7, 7, 5.
In the preceding example, you could have used the sequence 6, 7, 8, 9 followed by 2,
or 5, 6, 7, 8 followed by 3. Remember, the numbers themselves have no defined
meaning. You attribute meaning by ordering them in a specified sequence, as
described in the examples.
1st of Month 0
Week 1 9 9 9 9 5
Week 2 9 9 9 9 5
Week 3 9 9 9 9 5
Week 4 9 9 9 9 5
The following table shows how the contents of the tapes can change across two weeks
with the daily cumulative, weekly cumulative schedule. Each letter represents a
different file.
If you need to restore a complete file system, you need the following tapes:
■ The level 0 tape
■ The most recent Friday tape
■ The most recent daily tape since the last Friday tape, if any
1st of Month 0
Week 1 9 9 9 9 3
Week 2 9 9 9 9 4
Week 3 9 9 9 9 5
Week 4 9 9 9 9 6
The following table shows how the contents of the tapes can change across two weeks
with the daily cumulative, weekly incremental backup schedule. Each letter represents
a different file.
If you need to restore a complete file system, you need the following tapes:
■ The level 0 tape
■ All the Friday tapes
■ The most recent daily tape since the last Friday tape, if any
1st of Month 0
Week 1 3 4 5 6 2
Week 2 3 4 5 6 2
Week 3 3 4 5 6 2
Week 4 3 4 5 6 2
The following table shows how the contents of the tapes can change across two weeks
with the daily incremental, weekly cumulative schedule. Each letter represents a
different file.
If you need to restore the complete file system, you need the following tapes:
■ The level 0 tape.
■ The most recent Friday tape.
■ All the daily tapes since the last Friday tape, if any.
1st Monday 9 A
1st Tuesday 9 B
1st Wednesday 5 C
1st Thursday 9 D
1st Friday 9 E
1st Saturday 5 F
2nd Monday 9 G
2nd Tuesday 9 H
2nd Wednesday 5 I
2nd Thursday 9 J
2nd Friday 9 K
2nd Saturday 5 L
3rd Monday 9 M
3rd Tuesday 9 N
3rd Wednesday 5 O
3rd Thursday 9 P
3rd Friday 9 Q
3rd Saturday 5 R
4th Monday 9 S
4th Tuesday 9 T
4th Wednesday 5 U
4th Thursday 9 V
4th Friday 9 W
4th Saturday 5 X
With this schedule, you use 4n tapes, the number of tapes needed for 4 full backups of
the root (/), /usr, /export, and /export/home file systems. Also, you need 24
additional tapes for the incremental backups of the /export/home file systems. This
schedule assumes that each incremental backup uses one tape and that you save the
tapes for a month.
This chapter describes the procedures for backing up file systems by using the
ufsdump command.
For information on these procedures, see “Backing Up Files and File System (Task
Map)” on page 677.
For detailed information on the ufsdump command syntax, options, and arguments,
see Chapter 50.
1. Prepare for file system Identify the file systems, the type of “Preparing for File System
backups backup, and the tape device to be used Backups” on page 678
for the backups.
2. Determine the number Determine the number of tapes that “How to Determine the
of tapes needed to back are needed for a full backup of a file Number of Tapes Needed
up a file system system. for a Full Backup”
on page 679
677
Task Description For Instructions
3. Back up file systems Perform a full backup of file systems “How to Backup a File
to get baseline copies of all files. System to Tape”
on page 680
Perform an incremental backup of file
systems based on whether keeping
copies of files that have changed on a
daily basis is important at your site.
This section describes two other tasks you might need to perform before you back up
file systems:
■ Finding the names of file systems to back up
■ Determining the number of tapes that are needed for a full backup
2. Look in the mount point column for the name of the file system.
3. Use the directory name listed in the mount point column when you back up
the file system.
3. Divide the estimated size by the capacity of the tape to see how many tapes you
need.
For a list of tape capacities, see Table 46–5.
Note – Use the nisbackup command to back up an NIS+ master server. For
information on using this command, see System Administration Guide: Naming and
Directory Services (FNS and NIS+).
4. If you need to back up file systems to a remote tape drive, follow these steps:
b. On the tape server, verify that the host added to the /.rhosts file is
accessible through the name service.
8. If prompted, remove the tape and insert the next tape volume.
9. Label each tape with the volume number, dump level, date, system name, disk
slice, and file system.
For example:
# init 0
ok boot -s
# ufsdump 0ucf /dev/rmt/0 /
DUMP: Date of this level 0 dump: Tue Oct 07 16:23:08 2003
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Writing 63 Kilobyte records
DUMP: Estimated 296644 blocks (144.85MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 296224 blocks (144.64MB) on 1 volume at 424 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Tue Oct 07 16:23:08 2003
# ufsrestore tf /dev/rmt/0
2 .
3 ./lost+found
3776 ./usr
7552 ./var
11328 ./export
15104 ./export/home
18880 ./etc
22656 ./etc/default
22657 ./etc/default/sys-suspend
22673 ./etc/default/cron
22674 ./etc/default/devfsadm
22675 ./etc/default/dhcpagent
22676 ./etc/default/fs
22677 ./etc/default/inetinit
22678 ./etc/default/kbd
22679 ./etc/default/mpathd
22680 ./etc/default/nfslogd
22681 ./etc/default/passwd
.
.
.
# (Press Control-D to bring system to run level 3)
For information on the procedures associated with creating UFS snapshots, see “Using
UFS Snapshots (Task Map)” on page 687.
1. Create a UFS snapshot Create a read-only copy of a file “How to Create a UFS
system by using the fssnap Snapshot” on page 690
command.
2. Display UFS snapshot Identify UFS snapshot information “How to Display UFS
information such as the raw snapshot device. Snapshot Information”
on page 691
687
Task Description For Instructions
5. (Optional) Restore Restore the UFS snapshot the same “How to Restore a
data from a UFS way as you would restore data by Complete File System”
snapshot using the ufsrestore command. on page 705
When the fssnap command is run, it creates a virtual device and a backing-store file.
You can back up the virtual device, which looks and acts like a real device, with any of
the existing Solaris backup commands. The backing-store file is a bitmap file that
contains copies of presnapshot data that has been modified since the snapshot was
taken.
This table describes specific differences between UFS snapshots and Instant Image.
Size of the backing-store file depends on how Size of the backing-store file equivalent equals
much data has changed since the snapshot the size of the entire file system being copied
was taken
Does not persist across system reboots Persists across system reboots
Works on UFS file systems Cannot be used with root (/) or /usr file
systems
Available starting with the Solaris 8 1/01 Part of Sun StorEdge products
release
2. Make sure that the file system has enough disk space for the backing-store file.
# df -k
3. Make sure that a backing-store file of the same name and location does not
already exist.
# ls /backing-store-file
Note – The backing-store file must reside on a different file system than the file
system that is being captured using UFS snapshots.
The following example shows how to limit the backing-store file to 500 Mbytes.
# fssnap -F ufs -o maxsize=500m,bs=/scratch/usr.back.file /export/home
/dev/fssnap/1
Note – Use the UFS file system-specific fssnap command to view the extended
snapshot information as shown in the following examples.
The backing-store file occupies disk space until the snapshot is deleted, whether you
use the -o unlink option to remove the backing-store file or you delete the file
manually.
4. (Optional) If you did not use the -o unlink option when you created the
snapshot, manually delete the backing-store file.
# rm /file-system/backing-store-file
The virtual device that contains the UFS snapshot acts as a standard read-only device.
So, you can back up the virtual device as if you were backing up a file system device.
If you are using the ufsdump command to back up a UFS snapshot, you can specify
the snapshot name during the backup. See the following procedure for more
information.
For example:
# /usr/lib/fs/ufs/fssnap -i /usr
Snapshot number : 0
Block Device : /dev/fssnap/0
Raw Device : /dev/rfssnap/0
Mount point : /usr
Device state : idle
Backing store path : /var/tmp/snapshot3
Backing store size : 256 KB
Maximum backing store size : Unlimited
Snapshot create time : Wed Oct 08 10:38:25 2003
Copy-on-write granularity : 32 KB
This chapter describes how to use the ufsrestore command to restore files and file
systems that were backed up by using the ufsdump command.
For information on the procedures associated with restoring files and file systems, see
“Restoring Files and File System Backups (Task Map)” on page 697.
For information about other commands you can use to archive, restore, copy, or move
files and file systems, see Chapter 51.
For information about backing up and restoring file systems, see Chapter 46.
Prepare to restore files Identify the file systems or files to be “Preparing to Restore Files
and file systems restored, the tape device, and how you and File Systems”
will restore them. on page 698
Determine which tapes Refer to your backup tapes to find the “How to Determine Which
to use date of the last backup that contains Tapes to Use” on page 700
the file or file system that you need to
restore.
697
Task Description For Instructions
Restore the root (/) or Restoring the root (/) or /usr file “How to Restore the root
/usr file systems systems involves booting the system (/) and /usr File Systems”
from a local CD or the network. on page 708
Before you start to restore files or file systems, you need to know the following:
■ The tapes (or diskettes) you need to restore from
■ The raw device name on which you want to restore the file system
■ The type of tape device you will use
■ The device name (local or remote) for the tape device
When you restore individual files and directories, you should restore them to a
temporary location, such as the /var/tmp directory. After you verify the files, you can
move them to their proper locations. However, you can restore individual files and
directories to their original locations. If you do so, be sure you are not overwriting
newer files with older versions from the backup tape.
To avoid conflicts with other users, you might want to create and change to a
subdirectory, such as the/var/tmp/restore file, in which to restore the files.
Note – Do not restore files in the /tmp directory even temporarily. The /tmp directory
is usually mounted as a TMPFS file system. TMPFS does not support UFS file system
attributes such as ACLs.
2. Refer to your backup plan to find the date of the last backup that contains the
file or file system.
To retrieve the most recent version of a file, work backward through the
incremental backups from highest to lowest dump level and from most recent to
least recent date, unless the user requests otherwise.
3. (Optional) If you have online archive files, identify the correct media.
# ufsrestore ta archive-name ./path/filename ./path/filename
4. Insert the media that contains the files to be restored in the drive and verify the
correct media.
# ufsrestore tf /dev/rmt/n ./path/filename ./path/filename
Be sure to use the complete path for each filename. If a file is in the backup, its name
and inode number is listed. Otherwise, a message states that the file is not on the
volume.
The following example shows how to verify that the /etc/passwd file is on the
backup tape.
# ufsrestore tf /dev/rmt/0 ./etc/passwd
b. Change to a directory.
ufsrestore> cd directory-name
d. (Optional) Remove any directory or file from the list of files to be restored, if
necessary.
ufsrestore> delete filename
9. Type the volume number and press Return. If you have only one volume, type 1
and press Return.
Specify next volume #: 1
The files and directories in the list are extracted and restored to the current
working directory.
10. To maintain the mode of the current directory, enter n at the set owner/mode
prompt.
set owner/mode for ‘.’? [yn] n
You must wait while the ufsrestore command performs its final cleanup.
b. Check the list to be sure that all the files and directories you specified in the
list have been restored.
6. Type the volume number where files are located. Press Return.
Specify next volume #: 1
7. To maintain the mode of the current directory, type n and press Return at the set
owner/mode prompt.
set owner/mode for ’.’? [yn] n
b. Check the list to be sure that all the files and directories you specified in the
list have been restored.
The following example shows how to restore files by using a remote tape drive
/dev/rmt/0 on the system venus.
# ufsrestore xf venus:/dev/rmt/0 ./etc/hosts
Full restoration of a file system such as /export/home can take a lot of time. If you
have consistently backed up file systems, you can restore them to their state from the
time of the last incremental backup.
Note – You cannot use this procedure to restore the root (/) or /usr file systems. For
instructions on restoring these file systems, see “How to Restore the root (/) and /usr
File Systems” on page 708.
8. Insert the first volume of the level 0 tape into the tape drive.
10. Remove the tape and load the next level tape in the drive.
Always restore tapes starting with dump level 0 and continuing until you reach the
highest dump level.
11. Repeat Step 8 through Step 10 for each dump level, from the lowest to the
highest level.
16. Remove the last tape and insert a new tape that is not write-protected in the tape
drive.
19. Verify that the restored and mounted file system is available.
# ls mount-point
2. Add a new system disk to the system where the root (/) and /usr file systems
will be restored.
For a detailed description about adding a system disk, refer to Chapter 34 or
Chapter 35.
8. Remove the tape and load the next level tape in the drive.
Always restore tapes starting with dump level 0 and continuing from the lowest to
highest dump level.
19. Repeat steps 5 through 16 for the /usr file system, if necessary.
711
Detecting the End of Media
The ufsdump command writes a sequence of fixed-size records. When the ufsdump
command receives notification that a record was only partially written, it assumes that
it has reached the physical end of the media. This method works for most devices. If a
device is not able to notify the ufsdump command that only a partial record has been
written, a media error occurs as the ufsdump command tries to write another record.
Note – DAT devices and 8-mm tape devices detect end-of-media. Cartridge tape
devices and 1/2–inch tape devices do not detect end-of-media.
The ufsdump command automatically detects the end-of-media for most devices.
Therefore, you do not usually need to use the -c, -d, -s, and -t options to perform
multivolume backups.
The only times you need to use the end-of-media options are under the following
conditions:
■ The ufsdump command does not understand the way the device detects the
end-of-media.
■ You are going to restore the files on a SunOS 4. 1 system with the restore
command.
To ensure compatibility with the restore command, the size option can still force the
ufsdump command to go to the next tape or diskette before reaching the end of the
current tape or diskette.
Use the /etc/dumpdates file to verify that backups are being done. This verification
is particularly important if you are having equipment problems. If a backup cannot be
completed because of equipment failure, the backup is not recorded in the
/etc/dumpdates file.
If you need to restore an entire disk, check the /etc/dumpdates file for a list of the
most recent dates and levels of backups so that you can determine which tapes you
need to restore the entire file system.
Note – The /etc/dumpdates file is a text file that can be edited. However, edit it only
at your own risk. If you make changes to the file that do not match your archive tapes,
you might be unable to find the tapes (or files) you need.
Use this argument when the destination is not the default local tape drive
/dev/rmt/0. If you use the -f option, then you must specify a value for thedump-file
argument.
Note – The dump-file argument can also point to a file on a local disk or on a remote
disk. If done by mistake, this usage can fill up a file system.
You specify a tape device or a diskette on your system by using a device abbreviation.
The first device is always 0. For example, if you have a SCSI tape controller and one
QIC-24 tape drive that uses medium-density formatting, use this device name:
/dev/rmt/0m
When you specify a tape device name, you can also type the letter “n” at the end of
the name to indicate that the tape drive should not rewind after the backup is
completed. For example:
/dev/rmt/0mn
Use the “no-rewind” option if you want to put more than one file onto the tape. If you
run out of space during a backup, the tape does not rewind before the ufsdump
command asks for a new tape. For a complete description of device naming
conventions, see “Backup Device Names” on page 748.
Use the naming convention for the device that matches the operating system for the
system on which the device resides, not the system from which you run the ufsdump
command. If the drive is on a system that is running a previous SunOS release (for
example, 4.1.1), use the SunOS 4.1 device name (for example, /dev/rst0). If the
system is running Solaris software, use the SunOS 5.9 convention (for example,
/dev/rmt/0).
You can use the ufsdump and ufsrestore commands in a pipeline to copy a file
system by writing to standard output with the ufsdump command and reading from
standard input with the ufsrestore command. For example:
# ufsdump 0f - /dev/rdsk/c0t0d0s7 | (cd /home; ufsrestore xf -)
/dev/rdsk/c0t0d0s6
You can specify the file system by its mount point directory (for example,
/export/home), as long as an entry for it exists in the /etc/vfstab file.
For individual files or directories, type one or more names separated by spaces.
Note – When you use the ufsdump command to back up one or more directories or
files (rather than a complete file system), a level 0 backup is done. Incremental
backups do not apply.
filenames Identifies the files to back up. These arguments must always
come last, each separated by a space.
These options do a level 9 incremental backup to the default tape drive at its preferred
density.
Option Description
0–9 Dump level. Level 0 is for a full backup of the complete file
system or file systems specified by filenames. Levels 1–9 are for
incremental backups of files that have changed since the last
lower-level backup.
a archive-file Archive file. Specifies a file that stores (archives) a backup table of
contents. The file can be understood only by the ufsrestore
command. This command uses the table of contents to determine
whether a file to be restored is present in a backup file, and if so,
on which volume of the media the file resides.
d bpi Tape density. Specifies the tape density. Use this option only when
the ufsdump command cannot detect the end of the media.
f dump-file Dump file. Writes the files to the destination that is specified by
dump-file instead of the default device. If the file is specified as
user@system:device, the ufsdump command attempts to execute as
the specified user on the remote system. The specified user must
have a /.rhosts file on the remote system that allows the user
who is invoking the command on the local system to access the
remote system.
s size Size. Specifies the size of the backup media. For tapes, the size is
specified in feet. For diskettes, the size is specified by the number
of 1024–byte blocks.. Use this option only when the ufsdump
command cannot detect the end of the media.
W Warning with highlight. Shows all the file systems that appear in
the /etc/dumpdates file and highlights those file systems that
have not been backed up within a day. When you use this option,
all other options are ignored.
Note – The /etc/vfstab file does not contain information about how often to back
up a file system.
arguments Follows the option string with the arguments that match the
options. The option letters and their associated arguments
must be in the same order.
You must use one (and only one) of the ufsrestore command options described in
the following table.
Option Description
x [filenames] Extract. Selectively restores the files you specify by the filenames
argument. filenames can be a list of files and directories, each
separated by a space. All files under a specified directory are
restored unless you also use the h option. If you omit filenames or
enter “.” for the root directory, all files on all volumes of the
media (or from standard input) are restored. Existing files are
overwritten, and warnings are displayed.
t [filenames] Table of contents. Checks the files that are specified in the
filenames argument against the media. For each file, lists the full
file name and the inode number (if the file is found) or indicates
that the file is not on the “volume” (meaning any volume in a
multivolume backup). If you do not enter the filenames argument,
all files on all volumes of the media are listed (without
distinguishing on which volume files are located).
If you also use the h option, only the directory files that are
specified in filenames, not their contents, are checked and listed.
The table of contents is read from the first volume of the media,
or, if you use the a option, from the specified archive file. This
option is mutually exclusive with the x and r options.
Additional ufsrestore options are described in the following table. These options
are optional.
Option Description
a archive-file [filenames] Archive file. Takes the backup table of contents from the specified
archive-file instead of from the media (first volume). You can use
this option with the t, i, or x options to see if files are on the
media without having to mount any media. If you use this option
with the x and interactive (i) extract options, you are prompted
to mount the appropriate volume before extracting the file or
files.
f backup-file Backup file. Reads the files from the source indicated by
backup-file, instead of from the default device file /dev/rmt/0m.
If you use the f option, you must specify a value for backup-file.
When backup-file is of the form system:device, the ufsrestore
command reads from the remote device. You can also use the
backup-file argument to specify a file on a local or remote disk. If
thebackup-file consistes of ‘-’, the files are read from standard
input.
h Turns off directory expansion. Only the directory file you specify
is extracted or listed.
sn Skip. Skips to the nth backup file on the media (first volume).
This option is useful when you put more than one backup on a
single tape.
Option Description
ls [directory-name] Lists the contents of either the current directory or the specified
directory. Directories are marked by a / suffix. Entries in the
current list to be restored (extracted) are marked by an * prefix.
Inode numbers are shown if the verbose option (v) is used.
add [filename] Adds the current directory or the specified file or directory to the
list of files to extract (restore). If you do not use the h option, all
files in a specified directory and its subdirectories are added to
the list. All the files you want to restore to a directory might not
be on a single backup tape or diskette. You might need to restore
from multiple backups at different levels to get the latest versions
of all the files.
delete [filename] Deletes the current directory or the specified file or directory
from the list of files to extract (restore). If you do not use the h
option, all files in the specified directory and its subdirectories
are deleted from the list. The files and directories are deleted
only from the extract list you are building. They are not deleted
from the media or the file system.
extract Extracts the files in the list and restores them relative to the
current working directory on the disk. When you are asked for a
volume number for a single-volume backup, specify 1. If you are
doing a multiple tape or multiple diskette restore and restoring a
small number of files, start instead with the last tape or diskette.
pwd Displays the path name of the current working directory in the
backup hierarchy.
setmodes Lets you set the mode for files to be restored to match the mode
of the root directory of the file system from which they were
backed up. You are prompted with: set owner/mode for ’.’
[yn]? Type y (for yes) to set the mode (permissions, owner,
times) of the current directory to match the root directory of the
file system from which they were backed up. Use this mode
when you restore a complete file system.
Type n (for no) to leave the mode of the current directory
unchanged. Use this mode when you restore part of a backup to
a directory other than the directory from which the files were
backed up.
verbose Turns on or off the verbose option (which can also be typed as v
on the command line outside of interactive mode). When
verbose is on, the interactive ls command lists inode numbers,
and the ufsrestore command displays information on each
file as it is extracted.
This chapter describes how to copy UFS files and file systems to disk, tape, and
diskettes by using various backup commands.
The following table describes when to use the various backup commands.
725
TABLE 51–1 When to Use Various Backup Commands
Restore file systems from tape ufsrestore “How to Restore a Complete File
System” on page 705
Transport files to other systems pax, tar, or cpio “Copying Files and File Systems
to Tape” on page 731
tar No No Logical
dd Yes No Physical
The following sections describe the advantages and disadvantages of each command.
Also provided are step-by-step instructions and examples of how to use the
commands.
For more information about volcopy, see the volcopy(1M) man page.
The next section describes how to use the dd command to copy file systems between
disks.
Note – Do not use the dd command with variable-length tape drives without first
specifying an appropriate block size.
You can specify a device name in place of standard input or standard output, or both.
In this example, the contents of the diskette are copied to a file in the /tmp directory:
$ dd < /floppy/floppy0 > /tmp/output.file
2400+0 records in
2400+0 records out
The dd command reports on the number of blocks it reads and writes. The number
after the + is a count of the partial blocks that were copied. The default block size is
512 bytes.
The dd command syntax is different from most other commands. Options are specified
as keyword=value pairs, where keyword is the option you want to set and value is the
argument for that option. For example, you can replace standard input and standard
output with this syntax:
$ dd if=input-file of=output-file
To use the keyword=value pairs instead of the redirect symbols in the previous example,
you would type the following:
$ dd if=/floppy/floppy0 of=/tmp/output.file
11. Using a text editor, edit the destination disk’s /etc/vfstab file to reference the
correct device names.
For example, change all instances of c0t3d0 to c0t1d0.
Note – The installboot command is not needed for the destination disk because
the boot blocks are copied as part of the overlap slice.
17. Boot from the destination disk again and provide its system information, such as
host name, time zone, and so forth.
# boot diskn
18. After the system is booted, log in as superuser to verify the system information.
hostname console login:
The cpio command is an archiving program that copies a list of files into a single,
large output file. This command inserts headers between the individual files to
facilitate recovery. You can use the cpio command to copy complete file systems to
another slice, another system, or to a media device, such as a tape or diskette.
Because the cpio command recognizes end-of-media and prompts you to insert
another volume, it is the most effective command, other than ufsdump, to use to
create archives that require multiple tapes or diskettes.
With the cpio command, you frequently use the ls and find commands to list and
select the files you want to copy, and then to pipe the output to the cpio command.
-depth Descends the directory hierarchy and prints file names from the
bottom up.
4. Verify that the copy was successful by displaying the contents of the destination
directory.
# cd filesystem2
# ls
tar Use to copy files and ■ Available on most ■ Is not aware of file
directory subtrees to a UNIX operating system boundaries
single tape. systems ■ Full path-name
■ Public domain length cannot exceed
versions are readily 255 characters
available ■ Does not copy
empty directories or
special files such as
device files
■ Cannot be used to
create multiple tape
volumes
cpio Use to copy files, special ■ Packs data onto tape The command syntax is
files, or file systems that more efficiently than more difficult than the
require multiple tape the tar command tar or pax commands
volumes. Or, use when ■ Skips over any bad
you want to copy files
spots in a tape when
from SunOS 5.9 systems
restoring
to SunOS 4.0/4.1
■ Provides options for
systems
writing files with
different header
formats, such as (
tar, ustar, crc,
odc, bar), for
portability between
different system
types
■ Creates multiple
tape volumes
The tape drive and device name that you use depend on the hardware configuration
for each system. For more information about tape device names, see “Choosing Which
Media to Use” on page 747.
filenames Indicates the files and directories that you want to copy.
Separate multiple files with spaces.
The file names that you specify are copied to the tape, overwriting any existing
files on the tape.
4. Remove the tape from the drive. Write the names of the files on the tape label.
Note – The names of the files extracted from the tape must exactly match the names of
the files that are stored on the archive. If you have any doubts about the names or
paths of the files, first list the files on the tape. For instructions on listing the files on
the tape, see “How to List the Files on a Tape (tar)” on page 734.
filenames Indicates the files and directories that you want to copy.
Separate multiple files with spaces.
5. Remove the tape from the drive. Write the names of the files on the tape label.
All files in the directory are copied to the tape in the drive you specify, overwriting
any existing files on the tape. The total number of blocks that are copied is shown.
5. Remove the tape from the drive. Write the names of the files on the tape label.
Note – Listing the table of contents on a tape takes a long time because the cpio
command must process the entire archive.
Caution – The use of absolute path names can be dangerous because you might
overwrite existing files on your system.
"*file" Specifies that all files that match the pattern are copied to
the current directory. You can specify multiple patterns, but
each pattern must be enclosed in double quotation marks.
a. The local host name and optionally, the user name of the user doing the copy,
must appear in the remote system’s /etc/hosts.equiv file. Or, the user
doing the copy must have his or her home directory accessible on the remote
machine, and have the local machine name in $HOME/.rhosts.
For more information, see the hosts.equiv(4) man page.
tar cf Creates a tape archive, lists the files as they are archived,
and specifies the tape device.
6. Remove the tape from the drive. Write the names of the files on the tape label.
Use the tar command to copy UFS files to a single formatted diskette.
Use the cpio command if you need to copy UFS files to multiple formatted diskettes.
The cpio command recognizes end-of-media and prompts you to insert the next
diskette.
The following example shows how to retrieve an individual file from a diskette. The
file is extracted from the diskette and placed in the current working directory.
$ volcheck
$ tar xvf /vol/dev/aliases/floppy0 evaluation.doc
x evaluation.doc, 44032 bytes, 86 tape blocks
$ ls -l
For information on how to use the cpio command, see “How to Copy All Files in a
Directory to a Tape (cpio)” on page 737.
This chapter describes how to manage tape drives in the Solaris™ Operating System.
You can perform backups with diskettes, but doing so is time-consuming and
cumbersome.
The media that you choose depends on the availability of the equipment that supports
it and of the media (usually tape) that you use to store the files. Although you must do
the backup from a local system, you can write the files to a remote device.
747
The following table shows typical tape devices that are used for backing up file
systems. shows The storage capacity for each device depends on the type of drive and
the data being written to the tape.
Tape /dev/rmt/n
Diskette /vol/dev/rdiskette0/unlabeled
If you don’t specify the density, a tape drive typically writes at its “preferred” density.
The preferred density usually means the highest density the tape drive supports. Most
SCSI drives can automatically detect the density or format on the tape and read it
accordingly. To determine the different densities that are supported for a drive, look at
the /dev/rmt subdirectory. This subdirectory includes the set of tape device files that
support different output densities for each tape.
Also, a SCSI controller can have a maximum of seven SCSI tape drives.
To transport a tape to a system whose tape drive supports only a certain density,
specify a device name that writes at the desired density. The following table describes
how to specify different densities for a tape drive.
TABLE 52–4 Specifying Different Densities for a Tape Drive
The additional density values are shown in “Backup Device Names” on page 748.
The following example shows the status for an Exabyte tape drive (/dev/rmt/1):
$ mt -f /dev/rmt/1 status
Exabyte EXB-8200 8mm tape drive:
sense key(0x0)= NO Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
The following example shows a quick way to poll a system and locate all of its tape
drives:
$ for drive in 0 1 2 3 4 5 6 7
> do
> mt -f /dev/rmt/$drive status
> done
Archive QIC-150 tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
/dev/rmt/1: No such file or directory
/dev/rmt/2: No such file or directory
/dev/rmt/3: No such file or directory
/dev/rmt/4: No such file or directory
/dev/rmt/5: No such file or directory
/dev/rmt/6: No such file or directory
/dev/rmt/7: No such file or directory
$
For example:
$ mt -f /dev/rmt/1 retension
$
For example:
$ mt -f /dev/rmt/1 rewind
$
Be aware that hardware can fail in ways that the system does not report.
Always label your tapes after a backup. If you are using a backup strategy similar to
the strategies suggested in Chapter 46, you should indicate on the label “Tape A,”
“Tape B,” and so forth. This label should never change. Every time you do a backup,
make another tape label that contains the following information:
■ The backup date
■ The name of the machine and file system backed up
■ The backup level
■ The tape number (1 of n, if the backup spans multiple volumes)
■ Any information specific to your site
Store your tapes in a dust-free safe location, away from magnetic equipment. Some
sites store archived tapes in fireproof cabinets at remote locations.
755
archiving, files to multiple diskettes with cpio base directory (basedir), 282, 284
command (how to), 746 base64, 276
ASN.1 (Abstract Syntax Notation 1), 276 basedir keyword (administration files), 282,
AutoClient, definition, 121 284
autoconfiguration process, 353 becoming superuser (root), 48
autofs, 551 bin group, 71
automounting block disk device interface
and /home, 552 defined, 435
user home directories, 76 when to use, 436
blocks
bad, 626
boot, 646
B data, 648
backing up directory data, 626
a UFS snapshot with the tar command (how duplicate, 625
to), 694 free, 648
and restoring file systems indirect, 626
commands for, 660 logical size, 649
definition, 660 regular data, 628
choosing file systems to, 661 special inodes, 624
file systems to tape (how to), 680 boot block, 646
full and incremental, defined, 663 boot-from PROM setting, 183
preparing for (overview), 678 boot process
reasons for, 661 description (SPARC), 214
types of, 663 x86, 220
UFS snapshot (full) (how to), 694 boot types, description, 149
UFS snapshot information (incremental) booting
(how to), 694 a diskless client (how to), 137
backup a system, guidelines, 150
device names, 748 and PC BIOS, 214
full (level 0) backup to tape (how to), 680 for recovery purposes (how to)
record of incremental, 713 SPARC, 191
backup schedules x86, 204
daily cumulative, weekly cumulative from the network
backups, 670
SPARC, 189
daily cumulative, weekly incremental
x86, 203
backups, 671
interactively (how to)
daily incremental, weekly cumulative
SPARC, 188
backups, 672
x86, 201
examples, 670, 676
the Solaris Device Configuration Assistant
for a server, 673
(how to)
guidelines for, 666
x86, 199
recommendations, 667
to force a crash dump and reboot (how to)
using dump levels for, 668
SPARC, 194
bad block numbers, 626
x86, 210
bad inode number, 627
to run level 3
bad superblock, 634
SPARC, 186
banner command (PROM), 181
Index 757
cfsadmin command, 583, 591 copying (Continued)
changing files to diskette (overview), 743
default boot device files to diskette with tar command (how
SPARC, 183 to), 743
directory ownership for user accounts, 81 files to remote tape with tar and dd
file ownership for user accounts, 81 commands (how to), 741
primary USB audio device (how to), 422 files to tape with pax command (how
user ID numbers, 81 to), 736
user login names, 81 files to tape with tar command (how
user passwords to), 733
by user, 74 groups of files with cpio command
frequency of, 74, 86 (overview), 730
Users Tool, 82 individual files with cpio command
character special inodes, 624 (overview), 730
checking removable media information (how to), 234
and repairing file systems, 628 copying disks, with the dd command (how
CacheFS file systems (example of), 592 to), 727
CacheFS file systems (how to), 592 cp command, copying removable media
CD media (how to), 261 information (how to), 234
file system size, 623 cpio command, 737
file systems interactively, 631 copying directories between file systems
format and type of inodes, 624 (how to), 730
free blocks, 624 extract all files from tape (how to), 739
free inodes, 624 listing files on tape (how to), 738
inode list for consistency, 623 overview, 730
installed packages (example of), 323 retrieving specific files from tape (how
clean shutdown, 170 to), 740
clri command, 541 creating
collecting, CacheFS statistics (overview), 602 a data CD file system (how to), 262
configuring a full backup of UFS snapshot information
a SCSI controller with cfgadm command (how to), 693
(how to), 367
a packing list (how to), 596
a SCSI device with cfgadm command (how
a Solaris fdisk partition (how to), 499
to), 368
a UFS file system (how to), 556
a USB device(how to), 428
a UFS snapshot
connecting
example of, 690
a SCSI controller (how to), 370
a UFS snapshot (how to), 690
a USB device(how to), 429
an audio CD (how to), 265
controlling file and directory access, 69, 96
an incremental backup of UFS snapshot (how
copying
to), 694
a CD (how to), 267
disk slices and labeling a disk (how to)
all files in a directory to tape with cpio
SPARC, 488
command (how to), 737
x86, 505
complete file systems (dd), 727
file systems (overview), 556
directories between file systems with cpio
loopback file system (overview), 560
command (how to), 730
multi–session data CD (how to), 263
directories between file systems with cpio
swap file, 615
command (overview), 730
Index 759
disk (Continued) disks
connecting a system disk adding to a (overview)
x86, 496 SPARC, 486
creating disk slices and labeling a disk (how connecting a secondary disk (example of)
to) SPARC, 491
x86, 505 connecting a secondary disk (how to)
formatting a (overview), 458 SPARC, 487
repairing defective sectors, 480, 482 x86, 497
when to format (overview), 466 connecting a system disk (how to)
disk-based file systems, 537 SPARC, 486
disk controllers, 436 creating a file system on a new disk (how to)
disk label SPARC, 493
creating (overview), 471 x86, 506
description, 459 creating disk slices and labeling a disk
examining with prtvtoc command (how (example of)
to), 473 SPARC, 490
disk slices creating disk slices and labeling a disk (how
defined, 450 to)
determining which slices to use, 454 SPARC, 488
displaying information about determining if formatted (how to), 467
(overview), 469 displaying slice information (how to), 469
requirements for system configurations, 454 examining a disk label (how to), 473
diskettes formatting a (how to), 467
accessing on other systems (example of), 242 identifying on a system (how to), 464
archiving files to multiple with cpio labeling a (how to), 471
command (how to), 746 recovering a corrupted disk label (how
copying files to with tar command (how to), 475
to), 743 recovering a corrupted disk label
listing files on with tar command (how (overview), 474
to), 744 displaying
loading detailed information about packages
(example of), 322
with volume management, 249
device information, 357
loading with volume management (how
disk slice information (overview), 469
to), 248
environment variables, 91
mounting remotely (example of), 242
installed software information, 321
retrieving files from with tar command
packed files (example of), 595
(how to), 745
packed files (how to), 595
diskless client management commands
PCI device information (how to), 376
smosservice
removable media user (how to), 236
add OS services, 126
SCSI device configuration information (how
diskless clients
to), 366
adding OS services for (how to), 134
swap space, 614
booting (how to), 137
system configuration information, 354, 356
definition, 121
UFS snapshot information (how to), 691
deleting OS services (example of), 138
USB device information (how to), 408
deleting OS services (how to), 137
user mask, 96
preparing to add OS services (how to), 132
dmesg command, 357
Index 761
file systems (Continued) files (Continued)
description of administration commands for copying to media
commands, 541 (overview), 725
disk-based, 537 controlling access to, 69, 96
DOS, 537 copying to diskette with tar command (how
/export/home, 543 to), 743
FDFS, 541 copying to tape with cpio command (how
FIFOFS, 541 to), 737
finding types, 552 copying to tape with pax command (how
fixing, 633 to), 736
High Sierra, 537 copying to tape with tar command (how
ISO 9660, 537 to), 733
large, 565 /etc/default/fs, 552
making available (overview), 563 /etc/dfs/fstypes, 552
manual pages for, 542 in the /proc directory, 540
MNTFS, 544 listing on diskette with tar command (how
mount table, 549 to), 744
mounting NFS (how to), 573 listing on tape with cpio command (how
NAMEFS, 541 to), 738
network-based, 538 listing on tape with tar command (how
/opt, 544 to), 734
PCFS, 537 restoring interactively (how to), 701
preening, 633 restoring non-interactively (how to), 703
/proc, 544 retrieving from diskette with tar command
process, overview, 540 (how to), 745
PROCFS, overview, 540 retrieving from tape with cpio command
pseudo, overview, 538 (how to), 739, 740
reasons for inconsistencies, 622 retrieving from tape with tar command
restoring complete, 705 (how to), 734
restoring complete (how to), 705 sharing, 551
sharing, 551 verifying attributes for newly installed
SPECFS, 541 packages, 323
stopping all processes accessing (how finding
to), 576 file system name, 699
SWAPFS, 541 number of tapes for a full backup (how
TMPFS, 539 to), 679
types of, 537 PROM revision level, 181
UFS, 537 tape device name, 699
UNIX, 537 tape drive type, 750
unmounting (how to), 577 type of file system, 552
/usr, 543 fixing inconsistent file systems, 633
/var, 543 forget root password
which to back up, 661 SPARC, 193
why you back up, 661 x86, 207
files format.dat file
archiving to multiple diskettes with cpio creating an entry (how to), 478
command (how to), 746 creating an entry (overview), 477
changing ownership for user accounts, 81 keywords, 517, 520
Index 763
group file hot-plugging (Continued)
deleting user accounts and, 82 unconfiguring a SCSI controller (how
description, 83 to), 367
fields in, 86 HSFS, See High Sierra file system
group ID numbers, 71, 76, 77
groups
changing primary, 76
default, 77 I
description, 69, 76 I/O, direct, 546
description of names, 76 ID numbers
displaying groups a user belongs to, 76 group, 71, 76, 77
guidelines for managing, 76, 77 user, 71, 81
ID numbers, 71, 76, 77 identifying
name services and, 77 CD media (how to), 260
names devices, 355
description, 76 disks on a system (how to), 464
permissions setting for, 96 inconsistencies in file systems, 622
primary, 76, 77 incorrect . and .. entries, 627
secondary, 76, 77 incremental backup, 664, 713
storage of information for, 83, 86 example of, 682
UNIX, 76 indirect blocks, 626
groups command, 76 init command
description, 170
shutting down a standalone system, 175
init states, See run levels
H initialization files, system, 76
halt command, 170 inode list size, 623
High Sierra file system, 537 inode states, 624
history environment variable, 93 inodes, 646
/home (automounted), 552 bad number, 627
HOME environment variable, 93 block special, 624
/home file system, user home directories character special, 624
and, 75 checking format and type, 624
hot-plugging directory, 624
adding a SCSI device to a SCSI bus (how FIFO, 624
to), 370 link count, 625
adding PCI adapter card (how to), 377 number of bytes per, 651
configuring a SCSI controller (how to), 367 regular, 624
configuring a SCSI device (how to), 368 size, 626
connecting a SCSI controller (how to), 370 symbolic link, 624
disconnecting a SCSI controller with cfgadm installboot command, 494, 507
command (how to), 369 installing a boot block (how to)
overview, 361 SPARC, 494
PCI devices (overview), 376 x86, 507
removing a SCSI device (how to), 372 interactive
removing PCI adapter card (how to), 377 checking file systems, 631
replacing an identical device on a SCSI restore (how to), 701
controller (how to), 371 ISO 9660 file system, 537
L
L1-A keys, 190, 193
labelit command, 542 M
LANG environment variable, 93, 95, 96 mail aliases, user login names vs., 71
large files option, 565 MAIL environment variable, 92, 93
LC environment variables, 95, 96 maintaining tape drives, 752
level 0 backup, 668 MANPATH environment variable, 93
link count of inodes, 625 manual mounting, remote media (how to), 241
listing manual pages, for file systems, 542
files on a diskette with tar command (how maximums
to), 744 secondary groups users can belong to, 76
files on a tape with cpio command (how user ID number, 71
to), 738 user login name length, 70
files on a tape with tar command (how user password length, 74
to), 734 media was found message, 249
package information (example of), 322 memory storage (virtual), definition, 610
*LK* password, 82, 86 minimum free space, 650
Index 765
minimums N
user login name length, 70 name services
user password length, 74 groups and, 77
mkfile command, 615, 616 user accounts and, 70, 83
mkfs command, 542, 556 NAMEFS file system, 541
mkisofs command, create a data CD file names
system (how to), 262 group
MNTFS file system, 544 description, 76
mnttab file, 549 software package naming conventions, 282
monitor (PROM), 213 SUNW prefix, 282
mount command, 436 user login
mount point, definition, 547 changing, 81
mount table, 549 description, 69, 70
mountall command, 542 ncheck command, 542
mounting network-based file systems, 538
a file system with /etc/vfstab, 570 newfs command, 436, 556, 652
all files in vfstab file, 569 newgrp command, 76
diskettes on other systems (example of), 242 NFS
file systems automatically, 551 description, 551
loopback file systems (LOFS), 569 server description, 551
NFS file systems, 569 vfstab entry for, 569
NFS file systems (how to), 573 nfsd daemon
PCMCIA memory cards on other systems starting, 239
(example of), 243 verifying if running, 238
remote media (how to), 241 NIS
remote removable media manually (example user accounts and, 70, 83
of), 242 NIS+
removable media groups and, 77
automatic mounting compared to, 227 user accounts and, 70, 83
UFS file systems, 569 no media was found message, 249
UFS file systems (how to) noaccess user/group, 71, 87
noask_pkgadd administration file, 283, 319
without large files, 572
nobody user/group, 71, 87
USB mass storage devices with vold running
notifying users of system down time, 171
(how to), 412
NP password, 86
user home directories
automounting, 76
remote, 108
user home directories (how to), 109
O
using default options, 571
/opt directory, 544
mt command, 751
optimization type, 651
multiple versions of software packages, 282,
options, for ufsdump command, 716
284
OS server, description, 126
multiuser level, See run level 3
other (permissions setting), 96
Index 767
PKCS7 (Public Key Cryptography Standard pkgrm command (Continued)
#7), 276 overview, 280, 285, 324
/pkg directory, 321 prerequisites for using, 281
pkgadd command removing a package (how to), 324
-d option (device name), 317, 318, 319, 320, rm command vs., 282, 324
321 pkgtrans command, overview, 285
-s option (spool directory), 320, 321 PKI (Public Key Infrastructure) site, 279
adding a signed package, 315 playing musical CD or DVD, 235
adding packages (how to), 317 preening file systems, 633
using an HTTP URL, 319 preparing
alternate base directory and, 284 for backing up (overview), 678
bypassing user interaction, 283, 284 to restore files (overview), 698
overview, 280, 285 Primary Administrator role
-a option (administration file), 283, 284, 317, assuming (how to), 53
319 creating (how to), 53
prerequisites for using, 281 creating (overview), 52
signed packages and, 272 primary groups, 76, 77
spool directories and, 320 /proc directory, 540, 544
spool directories and (example of), 321 process file system (PROCFS), 540
pkgadm addcert command, See pkgadm PROCFS file system, overview, 540
command prodreg command, 272
pkgadm command checking dependencies between software
overview, 285 products (how to), 298
pkgadm addcert command identifying damaged software (how to), 299
importing a trusted certificate, 311 listing information about installed products
overview, 311 (how to), 293
pkgadm listcert command listing software attributes (how to), 296
displaying certificate information, 313 overview, 285, 293
output, 276 reinstalling damaged software (how to), 309
overview, 311 uninstalling damaged software (how
pkgadm removecert command to), 306
overview, 311 uninstalling software (how to), 302
removing a certificate, 314 Product Registry
pkgadm listcert command, See pkgadm adding software with, 288
command checking dependencies between software
pkgadm removecert command, See pkgadm products (how to), 298
command identifying damaged software (how to), 299
pkgchk command installing software with (how to), 290
overview, 285 listing information about installed products
using (example of), 323 (how to), 290, 293
pkginfo command listing software attributes (how to), 296
displaying all packages installed (example purpose, 288
of), 322 reinstalling damaged software (how to), 309
how to use, 321 removing software with, 288
overview, 282, 285 uninstalling damaged software (how
pkgparam command, overview, 285 to), 306
pkgrm command uninstalling software (how to), 302
caution, 282, 324 uninstalling software with (how to), 291
Index 769
restoring file systems (Continued) run level (Continued)
preparing to (overview), 698 default run level, 155
root and /usr (how to), 708 definition, 155
root and /usr (SPARC) (example of), 709 determining (how to), 156
root and /usr (x86) (example of), 710 s or S (single-user level), 156
type of tape drive, 699 booting to, 200
restoring files s or S (single-user state)
example of interactive restore, 702 booting to, 187
example of non-interactive restore, 704
from remote drive (example of), 705
interactively (how to), 701
non-interactively (how to), 703 S
restricting, removable media access (how /sbin/rc0 script, 161
to), 260 /sbin/rc1 script, 161
retrieving /sbin/rc2 script, 162
files from a tape with cpio command (how /sbin/rc3 script, 164
to), 739 /sbin/rc5 script, 164
files from diskette with tar command (how /sbin/rc6 script, 164
to), 745 /sbin/rcS script, 164
files from remote tape with tar and dd scheduling backups, 666
commands (how to), 742 SCSI devices
files from tape withtar command (how adding a SCSI device to a SCSI bus (how
to), 734 to), 370
specific files from tape with cpio command configuring with cfgadm command (how
(how to), 740 to), 368
revision level of PROM, 181 connecting with cfgadm command (how
rmmount.conf file, sharing removable media to), 370
drives (how to), 239 disconnecting with cfgadm command (how
Rock Ridge extension (HSFS file system), 537 to), 369
root (/) file system, 543 displaying with cfgadm command (how
root (superuser), becoming, 48 to), 366
root password, forget removing with cfgadm command (how
SPARC, 193 to), 372
x86, 207 replacing an identical device on a SCSI
run control scripts, 160 controller (how to), 371
adding (how to), 166 resolving a failed SCSI unconfigure operation
disabling (how to), 167 (how to), 375
starting and stopping services, 165 troubleshooting SCSI configuration
run level problem, 373
0 (power-down level), 156 unconfiguring with cfgadm command (how
1 (single-user level), 156 to), 367
2 (multiuser level), 156 SCSI disk drives, 478
3 (multiuser with NFS), 156 SCSI tape drives, 749
booting to, 186, 199 secondary disk
processes executed at, 159 connecting to the system (how to)
what happens when system is brought SPARC, 488
to, 159 x86, 498
6 (reboot level), 156 description, 454
Index 771
specifying a disk slice, 436, 438 swapadd command, 613
spool directories SWAPFS file system, 541
installing software packages to (example symbolic links, 624
of), 321, 323 sync command, 193, 194
installing software packages to (how to), 320 synchronize file systems with sync
staff group, 77 command, 194
standalone systems, definition, 121 synchronize the file systems with sync
starting command, 193
nfsd daemon, 239 syntax
volume management (how to), 233 fsck command, 636
starting and stopping services, 165 newfs, 652
state flag sysdef command, 356
fsck, 620 system accounts, 71
UFS file systems, 545 system disk
Stop-A keys, 190, 193 connecting (how to)
stopping SPARC, 486
a system for recovery purposes x86, 497
SPARC, 190 description, 454
a system for recovery purposes (how to) installing a boot block on (how to)
x86, 204 SPARC, 494
all processes for a file system (how to), 576 x86, 507
CacheFS logging, 605 system initialization files, 76
killing processes accessing removable media system shutdown commands, 170
(how to), 236 system types
volume management (how to), 233 appliance, 122
storage (virtual memory), definition, 610 AutoClient, 121
storage capacities (media), 664, 748 diskless client, 121
structure of cylinder groups, 645 guidelines for choosing, 122
stty command, 95 overview, 120
Sun software packages server, 120
adding (example of), 318 standalone system, 121
installing, 319
SunOS default file system, 543
SunSolve, trusted certificates and, 279
SUNW prefix, 282 T
superblock, 623, 634, 646 tape
superuser (root), becoming, 48 capacity, 715
superuser (root) password, forget characteristics, 715
SPARC, 193 copying all files in a directory with cpio
x86, 207 command (how to), 737
support for servers and clients, description, 119 listing files with tar command (how
swap command, 615 to), 734
swap file retrieving files from with cpio command
adding to vfstab, 613 (how to), 739
creating, 615 retrieving files from with tar command
displaying, 614 (how to), 734
removing from use, 617 retrieving specific files from with cpio
swap partition, definition, 610 command (how to), 740
Index 773
UIDs (Continued) USB devices (Continued)
assigning, 71 hot-plugging (overview), 415
definition, 71 keyboards and mouse devices, 401
large, 72 mounting mass storage with vold running
umask command, 96 (how to), 411
umount command, 542 names of, 399
umountall command, 542 overview, 398
unallocated directory blocks, 627 physical device hierarchy, 399
unallocated inodes, 624 power management, 403
unconfiguring removing a mass storage device
a SCSI controller with cfgadm command with vold running, 416
(how to), 367 removing a USB mass storage device
a USB device (how to), 428 without vold running, 417
UNIX file system, 537 resetting a USB device (how to), 430
UNIX groups, 76 Solaris USB Architecture (USBA), 400
unmounting storage devices, 406
file systems (how to), 577 supported, 392
USB mass storage devices with vold running troubleshooting audio device problems, 424
(how to), 412 unconfiguring a USB device (how to), 428
unsupported devices, 353, 354 unmounting mass storage with vold running
USB camera, adding (how to), 417 (how to), 411
USB devices user accounts, 69
acronyms, 398 description, 69
adding a USB camera (how to), 417 disabling/locking
adding a USB mass storage device passwords and, 82, 86
with vold running, 416 Users Tool, 82
without vold running, 416 guidelines for, 70, 76
audio ID numbers, 71, 81
adding a, 421 login names, 69, 70, 81
changing the primary device (how name services and, 70, 83
to), 422 setting up
device ownership, 425 information sheet, 102
identifying primary device (how to), 421 storage of information for, 70, 83
overview of, 419 user home directories
removing unused device links (how changing ownership of, 81
to), 414 customized initialization files in, 75, 82
bus description, 399 deleting, 82
cables for, 403 description, 69, 75
composite device, 399 mounting
compound device, 399 automounting, 76
configuring a USB device (how to), 428 remote, 108
connect a USB device (how to), 429 mounting (how to), 109
connect a USB device subtree (how to), 430 nonlocal reference to ($HOME), 75, 90
device classes, 400 sharing, 108
device nodes, 400 sharing (how to), 107
displaying device information (how to), 408 user ID numbers, 71, 81
drivers, 400 user initialization files
host controller and root hub, 402 Bourne shell, 88
Index 775
776 System Administration Guide: Basic Administration • April 2004