System Administration Guide, Volume I, Solaris 7
System Administration Guide, Volume I, Solaris 7
System Administration Guide, Volume I, Solaris 7
Note − The term "x86" refers to the Intel 8086 family of microprocessor chips, including the Pentium and
Pentium Pro processors and compatible microprocessor chips made by AMD and Cynix. In this document
the term "x86" refers to the overall platform architecture, whereas "Intel Platform Edition" appears in the
product name.
The following table describes the system administration topics found in System Administration Guide,
Volume I and System Administration Guide, Volume II.
System Administration Guide, Volume I System Administration Guide, Volume II
CHAPTER 1, Managing User Accounts and Groups "Print Management (Overview)" in System Administration
(Overview) Guide, Volume II
CHAPTER 3, Managing Server and Client Support "Working With Remote Systems (Tasks)" in System
(Overview) Administration Guide, Volume II
CHAPTER 5, Shutting Down and Booting a System "Managing Terminals and Modems (Overview)" in System
(Overview) Administration Guide, Volume II
CHAPTER 11, Guidelines for Using CDs and Diskettes "Managing System Security (Overview)" in System
(Overview) Administration Guide, Volume II
CHAPTER 16, Software Administration (Overview) "Managing System Resources (Overview)" in System
Administration Guide, Volume II
Preface iii
SPARC and x86 Information
This book provides system administration information for both SPARC and x86 systems. Unless otherwise
noted, information throughout this book applies to both types of systems. Table 1 summarizes the
differences between the SPARC and x86 system administration tasks.
Table 1 − SPARC and x86 System Administration Differences
Boot programs
• bootblk, the primary boot • mboot, the master boot record,
program, loads ufsboot. loads pboot.
• ufsboot, the secondary boot pboot, the Solaris partition boot
program loads the kernel. program, loads bootblk.
• bootblk, the primary boot
program, loads ufsboot.
System shutdown
• The shutdown and init • The shutdown and init
commands can be used without commands are used but require
additional operation intervention. operator intervention at the type
any key to continue prompt.
Disk controllers
• SCSI • SCSI and IDE
Diskette drives
• Desktop systems usually contain • Systems may contain two
one 3.5−inch diskette drive. diskette drives: a 3.5−inch and a
5.25 inch drive.
AaBbCc123 Book titles, new words or terms, or words Read Chapter 6 in User’s Guide. These are
to be emphasized called class options.
You must be root to do this.
Shell Prompt
Bourne shell and Korn shell prompt $
Preface v
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.
• It is assumed that the root path 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 path in the example.
• The examples in this book are for a basic SunOS 5.7 software installation without the Binary
Compatibility Package installed and without /usr/ucb in the path.
Caution − If /usr/ucb is included in a search path, it should always be at the end of the search path.
Commands like ps or df are duplicated in /usr/ucb with different formats and options from the
SunOS 5.7 commands.
CHAPTER 2, Setting Up and Provides step−by−step instructions for setting up user accounts and
Maintaining User Accounts and Groups groups with Admintool.
(Tasks)
CHAPTER 1
This chapter provides guidelines and planning information for managing user accounts and groups, and it
provides overview information about setting up user accounts and groups in a network environment. This
chapter also includes information about the files used to store user account and group information and
about customizing the user’s work environment.
This is a list of the overview information in this chapter.
• What Are User Accounts and Groups? @ 1−1
• Guidelines for Managing User Accounts @ 1−2
• Guidelines for Managing Groups @ 1−3
• Tools for Managing User Accounts and Groups @ 1−4
• Where User Account and Group Information Is Stored @ 1−6
• Customizing a User’s Work Environment @ 1−7
For instructions about how to manage users accounts and groups, see CHAPTER 2, Setting Up and
Maintaining User Accounts and Groups (Tasks).
Name Services
If you are managing user accounts for a large site, you may want to consider using a name service such as
NIS or NIS+. A name 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 service for
user accounts, users can move from system to system using the same user account without having
site−wide user account information duplicated in every system’s /etc files. Using a name service also
promotes centralized and consistent user account information.
It is helpful to establish a standard way of forming user names, and the 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 that 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 that still results in duplicate names, you can
use 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.
Note − Each new user name must be distinct from any mail aliases known to the system or to an NIS or
NIS+ domain. Otherwise, mail may be delivered to the alias rather than to the actual user.
User ID Numbers
Associated with each user name is a user identification (UID) number. The UID number identifies the user
name to any system on which the user attempts to log in, and it 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, and they are required for both
regular user accounts and special system accounts. Table 4 lists the UID numbers reserved for user
accounts and system accounts.
Table 4 − Reserved UID Numbers
Although UID numbers 0 through 99 are reserved, you can add a user with one of these numbers.
However, do not use them 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 1000 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
Name Service NIS name service Users with UIDs above 60000 can log in or use the su
Interoperability File−based name service command on systems running the Solaris 2.5 and
compatible versions, but their UIDs and GIDs will be set
to 60001 (nobody).
NIS+ name service Users with UIDs above 60000 are denied access on
systems running Solaris 2.5 and compatible versions and
the NIS+ name service.
Printed UIDs/GIDs OpenWindows File Large UIDs and GIDs will not display correctly if the
Manager OpenWindows(TM) File Manager is used with the
extended file listing display option.
100000 or greater
• The ps −l command displays a maximum five−digit UID so the printed
column won’t be aligned when they include a UID or GID larger than
99999.
262144 or greater
• Users in this category using the cpio command (using −H odc format) or
the pax −x cpio command to copy files will see an error message
returned for each file, and the UIDs and GIDs will be set to nobody in the
archive.
1000000 or greater
• Users in this category using the ar command will 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
Although user names are publicly known, passwords must be kept secret and known only to users. Each
user account should be assigned a password, which is a combination of six to eight letters, numbers, or
special characters. You can set a user’s password when you create the user account and have the user
change it when logging in to a system for the first time.
To make your computer systems more secure, ask users to change their passwords periodically. For a high
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. 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 will be disabled.
Home Directories
The home directory is the portion of a file system allocated to a user for storing private files. The amount
of space you allocate for a home directory depends on the kinds of files the user creates and the type of
work done. As a general rule, you should allocate at least 15 Mbytes of disk space for each user’s home
Note − Do not use system initialization files (/etc/profile, /etc/.login) to manage a user’s work
environment, because they reside locally on systems and are not centrally administered. For example, if
AutoFS is used to mount the user’s home directory from any system on the network, then you would have
to modify the system initialization files on each system to ensure a consistent environment when a user
moves from system to system.
When adding a user account, you must assign a primary group for a user or accept the default: staff (group
10). The primary group should already exist (if it doesn’t exist, specify the group by a GID number). User
names are not added to primary groups. If they were, the list might become too long. Before you can
assign users to a new secondary group, you must create the group and assign it a GID number.
Groups can be local to a system or can be managed through a name service. To simplify group
administration, you should use a name service like NIS+, which enables you to centrally manage group
memberships.
On remote and/or local Solstice(TM) Graphics monitor running Solstice AdminSuite 2.3
systems in a networked, AdminSuite(TM)’s User an X window such as CDE Administration Guide
name service (NIS, NIS+) and Group Manager or OpenWindows
environment (graphical user interface)
On a local system Admintool (graphical user Graphics monitor running CHAPTER 2, Setting Up
interface) an X window system such and Maintaining User
as CDE or OpenWindows Accounts and Groups
(Tasks)
The Solaris commands useradd and groupadd also let you set up users and groups on a local system;
however, the commands do not change name service maps or tables. Table 8 describes the Solaris
command used to manage user accounts and groups if you are not using Solstice AdminSuite or
Admintool.
Task If You Use This Name Service ... Then Use These Commands
Add a User Account NIS+ nistbladm
nisclient
NIS useradd
make
None useradd
NIS usermod
make
None usermod
NIS userdel
make
None userdel
NIS useradd −D
make
None useradd −D
NIS ypcat
sort
None awk
sort
NIS ypmatch
None grep
NIS groupadd
make
None groupadd
NIS groupmod
make
None groupmod
NIS groupdel
make
None groupdel
Administer Passwords
You can use Admintool for password administration, which includes 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, or specifying expiration dates and password aging information.
Note − To avoid confusion, the location of the user account and group information will be generically
referred to as a file rather than a file, 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.
Group information is stored in the group file.
For example:
kryten:x:101:100:Kryten Series 4000:/export/home/kryten:/bin/csh
password Contains an x, a placeholder for the encrypted password. The encrypted password
is stored in the shadow file.
uid Contains a user identification (UID) number that identifies the user to the system.
UID numbers for regular users should range from 100 to 60000. All UID numbers
should be unique.
gid Contains a group identification (GID) number that identifies the user’s primary
group. Each GID number must be a whole number between 0 and 60002 (60001
and 60002 are assigned to nobody and noaccess, respectively).
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.
login−shell Contains the user’s default login shell, which can be /bin/sh, /bin/csh or /bin/ksh.
Table 14 contains a description of shell features.
password May contain the following entries: a 13−character encrypted user password; the
string *LK*, which indicates an inaccessible account; or the string NP, which
indicates no password for the account.
lastchg Indicates the number of days between January 1, 1970, and the last password
modification date.
min Contains the minimum number of days required between password changes.
max Contains the maximum number of days the password is valid before the user is
prompted to specify a new password.
inactive Contains the number of days a user account can be inactive before being locked.
expire Contains the absolute date when the user account expires. Past this date, the user
cannot log in to the system.
group−password Usually contains an asterisk or is empty. The group−password field is a relic of earlier
versions of UNIX. If a group has a password, the newgrp command prompts users to
enter it. However, there is no utility to set the password.
gid Contains the group’s GID number. It must be unique on the local system, and should be
user−list Contains a list of comma−separated list of user names, representing the user’s secondary
group memberships. Each user can belong to a maximum of 16 secondary groups.
The Solaris system software provides default user initialization files for each shell in the /etc/skel directory
on each system, as shown in Table 13.
Table 13 − Default User Initialization Files
/etc/skel/local.cshrc
You can use these as a starting point and modify them to create a standard set of files that will provide the
work environment common to all users, or you can modify them to provide the working environment for
different types of users. See How to Customize User Initialization Files @ 2−2 for step−by−step
instructions on how to create sets of user initialization files for different types of users.
Shell Features
Table 14 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.
Table 14 − Basic Features of Bourne, C, and Korn Shells
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.
• Shell (local) variables − Variables that affect only the current shell. In the C shell, a set of these shell
variables have a special relationship to a corresponding set of environment variables. These shell
variables are user, term, home, and path. The value of the environment variable counterpart is
initially used to set the shell variable.
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 use the uppercase names with the setenv command to set both shell
and environment variables. You also have to use the export command to finish setting environment
variables. 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. Table 15 shows how to set environment
variables in a user initialization file.
Table 15 − Setting Environment Variables in a User Initialization File
If You Want to Set a User’s Environment Variables Then Add the Following Line to the User Initialization
for The ... File ...
C shell setenv VARIABLE value
Example:
setenv MAIL /var/mail/ripley
Variable Description
ARCH Sets the user’s system architecture (for example, sun4, i386). This variable can be set with
ARCH = ‘uname −p‘ (in Bourne or Korn shells) or setenv ARCH ‘uname
−p‘ (in C shell). There is no built−in behavior of the shell that depends on this variable.
It’s just a useful variable for branching within shell scripts.
CDPATH (or cdpath in Sets a variable used by the cd command. If the target directory of the cd command is
the C shell) specified as a relative path name, the cd command will first look 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.
HOME (or home in the Sets the path to the user’s home directory.
C shell)
LOGNAME Defines the name of the user currently logged in. The default value of LOGNAME is
automatically set by the login program to the user name specified in the passwd file. You
should only need to refer to (not reset) this variable.
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 the Sets the default shell used by make, vi, and other tools.
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 it does not find a definition in
either location, the terminal is identified as "dumb."
TERM (or term in the C Defines the terminal. This variable should be reset in /etc/profile or /etc/.login. When the
shell) 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.
Guidelines
Here are some guidelines for setting up efficient PATH variables:
• If security is not a concern, put the current working directory (.) first in the path. However, including
the current working directory in the path poses a security risk that you may want to avoid, especially
for superuser.
• Keep the search path as short as possible. The shell searches each directory in the path. If a command
is not found, long searches can slow down system performance.
• The search path is read from left to right, so you should put directories for commonly used commands
at the beginning of the path.
• Make sure directories are not duplicated in the path.
• Avoid searching large directories, if possible. Put large directories at the end of the path.
• Put local directories before NFS(TM) mounted directories to lessen the chance of "hanging" when the
NFS server does not respond and to reduce unnecessary network traffic.
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
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,
Table 17 describes the values for the LANG and LC environment variables.
Table 17 − Values for LANG and LC Variables
Value Locale
de German
fr French
it Italian
japanese Japanese
korean Korean
sv Swedish
tchinese Taiwanese
In a Bourne− or Korn−shell user initialization file, you would add the following:
LANG=DE; export LANG
You can also determine the umask value you want to set by using Table 18, which shows the file and
directory permissions that are created for each of the octal values of umask.
Table 18 − Permissions for umask Values
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
Example 1 − Example .profile File
[1 Defines the user’s shell search path.]PATH=$PATH:$HOME/bin:/usr/loc
al/bin:/usr/ccs/bin:.
[2 Defines the path to the user’s mail file.]MAIL=/var/mail/$LOGNAME
[3 Defines the environment variable to the user’s Usenet news server.
]NNTPSERVER=server1
[4 Defines the user’s search path for man pages.]MANPATH=/usr/share/ma
Example.cshrc File
Example 2 − Example .cshrc File
[8 Sets the user’s shell search path. ]set path=($PATH $HOME/bin /usr/
local/bin /usr/ccs/bin)
[9 Sets the path to the user’s mail file.]setenv MAIL /var/mail/$LOGNA
ME
[10 Sets the user’s Usenet news server. ]setenv NNTPSERVER server1
[11 Sets the user’s default printer. ]setenv PRINTER printer1
[12 Creates an alias for the history command (the user will need to ty
pe only h to run the history command). ]alias h history
[13 Sets the user’s default file creation permissions. ]umask 022
[14 Runs the site initialization file shown in Example Site Initial
ization File @ 1−9.]source /net/server2/site−init−files/site.login
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 the procedures for setting up and maintaining user accounts and groups.
This is a list of the step−by−step instructions in this chapter.
• How to Customize User Initialization Files @ 2−2
• How to Start Admintool @ 2−3
• How to Add a Group @ 2−4
• How to Add a New User Account @ 2−5
• How to Share a User’s Home Directory @ 2−6
• How to Mount a User’s Home Directory @ 2−7
• How to Modify a Group @ 2−1
• How to Delete a Group @ 2−2
• How to Modify a User Account @ 2−3
• How to Disable a User Account @ 2−4
• How to Change a User’s Password @ 2−5
• How to Change Password Aging for a User Account @ 2−6
• How to Delete a User Account @ 2−7
• How to Restart Solaris User Registration @ 2−3
• How To Disable User Registration @ 2−4
For overview information about Managing User Accounts and Groups, see CHAPTER 1, Managing
User Accounts and Groups (Overview).
The pound sign (#) is the Bourne shell prompt for the superuser account.
• Log in as superuser on the system console.
hostname console: root
Password: root_password
#
This method is not enabled by default. You must modify the /etc/default/login file to log in as
superuser on the system console. See "Securing Systems (Tasks)" in System Administration Guide,
Volume II for information on modifying this file.
1. Customize User Optional. Set up user initialization files (.cshrc, How to Customize User
Initialization Files .profile, .login), so you can provide new users Initialization Files @ 2−2
with consistent environments.
2. Add a Group Optional. To help administer users, add groups How to Add a Group @ 2−4
by using the Groups main window.
3. Add a User Account Add a user account by using Admintool’s Users How to Add a New User Account
main window. @ 2−5
4. Share the User’s Home Share the user’s home directory, so the directory How to Share a User’s Home
Directory can be remotely mounted from the user’s Directory @ 2−6
system.
5. Mount the User’s Home Manually mount the user’s home directory on How to Mount a User’s Home
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−33
Directory the user’s system by using the mount Directory @ 2−7
command.
User Name:
UID:
Primary Group:
Secondary Groups:
Comment:
Default Shell:
Mounting Method:
Mail Server:
Department Name:
Department Administrator:
Manager:
Employee Name:
Employee Title:
Employee Number:
Start Date:
user−type The name of a directory to store initialization files for a type of user.
3. Copy the default user initialization files into the directories you created for different types of
users.
# cp /etc/skel/local.cshrc /shared−directory/skel/user−type/.cshrc
# cp /etc/skel/local.login /shared−directory/skel/user−type/.login
# cp /etc/skel/local.profile /shared−directory/skel/user−type
/.profile
4. Edit the user initialization files for each user type and customize them based on your site’s
needs.
See Customizing a User’s Work Environment @ 1−7 for a detailed description on the ways to
customize the user initialization files.
5. Set the permissions for the user initialization files.
# chmod 744 /shared−directory/skel/user−type/.*
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−35
(Edit .cshrc file−see Example .cshrc File @ 1−2)
# chmod 744 /export/skel/enduser/.*
If you want to perform administration tasks on a system with an ASCII terminal as the console, use
Solaris commands instead. See useradd(1M) for more information.
2. Start Admintool.
$ admintool &
ExampleStarting Admintool
This is the Users main window, which enables you to manage user account
information.
ExampleAdding a Group
The following example adds a group named users that has a group ID of 101.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−37
The Add User window is displayed.
4. Fill in the Add User window.
If you need information to complete a field, click on the Help button to see field definitions for this
window.
5. Click on OK.
The list of user accounts displayed in the Users main window is updated to include the new user
account.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−39
Already shared Go to the verification step below.
# shareall −F nfs
# share
− /usr/dist ro ""
− /export/home/user−name rw ""
/export/home/user−name Is the name of the user’s home directory that will be shared. By
convention, /export/home contains user’s home directories; however, this
could be a different file system.
/export/home/user−name Is the name of the directory where the user’s home directory will be
mounted.
See CHAPTER 28, Mounting and Unmounting File Systems (Tasks) for more information about
adding an entry to the /etc/vfstab file.
4. Create the mount point for the user’s home directory.
# mkdir −p /export/home/user−name
5. Mount the user’s home directory.
# mountall
All entries in the current vfstab file (whose mount at boot fields are set to yes) are mounted.
6. Use the mount command to verify that the home directory is mounted.
# mkdir −p /export/home/ripley
# mountall
# mount
/ on /dev/dsk/c0t3d0s0 read/write/setuid/largefiles on Tue Jun 2 12:37:
36 1998
/usr on /dev/dsk/c0t3d0s6 read/write/setuid/largefiles on Tue Jun 2 12:
37:36 1998
/proc on /proc read/write/setuid on Tue Jun 2 12:37:36 1998
/dev/fd on fd read/write/setuid on Tue Jun 2 12:37:38 1998
/opt on /dev/dsk/c0t3d0s5 setuid/read/write/largefiles on Tue Jun 2 12:
37:38 1998
/tmp on swap read/write on Jun 2 12:37:39 1998
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−41
/export/home/ripley on venus:/export/home/ripley /read/write/remote on
Jun 2 12:37:40 ...
1. Modify a Group Modify a group’s name or the users in a group How to Modify a Group @ 2−1
by choosing Modify from the Edit menu in the
Groups window.
2. Delete a Group Delete a group by choosing Delete from the Edit How to Delete a Group @ 2−2
menu in the Groups window.
3. Modify a User Account Disable a User Account How to Disable a User Account
@ 2−4
If you want to temporarily disable a user
account, lock the user account from the
Password menu in the Modify window.
4. Delete a User Account Delete a user account by choosing Delete from How to Delete a User Account @
in the Edit menu in the Users window. 2−7
ExampleModifying a Group
The following example adds the users r2d2, holly, and kryten to the staff
group.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−43
The Modify window is displayed containing the selected user account entry.
4. Modify the user account.
If you need information to complete a field, click on the Help button to see field definitions for this
window. You can change any of the Account Security fields, which includes changing a password or
changing password aging. See the following tasks for detailed step−by−step instructions:
• How to Disable a User Account @ 2−4
• How to Change a User’s Password @ 2−5
• How to Change Password Aging for a User Account @ 2−6
5. Click on OK.
6. To verify that the modifications were made, double−click on the modified user account entry in
the Users window, then click on Cancel to close the window without making any modifications.
account.
1. Start Admintool, if it’s not already running. Select Users from the Browse menu, if necessary.
See How to Start Admintool @ 2−3 for more information.
2. Select the user account entry to be disabled.
3. Choose Modify from the Edit menu.
The Modify Users window is displayed containing the selected user account entry.
4. Choose Account Is Locked from the Password menu.
This selects the locked password status, which disables the user account.
5. Click on OK.
6. Verify that you have disabled the user account by attempting to log in with the disabled user
account.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−45
account.
If you need information about the password aging fields that are part of the Account Security
category, click on the Help button.
5. Click on OK.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−47
Inactive).
removed.
Note − Solaris User Registration is not invoked if the system administrator or user is logged in as
superuser.
If you choose to register, a copy of the completed form is stored in $HOME/.solregis/uprops. If you
choose to never register and change your mind later, you can start User Registeration by:
• Typing /usr/dt/bin/solregis at any command line prompt, or
• Clicking the Registration icon in the Application Manager’s desktop tools folder (Common Desktop
Environment desktop only)
See solregis(1) for more information.
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−49
Problem Description How to Resolve the Problem
The registration form failed to initialize: Web page Check for missing registration files.
window displays and requests user see system
administrator to resolve problem that prevents
registration setup.
The form could not be emailed: Dialog box displays and Check to see if email is configured correctly. Also check
requests user see system administrator to resolve problem. if CDE is on user’s system since it 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 displays and Check to see if the printer is configured correctly.
requests user to see system administrator to resolve Alternatively, the user can email form.
problem.
The form could not be saved: Dialog box displays and Check the user’s home directory. Required action depends
verifies that registration succeeded; however, the on the system’s configuration.
registration information cannot be recalled when updating
registration in the future.
You forgot your Solaris Solve login ID and password. Send a mail message describing the problem to
SolarisSolve@sun.com or see How to Restart Solaris
User Registration @ 2−3
You want to restart the registration process. How to Restart Solaris User Registration @ 2−3
CHAPTER 2 Setting Up and Maintaining User Accounts and Groups (Tasks) 2−51
Part 2 Managing Server and Client Support
This part provides instructions for managing server and client support in the Solaris environment. This part
contains these chapters.
CHAPTER 3, Managing Server and Provides a high−level overview about managing server and client
Client Support (Overview) support on a network. This chapter describes the different system
types for which you can add support and guidelines for choosing a
system type to use. It also describes what you can and can’t do to
manage system support with Solstice Host Manager.
CHAPTER 4, Managing Server and Provides step−by−step instructions for adding and maintaining
Client Support (Tasks) server and client support by using Solstice Host Manager.
CHAPTER 3
This chapter describes managing server and client support on a network, and it provides overview
information about each system configuration (referred to as a system type) supported in the Solaris
environment. This chapter also includes guidelines for selecting the appropriate system type to meet your
needs.
This is a list of the overview information in this chapter.
• Where to Find Server and Client Tasks @ 3−1
• What Are Servers and Clients? @ 3−2
• What Does Support Mean? @ 3−3
• Overview of System Types @ 3−4
• Guidelines for Choosing System Types @ 3−5
• Tools for Managing Server and Client Support @ 3−6
• What You Can Do With Host Manager @ 3−7
• What You Can’t Do With Host Manager @ 3−8
For step−by−step instructions about how to add and maintain server and client support, see CHAPTER 4,
Managing Server and Client Support (Tasks).
Servers
A server system has the following file systems:
• The root (/) and /usr file systems, plus swap space
• The /export, /export/swap, 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
Servers can also contain the following software to support other systems:
• Operating system (OS) services for diskless, JavaStation, or AutoClient systems that are running a
different release or are a different platform than the server
• Solaris CD image and boot software for networked systems to perform remote installations
• JumpStart(TM) directory for networked systems to perform custom JumpStart installations
Note − A standalone system requires sufficient disk space to hold the four necessary file systems.
A non−networked standalone system is a standalone system with all the characteristics listed above except
it is not connected to a network.
Diskless Clients
A diskless client has no disk and depends on a server for all its software and storage area. 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.
JavaStation Client
The JavaStation(TM) is a client designed for zero administration. This client optimizes Java(TM); the
JavaStation client takes full advantage of the network to deliver everything from Java applications and
services to complete, integrated system and network management. The JavaStation has no local
administration; booting, administration, and data storage are handled by servers.
AutoClient Systems
An AutoClient system is nearly identical to a diskless client in terms of installation and administration. It
has the following characteristics:
• Requires a minimum of a 100−Mbyte local disk for swapping and for caching its individual root (/)
file system and the /usr file system from a server
• Can be set up so that it can continue to access its cache when the server is unavailable
• Relies on a server to access other file systems and software applications
• Contains no permanent data, making it a field replaceable unit (FRU)
Centralized
System Type Administration Performance Disk Usage
Standalone System 4 1 4
Diskless Client 1 4 1
AutoClient System 1 2 2
JavaStation Client 1 1 1
Table 26 describes the server−client configurations that are supported by the Solstice AdminSuite 2.3
release of Host Manager.
Table 26 − Supported Server−Client Configurations
If You Have A ... You Can Add OS Services and Support For For the Following Releases ...
...
x86 server running SPARC clients[15 AutoClient systems are Solaris 2.3 release and compatible versions
SPARC server SPARC clients1 SunOS 4.1 release and compatible versions,
running the Solaris Solaris 2.3 release and compatible versions
2.3 release and
compatible versions
Note − The SunOS 4.1 release and compatible versions are only supported on SPARC systems with the
Sun4, Sun4c, and Sun4m platform groups.
Note − Previously added systems running Solaris 2.5 release or compatible versions must also have the
Solstice AdminSuite software installed for Host Manager to automatically update their system type.
The system type information is stored in the bootparams file in the local /etc files or a name service
database. Host Manager will either modify an existing bootparams entry or add a new one such as the
following for a Solaris standalone system named mars:
mars boottype=:st
You can add Solaris 7 or compatible OS services during the standalone system to OS server conversion.
Add OS Services
A Solaris OS server is a server that provides operating system (OS) services to support client systems. By
using Host Manager, you can add support for an OS server or convert a standalone system to an OS server.
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
7 release, you must add Sun4m/Solaris 7 OS services to the OS server. You would also still need to add
OS services to support SPARC Sun4c systems or x86 systems running the Solaris 7 release, because they
are different platform groups.
You must have access to the appropriate Solaris CD image to add OS services.
Note − Although Host Manager enables you to add support for diskless clients running the SunOS 4.0 and
compatible releases, you cannot add SunOS 4.0 and compatible OS services using Host Manager. You
must use the install4x commands to add OS services to an OS server, and then use Host Manager to
add support for the SunOS 4.0 and compatible client.
Note − A boot server and install server are typically the same system. However, if the system to be
installed is on a different subnet than the install server, a boot server is required on that subnet.
Queue Tasks
Host Manager enables you to queue tasks such as converting system types and adding OS services. Since
these tasks may require several minutes to process, Host Manager enables you to set up tasks to be
performed without requiring you to wait for each task to be completed. After setting up the tasks, choose
Save Changes from the File menu. Host Manager’s progress is displayed in the message bar located at the
bottom of the window as each task is processed.
Enable Scripts
When you add a Solstice AutoClient using Host Manager, you have the option to enable scripts to run on
the server before or after you add the AutoClient to the server, or run on the client before or after the cache
is configured on the AutoClient.
Limitation Workaround
Host Manager cannot automatically recognize all Use the Update System Type option from the File menu
previously added system types. the first time you use Host Manager. This option will
probe systems on the network and attempt to identify their
system types.
Host Manager can’t add SunOS 4.1 or compatible Mount a SunOS 4.1 or compatible CD image and add OS
services to an OS server. services by using the install4x command.
Host Manager can’t provide remote installation services Install systems running the SunOS 4.1 or compatible
for systems running the SunOS 4.1 release or compatible versions from the local CD−ROM drive.
versions.
Host Manager does not enable you to install patches on Use the admclientpatch command to set up a patch
existing clients and servers. (However, if you have used spool directory and to update existing servers and clients
the admclientpatch command to set up a patch spool with the latest patches.
directory, Host Manager will reference this spool
directory and add appropriate patches for all new hosts.)
This chapter describes how to set up and maintain server and client support using the Solstice Host
Manager.
This is a list of the step−by−step instructions in this chapter.
• How to Start Solstice Host Manager @ 4−1
• How to Update System Types @ 4−2
• How to Set Defaults for Adding Support @ 4−3
• How to Add Support for a Standalone System or OS Server @ 4−4
• How to Convert a System to an OS Server @ 4−5
• How to Add SunOS 4.0 and Compatible OS Services to an OS Server @ 4−6
• How to Add Solaris 7 OS Services to an OS Server @ 4−7
• How to Add Support for an AutoClient System @ 4−8
• How to Add Support for a Diskless Client @ 4−9
• How to Modify Support for a System @ 4−1
• How to Delete Support for a System @ 4−2
For overview information about managing server and client support, see CHAPTER 3, Managing Server
and Client Support (Overview). For more information on using Solstice Host Manager, see the Solstice
AdminSuite 2.3 Administration Guide.
1. Update System Types Optional. Make sure Host Manager recognizes How to Update System Types @
all the previously added system types. 4−2
2. Set Defaults for Adding Optional. Before you add support for several How to Set Defaults for Adding
Support clients, set up defaults for the Add window by Support @ 4−3
choosing Set Defaults from the Host Manager’s
Edit menu.
4. Add Support for an OS Add Support for an OS Server How to Add Support for a
Server Standalone System or OS Server
Add support for an OS server by choosing Add @ 4−4
from the Host Manager’s Edit menu.
5. Add OS Services to an OS Add SunOS 4.0 and Compatible OS Services How to Add SunOS 4.0 and
Server Compatible OS Services to an OS
If you need to add support for SunOS 4.0 and Server @ 4−6
compatible diskless clients, an OS server must
have the appropriate SunOS 4.x services
added.
6. Add Support for Client Add Support for an AutoClient System How to Add Support for an
Systems AutoClient System @ 4−8
Add support for an AutoClient system by
choosing Add from the Host Manager’s Edit
menu.
Note − If your name service is NIS+, you must be a member of the NIS+ admin group.
If You Are Using ... And ... Then Enter the Path ...
The Solaris CD as the Solaris The Solaris CD is managed by Volume /cdrom/cdrom0 or /cdrom/cdrom0/s0 or
CD image Management /cdrom/cdrom0/s2
8. Select the system’s architecture type and OS release from the OS Release menu.
The architecture type must match the system’s architecture and the OS release should match the
Note − If you are installing an OS server, you must allocate space in /export and /export/swap for the
desired number of clients.
If You Are Using ... And ... Then Enter the Path ...
The Solaris CD as the Solaris CD The Solaris CD is managed by /cdrom/cdrom0/s0 or /cdrom/cdrom0/s2
image Volume Management on SPARC platforms, /cdrom/cdrom0 on
x86 platforms
6. Specify the type of services you want to add and click on Add.
The OS service is added to the OS Services list and marked with a plus sign (+), which means it will
be added when you save changes. You can use the Delete button to delete an OS service from the list
before you save changes.
7. Click on OK on the Convert window.
8. Select Save Changes from the File menu to convert the system to an OS Server.
The converted system is displayed as an OS server in the Host Manager main window.
9. Verify the host type has been updated in the Host Manager main window.
Modules
Loaded Selected
[a] sun4.sun4c.sunos.4.1.2 0 0
[b] sun4.sun4.sunos.4.1.2 0 0
[c] sun4.sun4m.sunos.4.1.2 0 0
Modules
Loaded Selected
[a] sun4.sun4c.sunos.4.1.2 0 4
[b] sun4.sun4.sunos.4.1.2 0 3
[c] sun4.sun4m.sunos.4.1.2 0 1
Note − There is no command−line equivalent for adding SunOS 4.0 or compatible services to an OS
server.
14. Verify the SunOS 4.0 or compatible services have been added by listing the contents of the
/export/SunOS_4.x directory.
1. Start Solstice Host Manager from the Solstice Launcher and select the name service, if not done
already.
If You Are Using ... And ... Then Enter the Path ...
The Solaris CD as the Solaris CD The Solaris CD is managed by /cdrom/cdrom0/s0 or /cdrom/cdrom0/s2
image Volume Management on SPARC platforms, /cdrom/cdrom0 on
x86 platforms
6. Specify the type of services you want to add and click on Add.
The OS service is added to the OS Services list and marked with a plus sign (+), which means it will
be added when you save changes. You can use the Delete button to delete an OS service from the list
before you save changes.
7. Click on OK on the Add window.
8. Select Save Changes from the File menu to add services.
9. Verify that the OS services directories are available by listing the contents of the
/export/Solaris_2.7 directory.
1. Start Host Manager from the Solstice Launcher and select the name service, if not done already.
See How to Start Solstice Host Manager @ 4−1 for more information.
2. Choose Add from the Edit menu. The Add window is displayed. Note that the default system
type is Solaris Standalone.
3. Choose Solstice AutoClient from the System Type menu.
The Add window for a Solstice AutoClient system is displayed.
Caution − For the AutoClient system to work properly, it needs superuser access to its /export/root
directory. If Host Manager displays a message that the /export directory is already shared and has
different share options than required, you need to allow superuser access to the client root area before
the AutoClient system will function properly. The access mode for the client root is normally
rw=clientname, root=clientname.
If Host Manager displays a message that the /usr directory is already shared, it is because it tried to
share /usr read−only. If you have it shared with read−write permissions, then /usr is set up correctly,
and you do not have to make any modifications.
mars.
Note − This procedure assumes the system providing the services (the file server) has already been
configured as an OS server.
1. Start Solstice Host Manager from the Solstice Launcher and select the name service, if not done
already.
Caution − For the diskless client to work properly, it needs superuser access to its /export/root
directory. If Host Manager displays a message that the /export directory is already shared and has
different share options than required, you need to allow superuser access to the client root area before
the diskless client will function properly. The access mode for the client root is normally
rw=clientname, root=clientname.
If Host Manager displays a message that the /usr directory is already shared, it is because it tried to
share /usr read−only. If you have it shared with read−write permissions, then /usr is set up correctly,
and you do not have to make any modifications.
9. Verify that the system has been added as a diskless client in the Host Manager Main Window.
10. Boot the diskless client.
11. Provide the following system configuration information for the diskless client during the initial
boot process, if prompted.
• Geographic region
• Time zone
• Date and time
12. Create a superuser password when prompted.
neptune.
1. Modify Support for a Modify support for a system by choosing How to Modify Support for a
System Modify from the Host Manager’s Edit menu. System @ 4−1
2. Delete Support for a System Delete support for a system by choosing Delete How to Delete Support for a
from the Host Manager’s Edit menu. System @ 4−2
CHAPTER 6, Run Levels and Boot Files Provides information about run levels and boot files.
(Tasks)
CHAPTER 7, Shutting Down a System Provides step−by−step procedures for shutting down a system.
(Tasks)
CHAPTER 8, Booting a SPARC System Provides step−by−step procedures for booting a SPARC system.
(Tasks)
CHAPTER 9, x86: Booting a System Provides step−by−step procedures for booting an x86 system.
(Tasks)
CHAPTER 10, The Boot Process Provides a high−level overview of the boot process including a
(Reference) description of the platform−specific hardware used to boot SPARC
and x86 systems.
CHAPTER 5
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.
This is a list of overview information in this chapter.
• What’s New in Shutting Down and Booting a System? @ 5−1
• Where to Find Shutting Down and Booting Tasks @ 5−2
Terminology
This section describes the terminology used in shutting down and booting a system.
Add some other peripheral device How to Add a Peripheral Device @ 19−1
Change the number of pseudo devices "Examining and Changing System Information (Tasks)" in
System Administration Guide, Volume II
If You Are ... Change to This Run Level ... See ...
Turning off system power due to anticipated Run level 0, where it is safe to turn off CHAPTER 7, Shutting
power outage power Down a System (Tasks)
Changing kernel parameters in the /etc/system Run level 6 (reboot the system) CHAPTER 7, Shutting
file Down a System (Tasks)
Performing file system maintenance, such as Run level S (single−user mode) CHAPTER 7, Shutting
backing up or restoring system data Down a System (Tasks)
Repairing a system configuration file such as See When to Boot a System @ 5−8 N/A
/etc/system
Adding or removing hardware from the Reconfiguration boot (plus turning off SPARC: How to Connect a
system power when adding or removing Secondary Disk and Boot @
hardware) 23−2
Repairing an important system file which is See When to Boot a System @ 5−8 N/A
causing system boot failure
Booting the kernel debugger (kadb) to track Run level 0, if possible CHAPTER 7, Shutting
down a system problem Down a System (Tasks)
Recovering from a hung system and you want See When to Boot a System @ 5−8 N/A
to force a crash dump
See CHAPTER 7, Shutting Down a System (Tasks) for examples of shutting down a server or standalone
system.
Changing kernel parameters in Reboot the system to run level 3 SPARC: How to Boot x86: How to Boot a
the /etc/system file (multiuser mode with NFS a System to Run Level System to Run Level 3
resources shared) 3 (Multiuser State) @ (Multiuser State) @
8−1 9−1
Performing file system Use Control−d from run level S SPARC: How to Boot x86: How to Boot a
maintenance, such as performing to bring the system back to run a System to Run Level System to Run Level S
a backup or restoring system data level 3 S (Single−User State) (Single−User State)
@ 8−2 @ 9−2
Repairing a system configuration Interactive boot SPARC: How to Boot x86: How to Boot a
file such as /etc/system a System Interactively System Interactively
@ 8−3 @ 9−3
Adding or removing hardware Reconfiguration boot (plus SPARC: How to CHAPTER 24, x86:
from the system turning on system power after Connect a Secondary Adding a Disk
adding or removing hardware) Disk and Boot @ (Tasks)
23−2
Booting the kernel debugger Booting kabd SPARC: How to Boot x86: How to Force a
(kadb) to track down a system the System Using the Crash Dump and
problem Kernel Debugger Reboot the System @
( kadb ) @ 8−8 9−7
Repairing an important system Recovery boot x86: How to Boot a x86: How to Boot a
file which is causing system boot System for Recovery System for Recovery
failure Purposes @ 9−4 Purposes @ 9−4
Recovering from a hung system Recovery boot See example on x86: See example on x86:
and you want to force a crash How to Force a How to Force a
dump Crash Dump and Crash Dump and
Reboot the System @ Reboot the System @
9−7 9−7
See CHAPTER 8, Booting a SPARC System (Tasks) or CHAPTER 9, x86: Booting a System (Tasks)
for examples of booting a system.
This chapter provides guidelines for shutting down and booting a system and information about run levels
and boot files.
This is a list of the step−by−step instructions in this chapter.
• How to Determine a System’s Run Level @ 6−1
• How to Use a Run Control Script to Stop or Start a Service @ 6−2
• How to Add a Run Control Script @ 6−4
• How to Disable a Run Control Script @ 6−6
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 software environment has eight run levels, which are described in Table 35. The default run
level is specified in the /etc/inittab file as run level 3.
Table 35 − Solaris Run Levels
s or S Single−user state Single−user To run as a single user with all file systems
mounted and accessible.
1 Administrative state Single−user To access all available file systems with user
logins allowed.
3 Multiuser with NFS resources Multiuser For normal operations with NFS
shared resource−sharing available.
6 Reboot state Reboot To shut down the system to run level 0, and
then reboot to multiuser state (or whatever
level is the default in the inittab file).
0 Identifies the number of times at this run level since the last reboot.
Field Description
id A unique identifier for the entry.
action How the process specified in the process field is to be run. Possible values include:
initdefault, sysinit, boot, bootwait, wait, and respawn.
respawn If it does not exist. If the process already exists, continue scanning the inittab file.
/sbin/rcS Mounts and checks root (/), /usr, /var, and /var/adm file systems.
/sbin/rc2 Starts the standard system processes, bringing the system up into run
level 2 (multiuser mode).
/usr/lib/saf/sac −t 30 Starts the port monitors and network access for UUCP. This process
is restarted if it fails.
/usr/lib/saf/ttymon −g −h −p Starts the ttymon process that monitors the console for login
"‘uname −n‘ console login: " −T requests. This process is restarted if it fails.
terminal_type −d /dev/console −l
console The terminal_type on a SPARC system is sun
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 used to start and
stop processes for run level 2.
# ls /etc/rc2.d
K20spc@ S70uucp* S80lp*
K60nfs.server* S71rpc* S80spc@
K76snmpdx* S71sysid.sys* S85power*
K77dmi* S72autoinstall* S88sendmail*
README S72inetsvc* S88utmpd*
S01MOUNTFSYS* S73nfs.client* S89bdconfig@
S05RMTMPFILES* S74autofs* S91leoconfig*
S20sysetup* S74syslog* S92rtvc−config*
[KS][0−9][0−9]*
Files beginning with K are run to terminate (kill) a system process. Files beginning with S are run to start a
system process.
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 Table 39.
Note − Many of the system services and applications that are started at run level 2 depend on what
software is installed on the system.
Table 42 − The /sbin/rc3 Script
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 @ 7−4
• How to Shut Down a Server @ 7−5
• How to Shut Down a Standalone System @ 7−6
• How to Turn Off Power to All Devices @ 7−7
For overview information about the available run levels, see CHAPTER 6, Run Levels and Boot Files
(Tasks).
See CHAPTER 5, Shutting Down and Booting a System (Overview) for a complete list of system
administration tasks requiring a system shutdown.
init An executable that kills all active process Recommended for standalone systems when other
and syncs the disks before changing run users will not be affected. It provides a faster system
levels. shutdown because users are not notified of the
impending shutdown.
reboot An executable that syncs the disks and Not recommended; use the init command instead.
passes booting instructions to the uadmin
system call, which, in turn, stops the
processor.
halt An executable that syncs the disks and Not recommended because it doesn’t execute the
stops the processor. /etc/rc0 script, which stops all processes, syncs the
disks, and unmounts any remaining file systems.
All system devices include the CPU, the monitor, and external devices such as disks, tapes, and printers.
−ggrace−period Indicates a time (in seconds) before the system is shut down. The
default is 60 seconds.
Run level 3 (multiuser state with hostname console login: hostname console login:
remote resources shared)
3. Use the following table to verify the system is at the run level specified in the init command.
Run level 3 (multiuser state with remote hostname console login: hostname console login:
resources shared)
.
The system is down.
syncing file systems... [11] [10] [3] done
Type any key to continue
See How to Turn Off Power to All Devices @ 7−7 if you are bringing the system to run level 0 to turn
off power to all devices.
If You Are Shutting Down a Server ... If You Are Shutting Down a Standalone System ...
See How to Shut Down a Server @ 7−5. See How to Shut Down a Standalone System @ 7−6.
2. Turn off power to all devices after the system is shutdown. If necessary, also unplug the power
cables.
3. After power can be restored, use the following steps to turn on the system and devices.
a. Plug in the power cables.
b. Turn on the monitor.
c. Turn on disk drives, tape drives, and printers.
This chapter describes procedures for using the OpenBoot(TM) PROM monitor and procedures for
booting a SPARC system to different run levels.
This is a list of the step−by−step instructions in this chapter.
• SPARC: How to Switch to the ok Prompt @ 8−1
• SPARC: How to Find the PROM Release for a System @ 8−2
• SPARC: How to Change the Default Boot Device @ 8−3
• SPARC: How to Reset the System @ 8−4
• SPARC: How to Boot a System to Run Level 3 (Multiuser State) @ 8−1
• SPARC: How to Boot a System to Run Level S (Single−User State) @ 8−2
• SPARC: How to Boot a System Interactively @ 8−3
• SPARC: How to Boot a System for Recovery Purposes @ 8−4
• SPARC: How to Stop the System for Recovery Purposes @ 8−5
• SPARC: How to Force a Crash Dump and Reboot the System @ 8−7
• SPARC: How to Boot the System Using the Kernel Debugger ( kadb ) @ 8−8
For overview information about the boot process, see CHAPTER 10, The Boot Process (Reference).
disk[n] Identifies the boot−device value and in this case, n is the disk number.
Use the probe−scsi−all command if you need help identifying the disk number.
5. Verify the default boot device change by using the printenv command.
ok printenv boot−device
The self−test program, which runs diagnostic tests on the hardware, is executed and the system is
rebooted.
To run level S (single−user state) After performing some system maintenance task SPARC: Example
such as backing up a file system. At this level only Booting a System to Run
local file systems are mounted and users cannot log Level S (Single−User
into the system. State) @ 8−1
From local CD−ROM or the To repair an important system file that is preventing SPARC: Example
network for recovery purposes the system from booting successfully. This type of Booting a System for
boot is also used for installing (or upgrading) a new Recovery Purposes @
release of the operating system. 8−1
If a system is turned off, turning it on starts the multiuser boot sequence. The following procedures show
how to boot to different run levels from the ok PROM prompt.
Use the who −r command to verify that the system is brought to the specified run level.
See CHAPTER 6, Run Levels and Boot Files (Tasks) for a description of run levels.
Name of default directory for modules Provide an alternate path for the modules directory and
[/platform/‘uname −m‘/kernel /kernel /usr/kernel]: press Return.
Or, press Return to use the default modules directory
path.
root filesystem type [ufs]: Press Return to use the default root file system type: UFS
for local disk booting or NFS for diskless clients.
Enter physical name of root device Provide an alternate device name and press Return.
[physical_device_name]: Or, press Return to use the default physical name of the
root device.
3. If you are not prompted to answer the questions in Table 47, verify that you entered the boot
−a command correctly.
The network and an installation server or remote CD drive Use the following command:
are available
ok boot net −s
2. Mount the file system that has the file with an invalid entry.
# mount /dev/dsk/device−name /a
3. Change to the newly mounted directory.
# cd /a/directory
4. Set the terminal type.
# TERM=sun
# export TERM
5. Remove the invalid entry from the file using an editor.
# vi filename
6. Change to the root (/) directory.
# cd /
7. Unmount the /a directory.
# umount /a
8. Reboot the system.
# init 6
9. Verify the system boots to run level 3.
The login prompt is displayed when the boot process has finished successfully.
Booting the System ... Is Usually Done ... See an Example On ...
To run level 3 (multiuser state) After shutting down the system or performing x86: Example Booting a
some system hardware maintenance task. This is System to Run Level 3
the default boot level where all resources are (Multiuser State) @ 9−1
available and users can log into the system.
To run level S (single−user state) After performing some system maintenance task x86: Example Booting a
such as backing up a file system. At this level System to Run Level S
only some file systems are mounted and users (Single−User State) @
cannot log into the system. 9−1
Interactively After making temporary changes to the system x86: Example Booting a
file or the kernel for testing purposes. This type System Interactively @
of boot allows you to recover easily if there are 9−1
problems with the system file or kernel by
supplying an alternative pathname to these files
when prompted. Use the default settings for the
From local CD−ROM or the To repair an important system file that is x86: Example Booting a
network for recovery purposes preventing the system from booting successfully. System for Recovery
This type of boot is also used for installing (or Purposes @ 9−1
upgrading) a new release of the operating system.
Using kadb To troubleshoot system problems by using the x86: How to Force a Crash
kernel debugger and saving core dumps of the Dump and Reboot the
operating system. System @ 9−7
The following procedures use the reset button to restart the system. If your system does not have a reset
button, use the on/off switch to restart the system. You might be able to press the Control−Alt−Del keys to
interrupt system operation, depending upon the state of the system.
If you do not make a selection within 5 seconds, the system is automatically booted to run level 3. See
3. Verify the system boots to run level 3.
The login prompt is displayed when the boot process has finished successfully.
hostname console login:
If you do not make a selection within 5 seconds, the system is automatically booted to run level 3.
3. Answer the system prompts as described in Table 49.
Table 49 − Interactive Boot Procedure Steps
The Primary Boot Subsystem menu Select the Active Solaris slice as the boot device. Press
Enter default directory for modules: Provide an alternate path for the modules directory and
[/platform/i86pc/kernel /kernel /usr/kernel]: press Return, or press Return to use the default modules
directory path.
Name of system file [etc/system]: Provide the name of an alternate system file and press
Return, or press Return to use the default /etc/system file.
Enter
/dev/null as the file if your /etc/system file has been
damaged.
root filesystem type [ufs]: Press Return to use the default root file system type: UFS
for local disk booting or NFS for diskless clients.
Enter physical name of root device Provide an alternate device name and press Return, or
[physical_device_name]: press Return to use the default physical name of the root
device bootpath.
> 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
For x86 systems − You must be in text mode to enter the kernel debugger (kadb), so exit any window
system (CDE or Open Windows) first.
1. Press Control−Alt−d.
kadb[0]:
This chapter describes the hardware used for booting on SPARC and x86 systems and a conceptual
overview of the boot process on each platform.
This is a list of overview information in this chapter.
• SPARC: The Boot PROM @ 10−1
• SPARC: The Boot Process @ 10−2
• SPARC: The Boot Process Details @ 10−3
• x86: The PC BIOS @ 10−4
• x86: Boot Subsystems @ 10−5
• x86: The Boot Process @ 10−6
• x86: The Boot Process Details @ 10−7
For instructions on booting a system, see CHAPTER 8, Booting a SPARC System (Tasks) or CHAPTER
9, x86: Booting a System (Tasks).
For SPARC systems − Some older systems may require PROM upgrades before they will work with the
Solaris system software. Contact your local service provider for more information.
Kernel Initialization Phase The kernel initializes itself and loads the modules needed to
mount the root (/) file system.
init Phase The init process starts the run control scripts.
2. Then the PROM loads the primary boot program, bootblk, whose purpose is to load
the secondary boot program 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.
4. After ufsboot program is loaded, the ufsboot program loads the kernel.
Kernel Initialization 5. The kernel initializes itself and begins loading modules, using ufsboot to read the
files. When the kernel has loaded enough modules to mount the root file system, it 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.
Solaris Device Configuration There are two ways to access the Solaris Device Configuration Assistant
Assistant/Boot Diskette menus:
1. Use the Solaris Device Configuration Assistant Boot Diskette to boot
Current Boot Parameters Menu This menu appears when you boot from a disk with the Solaris operating
environment installed or if you want to install the Solaris release from the
Solaris installation CD or the network. In either case, this menu presents a list
of boot options.
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 default
selections. You can stop the boot process when each boot subsystem menu is displayed or you can let it
continue automatically.
The following section provides examples of each subsystem screen.
Examples of device identification during each phase are provided below. Device output varies based on
your system configuration.
> To perform a full scan to identify all system hardware, choose Contin
ue.
About navigation...
− The mouse cannot be used.
− If the keyboard does not have function keys or they do not respon
d,
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.
#######################
| | | | | |
0 20 40 60 80 100
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
].
The BIOS boot program loads and executes the master boot
record, mboot.
Boot Programs Phase mboot loads pboot, the Solaris boot partition, boot program.
Kernel Initialization Phase The kernel initializes itself and loads the modules needed to
mount the root (/) file system.
init Phase The init process starts the run control scripts.
2. The BIOS boot program tries to read the first physical sector from the boot
deviceeither a diskette or hard drive. 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. 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. pboot loads bootblk, the primary boot program, whose purpose is to load the
secondary boot program 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 timeout 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.
6. bootblk finds and executes the secondary boot program, boot.bin or ufsboot, in
the root file system. You have a 5−second timeout interval to interrupt the autoboot to start
the Configuration Assistant.
Kernel Initialization 8. The kernel initializes itself and begins loading modules, using the secondary boot
program (boot.binor ufsboot) to read the files. When the kernel has loaded enough
modules to mount the root file system, it 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.
CHAPTER 12, Using CDs From the Provides step−by−step instructions for using CDs from the
Command Line (Tasks) command line, plus instructions for starting and stopping Volume
Management.
CHAPTER 13, Formatting and Using Provides step−by−step instructions for formatting and using
Diskettes From the Command Line diskettes from the command line.
(Tasks)
CHAPTER 14, Using PCMCIA Memory Provides step−by−step instructions for formatting and using
Cards From the Command Line (Tasks) PCMCIA memory cards from the command line.
CHAPTER 15, How Volume Provides a high−level description of how the Solaris environment
Management Works (Reference) creates special mount points and symbolic links to provide easy
access to diskettes and CDs.
CHAPTER 11
This chapter provides general guidelines for using diskettes and CDs in the Solaris environment.
This is a list of overview information in this chapter.
• Where to Find Managing Removable Media Tasks @ 11−1
• Features and Benefits @ 11−2
• Comparison of Automatic and Manual Mounting @ 11−3
• What You Can Do With Diskettes and CDs @ 11−4
For information on using removable media with File Manager in the OpenWindows environment or the
Common Desktop Environment, see:
• OpenWindows User’s Guide
• Solaris Common Desktop Environment: User’s Guide
3 Determine the location of the media device. Volume Management automatically performs
many of tasks previously required to manually
mount and work with CDs and diskettes.
9 Become superuser.
If your system has more than one diskette or CD−ROM drive, see Table 57 for their access points.
Table 57 − Where to Access Diskettes and CDs
Media Device Access File Systems On... Access Raw Data On...
First diskette drive /floppy/floppy0 /vol/dev/aliases/floppy0
This chapter describes all the tasks required to use CDs in the Solaris environment from the command line.
This is a list of the step−by−step instructions in this chapter.
• How to Load a CD @ 12−2
• How to Examine the Contents of a CD @ 12−3
• How to Copy Information From a CD @ 12−4
• How to Find Out If a CD Is Still in Use @ 12−5
• How to Eject a CD @ 12−6
• How to Access CDs on Other Systems @ 12−7
• How to Make Local CDs Available to Other Systems @ 12−8
• How to Configure a System to Play Musical CDs @ 12−9
• How to Prepare a System for a New CD−ROM Drive @ 12−10
• How to Stop Volume Management @ 12−1
• How to Restart Volume Management @ 12−2
1. Load the CD Insert the CD into the CD−ROM drive. How to Load a CD @ 12−2
2. Examine Its Contents Optional. To examine the contents of the CD, How to Examine the Contents of a
look in the appropriate directory under /cdrom. CD @ 12−3
3. Copy Files or Directories Optional. Copy files or directories from the CD How to Copy Information From a
as you would from any other location in the file CD @ 12−4
system.
4. Is CD Still in Use? Optional. Before ejecting the CD, find out if it is How to Find Out If a CD Is Still
still in use. in Use @ 12−5
Using CD Names
When working with CDs, you can identify them by name or with a designator from Table 59 below. For
brevity, task descriptions use cdrom0, but you can replace this with either the CD name or a different
designator.
Table 59 − How to Identify CDs
CD Alternate Name
First CD−ROM drive cdrom0
How to Load a CD
Insert the CD. Shortly after the light stops flashing (about five to ten seconds), the CD is mounted to
/cdrom. To verify that the CD is mounted, perform the task How to Examine the Contents of a CD @
12−3.
Note − Most CDs are formatted to the ISO 9660 standard, which is portable, so most CDs can be mounted
by Volume Management. However, as described in CHAPTER 15, How Volume Management Works
(Reference), UFS CDs are not portable between architectures, so they must be used on the architecture for
which they were designed. If you are having trouble mounting a CD, particularly if it is an installation CD,
make sure its UFS file system is appropriate for your system’s architecture (check the label on the CD).
The ls command displays the contents of a mounted CD. If no contents are displayed, see How to
Load a CD @ 12−2.
2. Copy the files or directories.
A directory cp −r
Note that when a file or directory is copied from a CD into your file system, you become its owner, but it
retains the permissions it had on the CD:
−r−−r−−r−−
To overwrite it, you’ll need to change the permissions with the chmod command. See "Securing Files
(Tasks)" in System Administration Guide, Volume II for more information on using the chmod command.
The fuser command may not always identify all the killed processes. To be sure, run it again with the
−u option.
How to Eject a CD
1. Make sure the CD is not being used.
Remember, a CD is "being used" if a shell or an application is accessing any of its files or directories.
If you are not sure whether you have found all users of a CD (a shell hidden behind a desktop tool
may be accessing it), use the fuser command, as described in How to Find Out If a CD Is Still in
Use @ 12−5.
2. Eject the CD.
# eject cdrom0
local−mount−point The local directory onto which you will mount the remote CD.
This example mounts the CD named Solaris_2.7_sparc from the remote system mars onto the /cdrom
directory of the local system.
$ cd /net/mars
$ ls /cdrom
cdrom0 Solaris_2.7_sparc
$ su
Password: password
# mount −F nfs ro mars:/cdrom/Solaris_2.7_sparc /cdrom
# exit
$ ls /cdrom
Solaris_2.7_sparc
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not
running, only the grep nfsd line will appear.
3. Select an option from the following table.
These lines share any CD loaded into your system’s CD−ROM drive. You can, however, limit sharing
to a particular CD or series of CDs, as described in share(1M).
11. Remove write permissions from /etc/rmmount.conf.
# chmod 444 /etc/rmmount.conf
This step returns the file to its default permissions.
12. Load a CD.
The CD you now load, and all subsequent CDs, will be available to other systems. Remember to wait
until the light on the drive stops blinking before you verify this task.
To access the CD, the remote user must mount it by name, according to the instructions in How to
Access CDs on Other Systems @ 12−7.
13. Verify that the CD is indeed available to other systems by using the share command.
If the CD is available, its share configuration will be displayed. (The shared dummy directory will
also be displayed.)
# share
− /dummy ro "dummy dir to wake up NFS daemon"
− /Solaris_2.7_sparc ro ""
Add the following line under # Actions, before the cdrom action, as shown in the example below.
# Actions
action cdrom action_workman.so path/workman workman−options
path The directory in which you have placed the Workman software.
# Actions
action cdrom action_workman.so /usr/dist/exe/workman
action cdrom action_filemgr.so
action floppy action_filemgr.so
The /reconfigure file makes the Solaris environment check for the presence of any newly installed
peripheral devices when you power on or boot your system. After that, Volume Management locates
the new device and automatically manages it for you.
This chapter describes all the tasks required to format and use diskettes from the command line in the
Solaris environment. This is a list of the step−by−step instructions in this chapter.
• How to Format a UFS Diskette @ 13−3
• How to Place a UFS File System on a Diskette @ 13−4
• How to Format a DOS Diskette @ 13−5
• How to Load a Diskette @ 13−1
• How to Examine the Contents of a Diskette @ 13−2
• How to Copy or Move Information From a Diskette @ 13−3
• How to Copy or Move Information to a Diskette @ 13−4
• How to Find Out If a Diskette Is Still in Use @ 13−5
• How to Eject a Diskette @ 13−6
• How to Access Diskettes on Other Systems @ 13−7
• How to Make Local Diskettes Available to Other Systems @ 13−8
1. Load Unformatted Diskette Insert the diskette into the drive and enter the How to Load a Diskette @ 13−1
volcheck command.
2. Format the Diskette Format the diskette for UFS. How to Format a UFS Diskette @
13−3
3. Add a UFS File System UFS Only. Optional. To use the diskette for How to Place a UFS File System
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−151
files, add a UFS file system. To use for on a Diskette @ 13−4
characters, skip this step.
4. Eject the Diskette When finished formatting, always eject the How to Eject a Diskette @ 13−6
diskette, even if you are going to use it again
right away.
Note − Diskettes that are not named (that is, they have no "label") are assigned the default name of
noname.
Hardware Considerations
A Solaris system can format diskettes for use on both Solaris and DOS systems. However, the hardware
platform imposes some limitations. They are summarized in the table below.
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 platform cannot be used for UFS on an x86 platform, nor
By default, the diskette drive formats a diskette to a like density. In other words, 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
notunless you instruct it otherwise. You can tell a 1.44 Mbyte drive to format a diskette to, for instance,
720 Kbytes. You cannot, however, instruct a 720 Kbyte drive to format a diskette to 1.44 Mbyte. In other
words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.
To instruct a drive to format a diskette to a non−default density, use the fdformat command as
instructed in the following tasks, but use the appropriate density option from Table 62, below.
Table 62 − Density Options
To Format a Diskette With This In a Drive With This Default Use This Density Option to the fdformat
Density ... Density ... Command ...
2.88 Mbytes 2.88 Mbytes −E
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−153
720 Kbytes 1.44 Mbytes −D or −t dos −D
To view all the options to the fdformat command, either see fdformat(1) or enter fdformat −z. The
−z option displays all the options to the command.
If you don’t know the default density of your drive, begin the formatting process with the default setting
(that is, no density options) and observe the configuration message. It will look something like this:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy.
The confirmation message indicates the drive’s default density. For instance, in the example above, the
default density of the drive is 1.44 Mbytes. If the density is not what you expected, use Control−c to
escape the formatting process and start over.
convenience−options
−b label Names the diskette. label must be eight characters or less, upper or lower
case.
−z Lists all the options to the fdformat command, but does not format the
diskette.
Note − If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you
unless you include the −v option. With the −v option, fdformat will format the diskette, but the
verification will catch the error and notify you with the following message: fdformat: check diskette
density, I/O error
The fdformat command displays a confirmation message (unless you used the −f option),
indicating the type of formatting to be performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of
V’s appears beneath the dots. When the series stops, the formatting is complete.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−155
The diskette is now ready for raw character operations such as tar and cpio.
The following example performs the same job, but assigns the diskette the name myfiles:
$ fdformat −v −U −b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
The following example formats a 720Kbyte diskette on a 1.44 Mbyte drive, and names it myfiles:
$ fdformat −v −U −D −b myfiles
Formatting 720 KB in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
The newfs(1M) command displays a message asking you to confirm the creation of the file system.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−157
1. Quit File Manager.
File Manager automatically displays a formatting window when you insert an unformatted diskette.
Unfortunately, File Manager formatting is unreliable. To avoid the window, quit from File Manager.
If you prefer to keep File Manager open, quit the formatting window when it appears.
2. Make sure the diskette is not write−protected.
On both 3.5−inch and 5.25 inch diskettes, write−protection is controlled by a small tab in either the
lower left or lower right corner. If you can see through the square hole behind the tab, the diskette is
write−protected. If the hole is covered by the tab, the diskette is write−enabled. (If you need to eject
the diskette to examine it, simply type eject floppy in a shell.)
3. Insert the diskette.
Make sure the diskette is completely inserted. It must drop down into the drive.
4. Invoke formatting.
$ fdformat −v −U [density−options convenience−options]
−v Verifies whether the diskette was formatted correctly.
convenience−options
−b label Name for the diskette. label must be eight characters or less, upper or lower
case.
−z Lists all the options to the fdformat command, but does not format the
diskette.
Note − If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you
unless you include the −v option. With the −v option, fdformat will format the diskette, but the
verification will catch the error and notify you with the following message: fdformat: check diskette
The fdformat command displays a confirmation message, indicating the type of formatting to be
performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of
V’s appears beneath the dots. When the series stops, the formatting is complete and the diskette is
ready for use on a DOS system.
6. Run the volrmmount(1) command using the −i option to notify Volume Management that the
diskette is inserted.
$ volrmmount −i floppy0
Volume Management mounts the diskette under /floppy/floppy0.
1. Load the Diskette Insert the diskette into its drive and enter the How to Load a Diskette @ 13−1
volcheck command.
2. Examine Its Contents Optional. To examine the contents of the How to Examine the Contents of a
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−159
diskette, look in the appropriate directory under Diskette @ 13−2
/diskette.
3. Exchange Files Optional. Copy files or directories between the How to Copy or Move
diskette and your file system. Information From a Diskette @
13−3
4. Is Diskette Still in Use? Optional. Before ejecting the diskette, find out if How to Find Out If a Diskette Is
the diskette is still in use. Still in Use @ 13−5
5. Eject the Diskette When you finish, eject the diskette from its How to Eject a Diskette @ 13−6
drive.
If the diskette is not formatted, the "media was found" message is still
displayed, but the following error messages appear in the Console:
no media was found Volume Management did not detect a diskette. Make sure the diskette is
inserted properly and run volcheck(1) again. If unsuccessful, check the
diskette; it could be damaged. You can also try to mount the diskette
manually.
As described earlier, floppy0 is a symbolic link to the actual name of the diskette; in this case,
myfiles. If the diskette has no name but is formatted correctly, the system will refer to it as
unnamed_floppy.
If nothing appears under the /floppy directory, the diskette was either not mounted or is not formatted
properly. To find out, run the mount command and look for the line that begins with /floppy (usually
at the end of the listing):
/floppy/name on /vol/dev/diskette0/name ...
If the line does not appear, the diskette was not mounted. Check the Console for error messages.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−161
How to Copy or Move Information From a Diskette
Once you have inserted a diskette, you can access its files and directories just as you would those of any
other file system. The only significant restrictions are ownership and permissions. For instance, if you are
not the owner of a file on a diskette, you won’t be able to overwrite that file on the diskette. Or, if you
copy a file into your file system, you’ll be the owner, but that file won’t have write permissions (because it
never had them on the diskette); you’ll have to change the permissions yourself.
1. Make sure the diskette is formatted and mounted.
$ ls /floppy
floppy0 diskette−name
If the diskette is properly formatted and mounted, its name and the symbolic link will appear under
/floppy.
If nothing appears under the /floppy directory, the diskette is not mounted. See How to Load a
Diskette @ 13−1. The diskette might also need to be formatted. See How to Format a UFS Diskette
@ 13−3 or How to Format a DOS Diskette @ 13−5.
2. Copy the files or directories.
A directory cp −r
Copy a directory cp −r
The fuser command lists the processes that are currently accessing the CD that you specify.
# fuser −u [−k] floppy0
−u Displays the user of the diskette.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−163
ExampleFinding Out If a Diskette Is Still In Use
In the following example, the processes 6400c and 6399c are accessing the /floppy/floppy0 directory, and
the process owners are root and smith, respectively.
# fuser −u /floppy/floppy0
/floppy/floppy0: 6400c(root) 6399c(smith)
You can kill the processes individually (as superuser), or you can use the fuser command with the −k
option, which kills all the processes accessing that file system. The fuser command may not always
identify all the killed processes. To be sure, run it again with the −u option.
# fuser −u −k /floppy/floppy0
/floppy/floppy0: 6400c(root)Killed 6399c(smith)Killed
local−mount−point The local directory onto which you will mount the remote diskette.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−165
You can configure your system to share its diskettes; in other words, make any diskettes in those drives
available to other systems. Once your diskette drives are shared, other systems can access the diskettes
they contain simply by mounting them, as described in How to Access Diskettes on Other Systems @
13−7.
1. Become superuser.
2. Find out whether the NFS daemon (nfsd) is running.
# ps −ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd −a 16
root 14656 289 7 14:06:02 pts/3 0:00 grep nfsd
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not
running, only the grep nfsd line will appear.
3. Select an option from the following table.
When you start the NFS daemon, it will see this entry, "wake up," and notice the shared diskette drive.
Note that the comment (preceded by −d) is optional.
6. Start the NFS daemon.
# /etc/init.d/nfs.server start
7. Verify that the NFS daemon is indeed running.
# ps −ef | grep nfsd
root 14533 1 17 10:46:55 ? 0:00 /usr/lib/nfs/nfsd −a 16
root 14656 289 7 14:06:02 pts/3 0:00 /grep nfsd
8. Eject any diskette currently in the drive.
# eject floppy0
9. Assign root write permissions to /etc/rmmount.conf.
# chmod 644 /etc/rmmount.conf
10. Add the following lines to /etc/rmmount.conf.
# File System Sharing
share floppy*
These lines share any diskette loaded into your system’s diskette drives.
CHAPTER 13 Formatting and Using Diskettes From the Command Line (Tasks) 13−167
CHAPTER 14
This chapter describes all the tasks required to format and use PCMCIA memory cards from the command
line in the Solaris environment.
This is a list of the step−by−step instructions in this chapter.
• How to Format a UFS PCMCIA Memory Card @ 14−3
• How to Place a UFS File System on a PCMCIA Memory Card @ 14−4
• How to Format a DOS PCMCIA Memory Card @ 14−5
• How to Load a PCMCIA Memory Card @ 14−1
• How to Examine the Contents of a PCMCIA Memory Card @ 14−2
• How to Copy or Move Information From a PCMCIA Memory Card @ 14−3
• How to Copy or Move Information to a PCMCIA Memory Card @ 14−4
• How to Find Out If a PCMCIA Memory Card Is Still In Use @ 14−5
• How to Eject a PCMCIA Memory Card @ 14−6
• How to Access PCMCIA Memory Cards on Other Systems @ 14−7
• How to Make Local PCMCIA Memory Cards Available to Other Systems @ 14−8
1. Load Unformatted PCMCIA Insert the PCMCIA memory card into the drive How to Load a PCMCIA Memory
Memory Card and enter the volcheck command. Card @ 14−1
2. Format the PCMCIA Format the PCMCIA memory card for UFS. How to Format a UFS PCMCIA
Memory Card Memory Card @ 14−3
Format the PCMCIA memory card for DOS. How to Format a DOS PCMCIA
Memory Card @ 14−5
4. Eject the PCMCIA Memory When finished formatting, always eject the How to Eject a PCMCIA Memory
Card PCMCIA memory card, even if you are going to Card @ 14−6
use it again right away.
Note − PCATA drives that are not named (that is, they have no "label") are assigned the default name of
noname.
Hardware Considerations
A Solaris platform can format PCMCIA memory cards for use on both Solaris and DOS platforms.
However, the hardware platform imposes some limitations. They are summarized in the table below.
Solaris on This Platform ... Can Format PCMCIA Memory Cards For ...
Solaris on SPARC Solaris on SPARC (UFS)
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−169
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. See Formatting PCMCIA Memory Cards Task
Map @ 14−1.
To view all the options to the fdformat command, either see fdformat(1) or enter fdformat −z. The
−z option displays all the options to the command.
convenience−options
−z Lists all the options to the fdformat command, but does not format the
PCMCIA memory card.
The fdformat command displays a confirmation message (unless you used the −f option),
indicating the type of formatting to be performed:
Formatting in /vol/dev/aliases/pcmem0
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of
V’s appears beneath the dots. When the series stops, the formatting is complete.
The PCMCIA memory card is now ready for raw character operations such as tar and cpio.
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−171
formatted on x86 platforms and SPARC platforms, a UFS PCMCIA memory card formatted on a SPARC
platform can only be used on another SPARC platform, and a UFS PCMCIA memory card formatted on
an x86 platform can only be used on an x86 platform running Solaris.
1. Format the PCMCIA memory card for a UFS file system.
Use the procedure How to Format a UFS PCMCIA Memory Card @ 14−3.
2. Use the newfs(1M) command and the full pathname to the Volume Management directory to
create a UFS file system on the PCMCIA memory card.
$ /usr/sbin/newfs −v /vol/dev/aliases/pcmem0
−v Prints status messages.
The newfs(1M) command displays a message asking you to confirm the creation of the file system.
3. Confirm the creation of the file system.
newfs: construct a new file system \
/vol/dev/aliases/pcmem0:(y/n)? y
A status message is displayed, indicating the particulars of the file system and the PCMCIA memory
card’s formatting:
mkfs −F ufs /vol/dev/aliases/pcmem0 2848 8 2 8192 1024 16 \
10 60 2048 t 0 −1 8 −1
2 tracks, 8 sectors
/vol/dev/aliases/pcmem0:(y/n)? y
mkfs −F ufs /vol/dev/aliases/pcmem0 ...
$ volrmmount −i pcmem0
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−173
density−options If the drive density is 1.44 Mbytes, density−options are:
convenience−options
−b label Name for the PCMCIA memory card. Label must be eight characters or
less, upper or lower case.
−z Lists all the options to the fdformat command, but does not format the
PCMCIA memory card.
Note − If you try to format a 720 Kbyte (DD) diskette for 1.44 Mbytes, fdformat will not stop you
unless you include the −v option. With the −v option, fdformat will format the diskette, but the
verification will catch the error and notify you with the following message: fdformat: check diskette
density, I/O error
The fdformat command displays a confirmation message, indicating the type of formatting to be
performed:
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
As the formatting progresses, a series of dots is displayed. As the verification progresses, a series of
V’s appears beneath the dots. When the series stops, the formatting is complete and the PCMCIA
memory card is ready for use on a DOS system.
6. Use the volrmmount command with the −i option to notify Volume Management that the
memory card is inserted.
$ volrmmount −i pcmem0
1. Load the PCMCIA Memory Insert the PCMCIA memory card into its drive How to Load a PCMCIA Memory
Card and enter the volcheck command. Card @ 14−1
2. Examine the Contents of a Optional. To examine the contents of the How to Examine the Contents of a
PCMCIA Memory Card PCMCIA memory card, look in the appropriate PCMCIA Memory Card @ 14−2
directory under /PCMCIAmemorycard.
3. Exchange Files Optional. Copy files or directories between the How to Copy or Move
PCMCIA memory card and your file system. Information From a PCMCIA
Memory Card @ 14−3
4. Is PCMCIA Memory Card Optional. Before ejecting the PCMCIA memory How to Find Out If a PCMCIA
Still in Use? card, find out if the PCMCIA memory card is Memory Card Is Still In Use @
still in use. 14−5
5. Eject the PCMCIA memory When you finish, eject the PCMCIA Memory How to Eject a PCMCIA Memory
card Card. Card @ 14−6
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−175
Two status messages are possible:
media was found Volume Management detected the PCMCIA memory card and will attempt to mount it in
the /pcmem directory.
If the PCMCIA memory card is formatted properly, no error messages appear in the
Console.
If the PCMCIA memory card is not formatted, the "media was found" message is still
displayed, but the following error messages appear in the Console:
no media was found Volume Management did not detect a PCMCIA memory card. Make sure the PCMCIA
memory card is inserted properly and run volcheck again. If unsuccessful, check the
PCMCIA memory card; it could be damaged. You can also try to mount the PCMCIA
memory card manually.
4. Verify that the PCMCIA memory card was mounted by listing its contents.
$ ls /pcmem/pcmem0
pcmem0 myfiles
As described earlier, pcmem0 is a symbolic link to the actual name of the PCMCIA memory card; in
this case, myfiles. If the PCMCIA memory card has no name but is formatted correctly, the system
will refer to it as unnamed_floppy.
If nothing appears under the /pcmem directory, the PCMCIA memory card was either not mounted or
is not formatted properly. To find out, run the mount command and look for the line that begins with
/pcmem (usually at the end of the listing):
/pcmem/name on /vol/dev/diskette0/name ...
If the line does not appear, the PCMCIA memory card was not mounted. Check the Console for error
messages.
A directory cp −r
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−177
ExamplesCopying or Moving Information from a PCMCIA
Memory Card
The first example, below, moves a file (readme.doc) from the PCMCIA memory card to the current
directory (indicated by the "." symbol). The second example copies a file (readme2.doc) from the
PCMCIA memory card to the current directory. The third example copies a directory (morefiles) and
everything below it from the PCMCIA memory card to the current directory.
$ mv /pcmem/pcmem0/readme.doc .
$ cp /pcmem/pcmem0/readme2.doc .
$ cp −r /pcmem/pcmem0/morefiles .
Copy a directory cp −r
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−179
If you are not sure whether you have found all users of a PCMCIA memory card (a renegade shell
hidden behind a desktop tool may be accessing it), use the fuser command, as described in How to
Find Out If a PCMCIA Memory Card Is Still In Use @ 14−5.
2. Eject the PCMCIA memory card.
# eject pcmem0
You’ll have to eject the PCMCIA memory card by hand. If you are running Windows, look for an
onscreen message that says you can now eject the PCMCIA memory card.
If the PCMCIA memory card is still in use, the following message appears:
/vol/dev/pcmem/noname: Device busy
In this case, return to Step 1 and make sure no one is using the PCMCIA memory card, then eject it
again.
2. Find the name of the PCMCIA memory card you want to mount.
When you manually mount a remote PCMCIA memory card, you cannot use the pcmem0 or floppy1
variables available with your local PCMCIA memory cards. You must use the exact PCMCIA
memory card name. To find it, use the ls command on the remote system’s /pcmem directory. If the
automounter is running, you can simply cd to the system whose PCMCIA memory card you want to
mount and then use the ls command. If the automounter is not running, you’ll have to use another
method, such as logging in remotely.
3. As superuser, mount the PCMCIA memory card.
# mount −F nfs −o rw system−name:/pcmem/PCMCIA memory−card−name
local−mount−point
system−name The name of the system whose PCMCIA memory card you will mount.
PCMCIA memory−card−name The name of the PCMCIA memory card you want to mount.
local−mount−point The local directory onto which you will mount the remote PCMCIA
memory card.
If the daemon is running, a line for /usr/lib/nfs/nfsd will appear, as shown above. If the daemon is not
running, only the grep nfsd line will appear.
3. Select an option from the following table.
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−181
# mkdir /dummy−dir
dummy−dir Can be any directory name; for example, dummy. This directory will not
contain any files. Its only purpose is to "wake up" the NFS daemon so that
it notices your shared PCMCIA memory cards.
The PCMCIA memory card you now load, and all subsequent PCMCIA memory cards, will be
available to other systems. To access the PCMCIA memory card, the remote user must mount it by
name, according to the instructions in How to Access PCMCIA Memory Cards on Other Systems @
14−7.
13. Verify that the PCMCIA memory card is indeed available to other systems by using the share
command.
If the PCMCIA memory card is available, its share configuration will be displayed. (The shared
dummy directory will also be displayed.)
# share
− /dummy ro "dummy dir to wake up NFS daemon"
CHAPTER 14 Using PCMCIA Memory Cards From the Command Line (Tasks) 14−183
CHAPTER 15
This chapter describes the mount points and symbolic links that Volume Management creates to
accommodate removable media.
This is a list of reference information in this chapter.
• Volume Management Mounts All Removable Media @ 15−1
• Volume Management Provides Access to Diskettes @ 15−2
• Volume Management Provides Access to CDs @ 15−3
• Volume Management Supplies Convenient Mount Points for Easier Access @ 15−4
• Volume Management Creates Two Sets of Symbolic Links @ 15−5
• Volume Management Can Be Limited by UFS Formats @ 15−6
In the illustration above, the additional directory is named c0t6. That simply reflects a particular system’s
device naming conventions. The directory name on your system could be different, though it would have
the same format.
The CDs themselves, however, follow a convention similar to diskettes, in that they are mounted beneath
/cdrom.
Volume Management mounts the /vol/dev/diskette0 and /vol/dev/dsk/c0t6 directories onto /floppy and
However, these mount points depend on proper formatting. If a diskette is formatted, the mount succeeds,
but if it is unformatted, the mount fails and the diskette is only available under /vol/dev/diskette0. You can
format diskettes according to the instructions in How to Format a UFS Diskette @ 13−3 or How to
Format a DOS Diskette @ 13−5.
If a system has multiple drives, they are mounted onto parallel directories such as /floppy/floppy0,
/floppy/floppy1, /cdrom/cdrom0, etc.
/vol/dev:
Beneath the aliases directory, Volume Management creates a set of symbolic links similar to those used
for block access. In other words, for character access, these directories are equivalent:
/vol/dev/aliases/floppy0 −−> /vol/dev/rdiskette0/diskette−name
/vol/dev/aliases/cdrom0 −−> /vol/dev/rdsk/c0t6d0/cd−name
Like the symbolic links for file system access, the purpose of these links is to enable you to access a
raw−character diskette or CD without knowing its name; in other words, by using the
/vol/dev/aliases/floppy0 and /vol/dev/aliases/cdrom0 link names.
The example above shows only one symbolic link for diskettes and one for CDs. If your system had two
diskettes or two CDs, there would be one symbolic link for each:
Therefore, Volume Management cannot recognize and mount x86 UFS media on a SPARC platformor
SPARC UFS media on an x86 platform.
Most CDs are formatted according to the ISO 9660 standard (High Sierra File SystemHSFS), which
imposes no limitations on Volume Management, so incompatibility is seldom a problem with CDs.
With diskettes, UFS incompatibility can occur more often because formats can be established by the user.
Be aware that if you format a UFS diskette on one architecture, you won’t be able to use it on a different
architecture. (For instructions, see How to Format a UFS Diskette @ 13−3).
When Volume Management encounters this arrangement, it simply ignores the UFS formats not specific to
the local system’s architecture and mounts the appropriate UFS slice and the ISO 9660 slice:
CHAPTER 17, Software Provides step−by−step instructions for installing and removing software
Administration (Tasks) packages on different client types.
CHAPTER 18, Patch Provides overview information and step−by−step instructions about
Administration (Overview) adding and removing patches in the Solaris operating environment.
CHAPTER 16
Software administration involves installing and removing software from standalone systems, servers, and
their clients. This chapter describes background and other useful information about installing and
managing software. This chapter does not describe installing the Solaris software, which has its own
installation and setup procedures.
This is a list of the overview information in this chapter.
• Where to Find Software Administration Tasks @ 16−1
• Software Packages @ 16−2
• Tools for Managing Software @ 16−3
• What Happens When You Add or Remove a Package @ 16−4
• What You Should Know Before Adding or Removing Packages @ 16−5
• Guidelines for Client Software Administration @ 16−6
• Guidelines for Removing Packages @ 16−7
• Avoiding User Interaction When Adding Packages @ 16−8
Software Packages
For the purpose of this discussion, software administration involves installing or removing software
products. Sun and its third−party vendors deliver products in a form called a software package. (The term
packaging generically refers to the method for distributing and installing software products to systems
where the products will be used.) In its simplest form, you can think of a package as 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 or remove a package or to verify its
installation.
Note that prior to the Solaris 2.5 release, Software Manager (accessed with the swmtool command) was
the graphical tool for adding and removing software. With the Solaris 2.5 release and compatible versions,
Admintool (accessed with the admintool command) provides that capability. If you use the swmtool
command on a Solaris 2.5 or compatible system, it will start Admintool.
If Package’s Files Are Installed in The ... Then Install the Package on The ...
root (/) file system Client or the client’s root file system
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 already installed on the system.
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 pkgadd normally provides.
This is an example of an administration file that will prevent pkgadd from prompting the user for
confirmation before installing the package.
mail=
instance=overwrite
partial=nocheck
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 install, remove, and administer software packages with Solaris commands
and the Admintool graphical interface.
This is a list of step−by−step instructions in this chapter.
• How to Add Packages to a Standalone System @ 17−1
• How to Add a Package to a Spool Directory @ 17−1
• How to Determine Where a Package’s Files Will Be Installed @ 17−1
• How to Add a Package to a Diskless or AutoClient System’s root ( / ) File System @ 17−2
• How to Add Packages to a Server @ 17−3
• How to Check the Integrity of an Installed Package @ 17−2
• How to List Information About All Installed Packages @ 17−1
• How to Display Detailed Information About a Package @ 17−3
• How to Remove a Package @ 17−1
• How to Remove a Spooled Package @ 17−2
• How to Remove a Diskless or AutoClient System’s Package @ 17−3
• How to Add Packages With Admintool @ 17−1
• How to Remove Packages With Admintool @ 17−2
Command Description
pkgadd(1M) Installs a software package
NONABI_SCRIPTS=TRUE
Adding Packages
−d device−name Specifies the absolute path to the software packages. device−name can be
a the path to a device, a directory, or a spool directory. If you do not
specify the path where the package resides, the pkgadd command checks
the default spool directory (/var/spool/pkg). If the package is not there, the
package installation fails.
Respond with yes, no, or quit. If more than one package has been specified, type no to stop the
installation of the package being installed. pkgadd continues to install the other packages. Type quit
to stop the installation.
4. Verify that the package has been installed successfully, using the pkgchk command.
# pkgchk −v pkgid
If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the
error.
The following example shows a command to install the SUNWaudio package from a mounted Solaris 7
CD. The example also shows use of the pkgchk command to verify that the packages files were installed
properly.
# pkgadd −d /cdrom/cdrom0/s0/Solaris_2.7/Product SUNWaudio
.
.
.
Installation of <SUNWaudio> complete.
# pkgchk −v SUNWaudio
/usr
/usr/bin
/usr/bin/audioconvert
/usr/bin/audioplay
/usr/bin/audiorecord
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 SUNWaudio
.
.
.
Installation of <SUNWaudio> was successful.
The following example is similar to the previous one, except it uses the −a option and specifies an
administration file named noask−pkgadd, which is illustrated in Avoiding User Interaction When Adding
Packages @ 16−8. In this example, assume the noask−pkgadd administration file is in the default
location, /var/sadm/install/admin.
# pkgadd −a noask−pkgadd −d /net/package−server/latest−packages SUNWaud
io
.
.
.
Installation of <SUNWaudio> was successful.
−s spooldir Specifies the name of the spool directory where the package will be
spooled. You must specify a spooldir.
4. Verify that the package has been copied successfully to the spool directory, using the pkginfo
command.
$ pkginfo −d spooldir| grep pkgid
If pkgid is copied correctly, the pkginfo command returns a line of information about it. Otherwise,
pkginfo returns the system prompt.
Note − Packages installed on the server for diskless and AutoClient systems are read−only to the client and
are shared with other clients.
Although there are several ways to install and maintain packages in a client/server environment, this
section provides instructions on how to do this from a server. This is a centralized software administration
model. Note, however, that you can log in to clients and install software directly on them.
You can determine where a Sun package’s files are installed by using the procedure How to Determine
Where a Package’s Files Will Be Installed @ 17−1.
SUNW_PKGTYPE Is a special parameter that reports where a Solaris software package will
be installed. If the package does not have the SUNW_PKGTYPE
parameter set, the pkgparam command returns an empty string. For Sun
packages, this usually means the package will be installed in /opt.
Note − If the package’s files are installed into the /usr file system, you need to install the package on the
server. If you are working in a homogeneous client/server environment, use Table 70 to determine how to
install the package. If you are working in a heterogeneous client/server environment, use Table 71 to
determine how to install the package.
−d device−name Specifies the absolute path to the software packages. device−name can be
the path to a device, a directory, or a spool directory. If you do not specify
the path where the package resides, the pkgadd command checks the
default spool directory (/var/spool/pkg). If the package is not there, the
package installation fails.
Caution − During the installation, you may see the following message: WARNING: filename <not
present on Read Only file system>
This indicates that not all of the package’s files have been installed. The client may not have access to
all files necessary for the software to work correctly. If you see this warning message, you must also
install the package on the server as well as the client’s root file system.
4. Verify the package has been installed by logging in to the server as superuser and using the
pkginfo command.
server# pkginfo −R rootpath | egrep pkgid
The pkginfo command returns a line of information about the installed pkgid. If pkgid is not
installed, pkginfo returns the system prompt.
5. Verify that the package has been installed successfully using the pkgchk command.
server# pkgchk −R rootpath −v pkgid
If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the
error.
The following example shows a command to install the SUNWadmr (software to support system and
network administration) package from a server onto a diskless client’s root file system. In this case, the
diskless client’s root file system is /export/root/client−1. This example assumes the SUNWadmr package
is available from a mounted SPARC 2.7 Solaris CD (/cdrom/cdrom0/s0/Solaris_2.7/Product). The example
Use a text editor to edit the new administration file and set the basedir keyword to the correct path for
the OS services supporting the client.
basedir=/export/exec/Solaris_2.7_platform.all/usr
Solaris_2.7 Is the Solaris version number: for example, Solaris_2.7
platform Is the hardware architecture of the client: for example, i386or sparc, as in
Solaris_2.7_i386.all or Solaris_2.7_sparc.all.
−d device−name Specifies the absolute path to the software packages. device−name can be
the path to a device, a directory, or a spool directory. If you do not specify
the path where the package resides, pkgadd checks the default spool
directory (/var/spool/pkg). If the package is not there, the package
installation fails.
If the pkgadd command encounters a problem during installation of the package, it displays a
Respond with yes, no, or quit. If more than one package has been specified, type no to stop the
installation of the package being installed. pkgadd continues to install the other packages. Type quit
to stop the installation.
7. Verify that the package has been installed, using the pkginfo command.
# pkginfo pkgid*
The pkginfo command will return all instances of the installed package. Typically, pkgadd installs
duplicate versions of an already installed package as pkgid.1, pkgid.2, and so on.
8. Verify that the package has been installed successfully, using the pkgchk command.
# pkgchk −v pkgid
If the pkgchk command determines there are no errors for the specified package instance, it returns a
list of installed files. Otherwise, it reports the error.
−c Specifies to audit only the file contents, rather than the file contents and attributes,
which is the default for pkgchk.
−v Specifies verbose mode, which displays file names as pkgchk processes them.
pkgid (Optional) Is the name of one or more packages (separated by spaces). If you do not
specify a pkgid, pkgchk checks all the software packages installed on the system. If
omitted, pkgchk displays all available packages.
If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.
Note − The checks made on a spooled package are limited because not all information can be audited until
a package is installed.
Files in the client’s package database that are marked shared are not removed from the server, but are
removed from the client’s database. If all clients have removed the package, you can remove the
shared files from the server by using a separate invocation of pkgrm on the server.
3. Verify that the package has been removed successfully by using the pkginfo command.
server# pkginfo −R rootpath | egrep pkgid
If pkgid is installed, the pkginfo command returns a line of information about it. Otherwise,
pkginfo returns the system prompt.
y
.
.
.
Unless you are a member of the UNIX sysadmin group (group 14), you must become superuser on
your system to add or remove software packages with Admintool.
2. Start Admintool.
# admintool &
3. Choose Software from the Browse menu.
For the purpose of this discussion, patch administration involves installing or removing Solaris patches
from a running Solaris system. It may also involve removing (called backing out) unwanted or faulty
patches.
This is a list of the overview information in this chapter.
• What Is a Patch @ 18−1
• Tools For Managing Patches @ 18−2
• Patch Distribution @ 18−3
• Patch Numbering @ 18−4
• What Happens When You Install a Patch @ 18−5
• What Happens When You Remove a Patch @ 18−6
What Is a Patch
In its simplest form, you can think of a patch as a collection of files and directories that replace or update
existing files and directories that are preventing proper execution of the software. The existing software is
derived from a specified package format, which conforms to the Application Binary Interface. (For details
about packages, see CHAPTER 16, Software Administration (Overview).)
pkgparam pkgid PATCHLIST Shows all patches applied to the package identified by
pkgid.
pkgparam pkgid PATCH_INFO_patch−number Shows the installation date and name of the host from
which the patch was applied. pkgid is the name of the
package: for example, SUNWadmap.
patchadd −R client_root_path −p Shows all patches applied to a client, from the server’s
console.
Patch Distribution
All Sun customers can access security patches and other recommended patches via the World Wide Web
or anonymous ftp. Sun customers who have purchased a service contract can access an extended set of
patches and a complete database of patch information. This information is available via the World Wide
Web, anonymous ftp, and it is regularly distributed on a CD−ROM (See Table 73).
Table 73 − Customer Patch Access Information
Not a Sun Service customer You have access to a general set of security patches and other recommended
patches. These are available via the World Wide Web or anonymous ftp, as
described in Patch Access Via the World Wide Web @ 18−2 and Patch
Access Via ftp @ 18−3.
To access patches via anonymous ftp, you need a machine that is:
• Connected to the Internet
• Capable of running the ftp program
Note − To transfer patches, you will need to change the ftp transfer mode to binary. To do this, enter
bin at the ftp prompt.
Patch Numbering
Patches are identified by unique alphanumeric strings, with the patch base code first, a hyphen, and a
number that represents the patch revision number. For example, patch 101977−02 is a Solaris 2.4 patch to
correct the lockd daemon.
The patchrm command calls pkgadd to restore packages that were saved from the initial patch
installation.
During the patch installation, patchrm keeps a log of the patch installation in
/tmp/backoutlog.process_id. This log file is removed if the patch backs out successfully.
CHAPTER 20, Accessing Devices Provides an overview of device naming conventions and
(Overview) instructions for accessing devices.
CHAPTER 19
The chapter provides overview information about managing peripheral devices in the Solaris
environment.
This is a list of overview information in this chapter.
• Where to Find Device Management Tasks @ 19−2
• About Device Drivers @ 19−3
• Automatic Configuration of Devices @ 19−4
• Adding a Peripheral Device to a System @ 19−5
• Displaying Device Configuration Information @ 19−6
This is a list of step−by−step instructions in this chapter.
• How to Add a Peripheral Device @ 19−1
• How to a Add a Device Driver @ 19−2
• How to Display System Configuration Information @ 19−3
• How to Display Device Information @ 19−4
For information about accessing devices, see CHAPTER 20, Accessing Devices (Overview).
Device management in the Solaris environment usually includes adding and removing peripheral devices
from systems, possibly adding a third−party device driver to support a device, and displaying system
configuration information.
Dynamic Reconfiguration
Dynamic reconfiguration, available on certain SPARC servers, allows a service provider to remove replace
hotpluggable system I/O boards in a running system, eliminating the time lost in rebooting. Also, if a
replacement board is not immediately available, the system administrator can use dynamic reconfiguration
to shut down a failing board while allowing the system to continue operation.
See your hardware manufacturer’s documentation for informaiton about whether dynamic reconfiguration
is supported on your server.
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 for the first time. This process is called autoconfiguration
because all kernel modules are loaded automatically when needed.
The autoconfiguration process is used by a system administrator when adding a new device (and driver) to
the system. At this time, the administrator performs a reconfiguration boot so the system will recognize the
new device.
In some cases, you may have to add a third−party device driver to support the new device.
The /reconfigure file will cause the Solaris software to check for the presence of any newly installed
devices the next time you turn on or boot your system.
4. Shut down the system.
# shutdown −i0 −g30 −y
−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.
−y Continues the system shutdown without user intervention; otherwise, you are
prompted to continue the shutdown process.
Refer to the hardware installation guide that accompanies your system for the location of the power
switch.
6. Turn off power to all external devices.
For location of power switches on any peripheral devices, refer to the hardware installation guides that
accompany your peripheral devices.
7. Install the peripheral device making sure the device 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.
Refer to the hardware installation guide that accompanies the peripheral device for information on
installing and connecting the device.
8. Turn on the power to the system.
package−name Identifies the package name that contains the device driver.
4. Verify that the package has been added correctly by using the pkgchk command. The system
prompt returns with no response if the package is installed correctly.
# pkgchk packagename
#
dmesg(1M) Displays system diagnostic messages as well as a list of devices attached to the
system since the last reboot.
See Device Naming Conventions @ 20−2 for information on the device names used to identify devices
on the system.
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)
Use the sysdef command to display system configuration information including pseudo devices,
loadable modules, and selected kernel parameters.
# /usr/sbin/sysdef
SUNW,SPARCstation−10
packages (driver not attached)
disk−label (driver not attached)
deblocker (driver not attached)
obp−tftp (driver not attached)
options, instance #0
aliases (driver not attached)
openprom (driver not attached)
iommu, instance #0
sbus, instance #0
espdma, instance #0
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1
sd, instance #2 (driver not attached)
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
This chapter provides information about how system administrators access the devices on their systems.
This is a list of overview information in this chapter.
• Accessing Devices @ 20−1
• Logical Disk Device Names @ 20−2
• Logical Tape Device Names @ 20−3
• Logical CD−ROM Device Names @ 20−4
For overview information about configuring devices, see CHAPTER 19, Device Management
(Overview/Tasks).
Accessing Devices
System administrators need to know how to specify device names when using commands to manage disks,
file systems, and other devices. In most cases, system administrators use logical device names to represent
devices connected to the system. Both logical and physical device names are represented on the system by
logical and physical device files.
Many administration commands take arguments that refer to a disk slice or file system.
Refer to a disk device by specifying the subdirectory to which it is symbolically linked (either /dev/dsk or
/dev/rdsk), followed by a string identifying the particular controller, disk, and slice.
The conventions for both types of controllers are explained in the following subsections.
Note − Controller numbers are assigned automatically at system initialization. The numbers are strictly
logical and imply no direct mapping to physical controllers.
directory.
The first tape device connected to the system is 0 (/dev/rmt/0), which may be one of the following types:
QIC−11, QIC−24, QIC−150, or Exabyte. Tape density values (l, m, h, c, and u) are described in
CHAPTER 38, Managing Tape Drives (Tasks).
CHAPTER 22, Administering Disks Provides step−by−step instructions for formatting a disk, examining
(Tasks) disk labels, and repairing a defective disk sector.
CHAPTER 23, SPARC: Adding a Disk Provides step−by−step instructions for adding a disk to a SPARC
(Tasks) system.
CHAPTER 24, x86: Adding a Disk Provides step−by−step instructions for adding a disk to an x86
(Tasks) system.
CHAPTER 25, The format Utility Provides a description of the format utility’s menu and commands.
(Reference) This chapter also includes information about the format.dat file,
rules for providing input to format commands, and instructions on
using the help facility.
CHAPTER 21
This overview chapter provides conceptual information about Solaris disk slices and introduces the
format utility.
This is a list of the overview information in this chapter.
• Disk Terminology @ 21−3
• About Disk Slices @ 21−4
• SPARC: Disk Slices @ 21−1
• x86: Disk Slices @ 21−2
• Determining Which Slices to Use @ 21−5
• The format Utility @ 21−5
For instructions on how to add a disk drive to your system, see CHAPTER 23, SPARC: Adding a Disk
(Tasks) or CHAPTER 24, x86: Adding a Disk (Tasks).
Introduction
Managing disks in the Solaris environment usually involves setting up the system and running the Solaris
installation program to create the appropriate disk slices and install the operating system. Occasionally,
you may need to use the format utility to add a new disk drive or replace a defective one.
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:
• Track
• Cylinder
• Sector
• Disk controller
• Disk label
• Device drivers
If you are unfamiliar with these terms, refer to the glossary (for a brief definition) or product information
from the 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. Table 78 summarizes the differences:
Table 78 − Slice Differences on Platforms
Disk is divided into eight slices, numbered 0−7 The Solaris fdisk partition is divided into 10 slices,
numbered 0−9
4 /export/swap Server only Provides virtual memory space for client systems.
4 /export/swap Server only Provides virtual memory space for the client
systems.
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 a
separate disk is provided for the /export/home file system and other file systems containing user data.
In a multiple disk arrangement, the disk containing the operating system software and swap space (that is,
the disk holding the root (/) or /usr file systems or the slice for swap space) is called the system disk. Disks
other than the system disk are called secondary disks or non−system disks.
Locating a system’s file systems on multiple disks allows you to modify file systems and slices on the
secondary disks without having to shut down the system or reload operating system software.
Having more than one disk also increases input−output (I/O) volume. By distributing disk load across
multiple disks, you can avoid I/O bottlenecks.
Each system configuration requires the use of different slices. Table 81 lists these requirements.
Table 81 − System Configurations and Slice Requirements
Standalone AutoClient
Slice Servers Diskless Clients Systems Systems
0 root (on server) root root
2
3 /export
4 /export/swap
See CHAPTER 4, Managing Server and Client Support (Tasks) for more information about system
configurations.
Note − The Solaris installation program provides slice size recommendations based on the software you
select for installation.
Definition
The format utility is a system administration tool used to prepare hard disk drives for use on your Solaris
system. The format utility cannot be used on diskette drives, CD−ROM drives, or tape drives.
Feature Benefit
Searches your system for all attached Reports:
disk drives
• Target location
• Disk geometry
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 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)
All of the options of the format utility are fully described in CHAPTER 25, The format Utility
(Reference).
The main reason a system administrator uses the format utility is to divide a disk into disk slices. These
steps are covered in CHAPTER 23, SPARC: Adding a Disk (Tasks) and CHAPTER 24, x86: Adding a
Disk (Tasks).
See Table 83 for guidelines on using the format utility.
Formatting a Disk
Caution − Formatting is a destructive processit overwrites data on the disk. For this reason, disks are
usually formatted only by the manufacturer or reseller. If you think disk defects are causing recurring
problems, you can use the format utility to do a surface analysis, but be careful to use only the
commands that do not destroy data. See How to Format a Disk @ 22−2 for details.
A small percentage of total disk space 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 may take anywhere from a few minutes to several hours, depending on the type and size of the
disk.
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 total size of the slices. A disk’s partition table can be displayed using the
format utility. Table 84 describes partition table terminology.
Table 84 − Partition Table Terminology
Tag 0=UNASSIGNED A numeric value that usually describes the file system
1=BOOT mounted on this partition.
Flags
Partition flags and tags are assigned by convention and require no maintenance.
See How to Display Disk Slice Information @ 22−1 or How to Examine a Disk Label @ 22−2 for
more information on displaying the partition table.
ExamplesPartition Tables
The following partition table example is displayed from a 535−Mbyte disk using the format
utility:
The partition table contains the following information:
Column Name Description
Part Partition (or slice number). See Table 84 for a description of this column.
Blocks The total number of cylinders and the total number of sectors per slice in the far right
column.
The following example displays a disk label using the prtvtoc command.
# prtvtoc /dev/rdsk/c0t3d0s0
* /dev/rdsk/c0t3d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 80 sectors/track
* 9 tracks/cylinder
* 720 sectors/cylinder
* 2500 cylinders
* 1151 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read−only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 66240 66239 /
1 3 01 66240 131760 197999
2 5 00 0 828720 828719
3 0 00 198000 66240 264239 /export
4 0 00 264240 66240 330479 /export/swap
5 0 00 330480 72000 402479 /opt
6 4 00 402480 385200 787679 /usr
7 8 00 787680 41040 828719 /export/home
#
Flags − This section describes the flags listed in the partition table section. See Table 84 for a description
of partition flags.
Partition (or Slice) Table − This section contains the following information:
Column Name Description
Partion Partition (or slice number). See Table 84 for a description of this column.
Mount Directory The last mount point directory for the file system.
The easiest way to divide a disk into slices is to use the modify command from the partition menu.
The modify command allows you to create slices by specifying the size of each slice in megabytes
without having to keep track of starting cylinder boundaries. It also keeps tracks of any disk space
remainder in the "free hog" slice.
This chapter contains disk administration procedures. Many of the procedures described in this chapter are
optional if you are already familiar with how disks are managed on systems running the Solaris release.
This is a list of step−by−step instructions in this chapter.
• How to Identify the Disks on a System @ 22−1
• How to Determine If a Disk is Formatted @ 22−1
• How to Format a Disk @ 22−2
• How to Display Disk Slice Information @ 22−1
• How to Label a Disk @ 22−1
• How to Examine a Disk Label @ 22−2
• How to Recover a Corrupted Disk Label @ 22−1
• How to Create a format.dat Entry @ 22−2
• How to Automatically Configure a SCSI Drive @ 22−1
• How to Identify a Defective Sector by Using Surface Analysis @ 22−1
• How to Repair a Defective Sector @ 22−2
For overview information about disk management, see CHAPTER 21, Disk Management (Overview).
1. Identify the Disks on a If you are not sure of the types of disks on a How to Identify the Disks on a
System system, use the format utility to identify the System @ 22−1
disk types.
2. Format the Disk Determine whether a disk is already formatted How to Determine If a Disk is
by using the format utility. Formatted @ 22−1
In most cases, disks are already formatted. Use How to Format a Disk @ 22−2
3. Display Slice Information Display slice information by using the format How to Display Disk Slice
utility. Information @ 22−1
4. Label the Disk Create the disk label by using the format How to Label a Disk @ 22−1
utility.
5. Examine the Disk Label Examine the disk label by using the prtvtoc How to Examine a Disk Label @
command. 22−2
6. Create a format.dat Entry Create a format.dat entry to support a How to Create a format.dat
third−party disk. Entry @ 22−2
7. Repair a Defective Disk Identify a defective disk sector by using the How to Identify a Defective
Sector format utility. Sector by Using Surface Analysis
@ 22−1
8. If Necessary, Fix a Fix a defective disk sector by using the format How to Repair a Defective Sector
Defective Disk Sector utility. @ 22−2
The format utility displays a list of disks that it recognizes under AVAILABLE DISK
SELECTIONS.
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, SUN02.1G.
The following example identifies the disks on an x86 based system.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <DEFAULT cyl 507 alt 2 hd 64 sec 32>
/eisa/dpt@5c88,0/cmdk@0,0
1. c0t3d0 <DEFAULT cyl 1852 alt 2 hd 15 sec 74>
/eisa/dpt@5c88,0/cmdk@3,0
Specify disk (enter its number):
The format output identifies that disk 0, target 0 (cmdk@0,0) is connected to the first DPT host adapter
Label was corrupted by a system problem, such as a power Go to How to Label a Disk @ 22−1.
failure
Is not properly connected to the system Connect the disk to the system using your disk
hardware documentation.
Formatting a Disk
Disks are formatted by the manufacturer or reseller and usually do not need to be reformatted when you
install the drive.
A disk must be formatted before:
• You can write data to it. However, most disks are already formatted.
• You can use the Solaris installation program to install the system.
Caution − Formatting is a destructive processit overwrites data on the disk. For this reason, disks are
usually formatted only by the manufacturer or reseller. If you think disk defects are causing recurring
problems, you can use the format utility to do a surface analysis, but be careful to use only the
commands that do not destroy data.
Caution − Do not select the system disk. Formatting your system disk deletes your operating system
and any data that you may have on this disk.
4. To begin formatting the disk, enter format at the format> prompt. Confirm the command by
typing y.
format> format
Ready to format. Formatting cannot be interrupted
and takes 26 minutes (estimated). Continue? yes
5. Verify that the disk format is successful by identifying the following messages.
Formatting ...
done
Verifying media ...
pass 0 − pattern = 0xc6dec6de
2035/12/18
ExampleFormatting a Disk
The following example formats the disk c0t2d0.
# 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,8000
00/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,80000
0/sd@3,0
Specify disk (enter its number):0
Selecting c0t1d0
[disk unformatted]
format> format
Ready to format. Formatting cannot be interrupted
and takes 26 minutes (estimated). Continue? yes
Beginning format. The current time is Wed Jun 10 10:24:48 1998
Formatting ...
done
Verifying media ...
pass 0 − pattern = 0xc6dec6de
2035/12/18
pass 1 − pattern = 0x6db6db6d
2035/12/18
total of 0 defective blocks repaired.
format>
Note − The format utility uses the term partition in place of slice.
ExampleLabeling a Disk
The following example automatically configures and labels a 424−Mbyte disk.
# format
c1t0d0: configured with capacity of 404.65MB
At this point, format attempts to automatically configure any unlabeled SCSI disk. If format is
able to configure the unlabeled and corrupted disk, it will display:
cwtxdy: configured with capacity of abcMB
The format utility then displays the list of disks on the system.
3. Enter the number of the disk that you need to recover from the list displayed on your screen.
Specify disk (enter its number): 1
4. Use the table below to determine how to label the disk.
If the Disk was Successfully Configured ... If the Disk was not Successfully Configured ...
Follow steps 5 and 6. Then go to step 12. Follow steps 7−11. Then go to step 12.
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, this occurs 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 23, SPARC: Adding a Disk (Tasks)
or CHAPTER 24, x86: Adding a Disk (Tasks).
Note − SCSI−2 drives do not require a format.dat entry. Starting with the Solaris 2.3 release, the format
utility automatically configures the SCSI−2 drivers if the drives are powered on during a reconfiguration
boot. See How to Automatically Configure a SCSI Drive @ 22−1 for step−by−step instructions on
configuring a SCSI disk drive automatically.
If your disk was not recognized, use a text editor to create an entry in format.dat for the disk. You’ll 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. See CHAPTER 25, The format Utility (Reference) for more information on adding an entry to
the /etc/format.dat file.
In all cases, slice 6 (for the /usr file system) gets the remainder of the space on the disk.
−g30 Notifies logged−in users that they have n seconds before the system begins to shut down.
The ok or > prompt is displayed after the operating environment is shut down.
4. Turn off power to the system and all external peripheral devices.
5. Make sure 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.
6. Connect the disk to the system and check the physical connections.
Refer to the disk’s hardware installation guide for installation details.
7. Turn on the power to all external peripherals.
8. Turn on the power to the system.
The system will boot and display the login prompt.
9. Login as superuser, invoke the format utility, and select the disk to be configured
automatically.
# format
Searching for disks...done
c1t0d0: configured with capacity of 404.65MB
AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
This chapter provides the procedures for adding a disk to a SPARC system.
This is a list of the step−by−step instructions in this chapter.
• SPARC: How to Connect a System Disk and Boot @ 23−1
• SPARC: How to Connect a Secondary Disk and Boot @ 23−2
• SPARC: How to Create Disk Slices and Label a Disk @ 23−3
• SPARC: How to Create File Systems @ 23−4
• SPARC: How to Install a Boot Block on a System Disk @ 23−5
For overview information about disk management, see CHAPTER 21, Disk Management (Overview).
A secondary disk doesn’t contain the root (/) and /usr file systems. It 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.
1. Connect the Disk and Boot System Disk SPARC: How to Connect a
System Disk and Boot @ 23−1
Connect the new disk and boot from a local or
remote Solaris CD.
2. Create Slices and Label the Create disk slices and label the disk if it has not SPARC: How to Create Disk
Disk already been done by the disk manufacturer. Slices and Label a Disk @ 23−3
3. Create File Systems Create UFS file systems on the disk slices with SPARC: How to Create File
the newfs command. You must create the root Systems @ 23−4
(/) or /usr file system (or both) for a system disk.
4. Restore File Systems Restore the root (/) or /usr file system (or both) CHAPTER 35, Restoring Files
on the system disk. If necessary, restore file and File Systems (Tasks)
systems on the secondary disk.
5. Install Boot Block System Disk Only. Install the boot block on the SPARC: How to Install a Boot
root (/) file system, so the system can boot. Block on a System Disk @ 23−5
A Solaris CD from a CD−ROM drive over the network Boot from the net to single−user mode:
ok boot net −s
−gn Notifies logged−in users that they have n seconds before the system begins to shut down.
The ok or > prompt is displayed after the operating environment is shut down.
5. Turn off power to the system and all external peripheral devices.
6. Make sure 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.
8. Turn on the power to all external peripherals.
9. Turn on the power to the system.
The system will boot and display the login prompt.
4. Go into the partition menu (which lets you set up the slices).
format> partition
5. Display the current partition (slice) table.
partition> print
6. Start the modification process.
partition> modify
7. Set the disk to all free hog.
Choose base (enter number) [0]? 1
See Using the Free Hog Slice @ 21−1 for more information about the free hog slice.
8. Create a new partition table by answering y when prompted to continue.
Do you wish to continue creating a new partition table based on
above table[yes]?y
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 y when asked.
Okay to make this the current partition table[yes]? y
If you don’t want the current partition table and you want to change it, answer no and go to Step 6.
11. Name the partition table.
12. Label the disk with the new partition table when you have finished allocating slices on the new
disk.
Ready to label disk, continue? yes
13. Quit the partition menu.
partition> q
14. Verify the disk label using the verify command.
format> verify
15. Quit the format menu.
format> q
See CHAPTER 27, Creating File Systems (Tasks) for more information about the newfs
command.
3. Verify the new file system by mounting it on an unused mount point.
# mount /dev/dsk/cwtxdysz/mnt
# ls
lost+found
Secondary Disk You may need to restore file systems on the new disk. Go to CHAPTER 35,
Restoring Files and File Systems (Tasks).
If you are not restoring file systems on the new disk, you are finished adding
a secondary disk. See CHAPTER 28, Mounting and Unmounting File
Systems (Tasks) for information on making the file systems available to
users.
3. Verify the boot blocks are installed by rebooting the system to run level 3.
# init 6
This chapter provides the procedures for adding a disk on an x86 system. This is a list of the step−by−step
instructions in this chapter.
• x86: How to Connect a System Disk and Boot @ 24−2
• x86: How to Connect a Secondary Disk and Boot @ 24−3
• x86: How to Create a Solaris fdisk Partition @ 24−4
• x86: How to Create Disk Slices and Label a Disk @ 24−5
• x86: How to Create File Systems @ 24−6
• x86: How to Install a Boot Block on a System Disk @ 24−7
For overview information about disk management, see CHAPTER 21, Disk Management (Overview).
A secondary disk doesn’t contain the root (/) and /usr file systems. It 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.
1. Connect the Disk and Boot System Disk x86: How to Connect a System
Disk and Boot @ 24−2
Connect the new disk and boot from a local or
remote Solaris CD.
2. Create Slices and Label the Create disk slices and label the disk if it has not x86: How to Create a Solaris
Disk already been done by the disk manufacturer. fdisk Partition @ 24−4 and
x86: How to Create Disk Slices
and Label a Disk @ 24−5
3. Create File Systems Create UFS file systems on the disk slices with x86: How to Create File Systems
the newfs command. You must create the root @ 24−6
(/) or /usr file system (or both) for a system disk.
4. Restore File Systems Restore the root (/) or /usr file system (or both) CHAPTER 35, Restoring Files
on the system disk. If necessary, restore file and File Systems (Tasks)
systems on the secondary disk.
5. Install Boot Block System Disk Only. Install the boot block on the x86: How to Install a Boot Block
root (/) file system, so the system can boot. on a System Disk @ 24−7
For x86 systems − Solaris slices are sometimes called partitions. This user guide uses the term slice, but
some Solaris documentation and programs may refer to a slice as a partition. To avoid confusion, Solaris
documentation tries to distinguish between fdisk partitions (which are supported only on Solaris(TM)
(Intel Platform Edition) and the divisions within the Solaris fdisk partition, which may be called slices or
partitions.
−gn Notifies logged−in users that they have n seconds before the system begins to shut down.
The fdisk menu displayed is dependent upon whether the disk has existing fdisk partitions. Determine
the next step using the following table.
Create a Solaris fdisk partition and preserve existing Step 7 x86: Example Creating
non−Solaris fdisk partition(s). a Solaris fdisk Partition
and Preserving an
Existing fdisk Partition
@ 24−3
Create a Solaris fdisk partition and additional non−Solaris fdisk Step 7 x86: Example Creating
partition(s). a Solaris fdisk Partition
and an Additional fdisk
Partition @ 24−4
6. Create and activate a Solaris fdisk partition spanning the entire disk by specifying y at the
prompt. Then go to step 14.
The recommended default partitioning for your disk is:
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:
8. Select option 1, Create a partition, to create an fdisk partition.
Total disk size is 2694 cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
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
9. Create a Solaris fdisk partition by selecting 1(=Solaris).
Indicate the type of partition you want to create
(1=SOLARIS, 2=UNIX, 3=PCIXOS, 4=Other, 8=DOSBIG)
(5=DOS12, 6=DOS16, 7=DOSEXT, 0=Exit) ? 1
10. Identify the percentage of disk to be reserved for the Solaris fdisk partition. Keep in mind the
size of any existing fdisk partitions when calculating this percentage.
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). nn
11. Activate the Solaris fdisk partition by typing y at the prompt.
Do you want this to become the Active partition? If so, it will be
activated each time you reset your computer or when you turn it on
again. Please type "y" or "n". y
The Enter Selection: prompt is displayed afer the fdisk partition is activated.
12. Select option 1, Create a partition, to create another fdisk partition.
4. Go into the partition menu (which lets you set up the slices).
format> partition
5. Display the current partition (slice) table.
partition> print
6. Start the modification process.
partition> modify
7. Set the disk to all free hog.
Choose base (enter number) [0]? 1
See Using the Free Hog Slice @ 21−1 for more information about the free hog slice.
8. Create a new partition table by answering yes when prompted to continue.
Do you wish to continue creating a new partition
table based on above table[yes]? yes
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.
11. Name the partition table.
Enter table name (remember quotes): "partition−name"
partition−name Is the name for the new partition table.
12. Label the disk with the new partition table when you have finished allocating slices on the new
disk.
Ready to label disk, continue? yes
13. Quit the partition menu.
partition> quit
14. Verify the new disk label with verify command.
format> verify
15. Quit the format menu.
format> quit
See CHAPTER 28, Mounting and Unmounting File Systems (Tasks) for more information about the
newfs command.
3. Verify the new file system by mounting it on an unused mount point.
Secondary Disk You may need to restore file systems on the new disk. Go to CHAPTER 35,
Restoring Files and File Systems (Tasks).
If you are not restoring file systems on the new disk, you are finished adding
a secondary disk. See CHAPTER 28, Mounting and Unmounting File
Systems (Tasks) for information on making the file systems available to
users.
/dev/rdsk/cwtxdys2 Is the raw device name that represents the whole disk.
3. Verify the boot blocks are installed by rebooting the system to run level 3.
# init 6
See CHAPTER 21, Disk Management (Overview) for a conceptual overview of when to use the
format utility.
Command or
Item Menu? Allows You To ...
disk Command Choose the disk that will be used in subsequent operations (known
as the current disk). All of the system’s drives are listed.
type Command Identify the manufacturer and model of the current disk. A list of
known drive types is displayed. Choose the Auto configure
option for all SCSI−2 disk drives.
partition Menu Create and modify slices. See The partition Menu @ 25−1 for
more information.
current Command Display the following information about the current disk:
• Device name and type
• Number of cylinders, alternate cylinders, heads and sectors
• Physical device name
format Command Format the current disk, using one of these sources of information
in this order:
1. Information found in the format.dat file
2. Information from the automatic configuration process
3. Information you enter at the prompt if there is no format.dat
entry
analyze Menu Run read, write, compare tests. See The analyze Menu @ 25−3
for more information.
defect Menu Retrieve and print defect lists. See The defect Menu @ 25−4 for
more information.
inquiry Command Print the vendor, product name, and revision level of the current
drive (SCSI disks only).
volname Command Label the disk with a new eight−character volume name.
modify Change all the slices in the slice table. This command is preferred over the
individual change ‘x’ partition commands.
label Write the slice map and label to the current disk.
Change Active partition Specify which partition will be used for booting. This identifies where the
first stage boot program will look for the second stage boot program.
Delete a partition Delete a previously created partition. This command will destroy all the data
in the partition.
Exit Write a new version of the partition table and exit the fdisk menu.
Cancel Exit 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>
refresh Read then write data on the disk without harming the data. Repairs defective blocks as a
default.
test Write a set of patterns to the disk without harming the data. Repairs defective blocks as a
default.
write Write a set of patterns to the disk then read the data on the disk back. Destroys existing data
on the disk. Repairs defective blocks as a default.
compare Write a set of patterns to the disk, read the data back, and compare it to the data in the write
buffer. Destroys existing data on the disk. Repairs defective blocks as a default.
purge Remove 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 section of the disk), then
writing an hex−bit pattern if the verification passes.
Repairs defective blocks as a default.
verify Write unique data to each block on the entire disk in the first pass. Read and verify 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>
grown Read the grown defect list (defects that have been detected during analysis) and update the
in−memory defect list.
both Read both the manufacturer’s and grown defect list and update the in−memory defect list.
The format.dat file shipped with the Solaris operating environment supports many standard disks. If your
disk drive is not listed in the format.dat file, you can choose to add an entry for it or allow format to
Note − Do not alter default entries. If you want to alter the default entries, copy the entry, give it a
different name, and make the modification to avoid confusion.
Structure
The format.dat contains specific disk drive information used by the format utility. Three items are
defined in the format.dat file:
• Search paths
• Disk types
• Slice tables
Syntax
The following syntax rules apply to the data file:
• The pound sign (#) is the comment character. Any text on a line after a pound sign is not interpreted
by format.
• Each definition in the format.dat file appears on a single logical line. If the definition is more than one
line long, all but the last line of the definition must end with a backslash (\).
• A definition consists of a series of assignments that have an identifier on the left side and one or more
values on the right side. The assignment operator is the equal sign (=). The assignments within a
definition must be separated by a colon (:).
• White space is ignored by format. If you want an assigned value to contain white space, enclose the
entire value in double quotes ("). This will cause the white space within the quotes to be preserved as
part of the assignment value.
• Some assignments can have multiple values on the right hand side. Separate values by a comma.
Keywords
CHAPTER 25 The format Utility (Reference) 25−299
The data file contains disk definitions that are read in by format when it is started. Each definition starts
with one of the following keywords: search_path, disk_type, and partition, which are described in
Table 94.
Table 94 − format.dat Keyword Descriptions
Keyword Use
search_path This keyword is no longer used in the format.dat file. Starting with the Solaris 2.0 release, the
format utility searchs the logical device hierarchy (/dev)so there is no need to set this keyword
to find a system’s disks.
disk_type Defines the controller and disk model. Each disk_type definition contains information concerning
the physical geometry of the disk. The default data file contains definitions for the controllers and
disks that the Solaris operating environment 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 format. The default data 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.
Disk Type
disk_type defines the controller and disk model. Each disk_type definition contains the physical geometry
of the disk. The default data file contains definitions for the controllers and disks that the Solaris operating
environment 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.
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 format is run. Enclose the name in double quotes to preserve any
white space in the name. Table 95 describes the identifiers that must also be assigned values in all
disk_type definitions.
Table 95 − Required disk_type Identifiers
Identifier Description
ctlr Valid controller type for the disk type. Currently, the supported values for this assignment are
SCSI and ISP−80 (IPI controller).
ncyl 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 The number of alternate cylinders in the disk type. These cylinders are used by format to
store information such as the defect list for the drive. You should always leave at least two
cylinders for alternates.
nhead The number of heads in the disk type. This number is used to calculate the boundaries of the
disk media.
nsect 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 assignment.
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 assignments may be necessary depending on the controller. Table 96 describes the assignments
required for SCSI controllers.
Table 96 − disk_type Identifiers for SCSI Controllers
Identifier Description
fmt_time A number indicating 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 onboard cache while format is operating. See the
controller manual for more information.
trks_zone A number that specified how many tracks you have per defect zone, to be used in alternate sector
mapping. See the controller manual for more information.
asect The number assigned to this parameter specifies how many sectors are available for alternate
mapping within a given defect zone. See the controller manual for more information.
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 this slice table can be attached to. Currently, the supported values for this
assignment are ISP−80 for IPI controllers and SCSI for SCSI controllers. The controller type
specified here must also be defined for the disk_type chosen above.
The other assignments in a slice definition describe the actual slice information. The identifiers are the
numbers 0 through 7. These assignments are optional. Any slice not explicitly assigned is set to 0 length.
The value of each of these assignments 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. Below are some
examples of slice definitions:
partition = "SUN0535" \
: disk = "SUN0535" : ctlr = SCSI \
: 0 = 0, 64400 : 1 = 115, 103600 : 2 = 0, 1044960 : 6 = 300, 876960
partition = "SUN0669" \
: disk = "SUN0669" : ctlr = SCSI \
: 0 = 0, 32400 : 1 = 40, 64800 : 2 = 0, 1307340 : 6 = 120, 1210140
partition = "SUN1.0G" \
: disk = "SUN1.0G" : ctlr = SCSI \
: 0 = 0, 32400 : 1 = 27, 64800 : 2 = 0, 2043600 : 6 = 81, 1946400
Location
The format utility learns of the location of your data file by the following methods.
1. If a filename is given with the −x command line option, that file is always used as the data file.
2. If the −x option is not specified, then format looks in the current directory for a file named
format.dat. If the file exists, it is used as the data file.
3. If neither of these methods yields a data file, format uses /etc/format.dat as the data file. This file is
shipped with the Solaris operating environment and should always be present.
Numbers
Several places in format require an integer as input. You must either specify the data or select one from
a list of choices. In either case, the help facility causes format to print the upper and lower limits of the
integer expected. Simply enter the number desired. The number is assumed to be in decimal format unless
a base is explicitly specified as part of the number (for example, 0x for hexadecimal).
The following are examples of integer input:
Enter number of passes [2]: 34
Enter number of passes [34] Oxf
Block Numbers
Whenever you are required to specify a disk block number, there are two ways to input the information:
• Block number as an integer
• Block number in the cylinder/head/sector format
You can specify the information as an integer representing the logical block number. You can specify the
integer in any base, but the default is decimal. The maximum operator (a dollar sign, $) can also be used
here to let format select the appropriate value. Logical block format is used by the SunOS disk drivers in
error messages.
The other way to specify a block number is by the cylinder/head/sector designation. In this method, you
must specify explicitly the three logical components of the block number: the cylinder, head, and sector
values. These values are still logical, but they allow you to define regions of the disk related to the layout
of the media.
If any of the cylinder/head/sector numbers are not specified, the appropriate value is assumed to be zero.
You can also use the maximum operator in place of any of the numbers and let format select the
appropriate value. Below 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 of the above formats. Also, the help facility
shows you the upper and lower bounds of the block number expected, in both formats.
Other Names
There are certain times in format when you must name something. In these cases, you are free to specify
any string desired for the name. If the name has white space in it, the entire name must be enclosed in
double quotes ("). Otherwise, only the first word of the name is used.
Help
The format utility provides a help facility you can use whenever format is expecting input. You can
request help about what information is expected by entering a question mark (?). The format utility
displays a brief description of what type of input is needed.
If you enter a ? at a menu prompt, a list of available commands is displayed.
CHAPTER 27, Creating File Systems Provides step−by−step procedures to create a UFS file system,
(Tasks) create and preserve a temporary file system (TMPFS), and create a
loopback file system (LOFS).
CHAPTER 28, Mounting and Provides step−by−step procedures to determine what file systems
Unmounting File Systems (Tasks) are mounted, how to mount files listed in the /etc/vfstab file, and
how to mount UFS, NFS, and PCFS (DOS) file systems.
CHAPTER 29, The Cache File System Provides overview information and step−by−step instructions for
(Tasks) using the Cache File System (CacheFS(TM)).
CHAPTER 30, Configuring Additional Provides step−by−step procedures for configuring additional swap
Swap Space (Tasks) space, monitoring swap resources, creating swap files and making
them available, and removing extra swap space.
CHAPTER 31, Checking File System Provides information on how the file system state is recorded, what
Integrity is checked by the fsck program, how to modify automatic boot
checking, and how to use the fsck program.
CHAPTER 32, File System Reference Provides file system reference information, including default
directories for the root (/) and /usr file systems, default directories
contained within the /kernel directory, and specifics for the mkfs
and newfs commands.
CHAPTER 26
Introduction
A file system is a structure of directories used to organize and store files. The term "file system" is used to
describe:
• A particular type of file system: disk−based, network−based, or virtual
• The entire file tree from the root directory downward
• The data structure of a disk slice or other media storage device
• A portion of a file tree structure that is attached to a mount point on the main file tree so that it is
accessible
Usually, you can tell from context which meaning is intended.
To identify the type for a particular file system, see Determining a File System’s Type @ 26−9.
These associations are not, however, restrictive. For example, CD−ROMs and diskettes can have UFS file
systems created on them.
Caution − Do not delete the files in the /proc directory. Deleting processes from the /proc directory is not
the best way to kill them. Remember, /proc files do not use disk space, so there is little reason to delete
files from this directory.
Command Description
clri(1M) Clears inodes
fsck(1M) Checks the integrity of a file system and repairs any damage found
labelit(1M) Lists or provides labels for file systems when copied to tape (for use by the
volcopy command only)
umountall(1M) Unmounts all file systems specified in a 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 critical for system operation, such as the kernel,
the device drivers, and the programs used to boot the system. It 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 directory (for
example, SPARC executables). Files (such as man pages) that can be
used on all types of systems are in /usr/share.
/export/home or /home NFS, UFS The mount point for users home directories, which store users work
files. By default /home is an automounted file system. On standalone
systems, /home may 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.
/opt NFS, UFS Mount point for optional, third−party software. On some systems,
/opt may be a UFS file system on a local disk slice.
/tmp TMPFS Temporary files, cleared each time the system is booted or the /tmp
file system is unmounted.
Swap Space
The Solaris operating environment 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, it is important to 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 30, Configuring Additional Swap Space (Tasks).
See The Structure of UFS File System Cylinder Groups @ 32−3 for more detailed information about
each type of block.
If you want to customize a file system using arguments with the newfs command or the mkfs command,
see CHAPTER 32, File System Reference for information about altering these parameters.
UFS Logging
UFS logging is the process of storing transactions (changes that make up a complete UFS operation) in a
log before the transactions are applied to the UFS file system. Once a transaction is stored, the transaction
can be applied to the file system later.
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
Now, say you wanted to access a local file system from the /opt file system that contains a set of
unbundled products.
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
@ 26−1. See CHAPTER 28, Mounting and Unmounting File Systems (Tasks) for detailed instructions
on how to perform these tasks.
Figure 6 − Mounting a File System
It is a good idea to unmount a file system before doing a complete backup of it. See CHAPTER 33,
Backing Up and Restoring File Systems (Overview) for more information about doing backups.
Note − File systems are automatically unmounted as part of the system shutdown process.
The following is an example of an /etc/vfstab file. Comment lines begin with #. This example shows an
/etc/vfstab file for a system with two disks (c0t0d0 and c0t3d0).
In Sample /etc/vfstab File @ 26−1, the last entry specifies that a UFS file system on the
/dev/dsk/c0t2d0s7 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
See CHAPTER 28, Mounting and Unmounting File Systems (Tasks) for information on how to share
resources. See the NFS Administration Guide for a complete description of NFS.
AutoFS
You can mount NFS file systems by using a client−side service called automounting, or AutoFS, which
enables a system to automatically mount and unmount NFS file systems whenever you access them. The
file system remains mounted as long as you remain in the file system and are using a file. If the file system
is not accessed for a certain period of time, it is automatically unmounted.
AutoFS provides the following features:
• NFS file systems don’t need to be mounted when the system boots, which saves booting time.
• Users don’t need to know the root password to mount and unmount NFS file systems.
• Network traffic may be reduced, since NFS file systems are only mounted when they are in use.
The AutoFS service is initialized by automount, which is run automatically when a system is booted.
The automount daemon, automountd, runs continuously and is responsible for the mounting and
unmounting of the NFS file systems on an as−needed basis. By default, the Solaris operating environment
automounts /home.
Local or remote file systems infrequently The mount command entered manually from the
command line.
Local file systems frequently The /etc/vfstab file, which will mount the file system
automatically when the system is booted in multi−user
state.
fs−table Specifies the absolute path to the file system table in which to search
for the file system’s type. If the file system is mounted, fs−table
should be /etc/mnttab. If it isn’t mounted, fs−table should be
/etc/vfstab.
Note − If you have the raw device name of a disk slice, you can use the fstyp(1M) command to determine a
file system’s type (if the disk slice contains a file system).
This chapter describes how to create UFS, TMPFS, and LOFS file systems. For UFS file systems, this
chapter shows you how to create a file system on a hard disk using the newfs command. Because TMPFS
and LOFS are virtual file systems, you actually "create" them by mounting them.
This is a list of the step−by−step instructions in this chapter.
• How to Create a UFS File System @ 27−2
• How to Create a TMPFS File System @ 27−1
• How to Create a LOFS File System @ 27−1
Note − For instructions on how to create UFS and DOS file systems on removable media, see CHAPTER
11, Guidelines for Using CDs and Diskettes (Overview).
Note − Solaris device names use the term slice (and the letter s in the device name) to refer to the slice
number. Slices used to be called "partitions" in the SunOS 4.0 or compatible releases.
You need to create UFS file systems only occasionally, because the Solaris operating environment
automatically creates them as part of the installation process. You need to create (or re−create) a UFS file
system when you:
• Add or replace disks
• Change the existing partitioning structure
• Do a full restoration on a file system
The newfs command is the standard way to create UFS file systems. The newfs(1M) command is a
convenient front−end to the mkfs(1M) command, which actually creates the new file system. On Solaris
systems, newfs parameter defaults, such as tracks per cylinder and sectors per track, are read from the
disk label that will contain the new file system, and the options you choose are passed to the mkfs
Minimum free space ((64 Mbytes/partition size) * 100), rounded down to the nearest integer and
limited between 1% and 10%, inclusively
−b size Specifies the file system block size. Default is 8192 blocks.
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 the next
step. If you specify the wrong slice, you will erase its contents when the new file system is created.
The fsck command checks the consistency of the new file system, reports problems it finds, and
prompts you before repairing the problems. See CHAPTER 31, Checking File System Integrity for
more information on fsck.
4. Look at the output from the mount command to verify that the TMPFS file system has been
created.
# mount −v
Caution − Be careful when creating LOFS file systems. Because these are virtual file systems, the
potential for confusing both users and applications is enormous.
mount−point Specifies the directory on which to mount the LOFS file system.
4. Look at the output from the mount command to verify that the LOFS file system has been
created.
# mount −v
Caution − Make sure the loopback entry is the last entry in the /etc/vfstab file. Otherwise, if the /etc/vfstab
entry for the loopback file system precedes the file systems to be included in it, the loopback file system
cannot be created.
For more information the /etc/vfstab file, see /etc/vfstab Field Descriptions @ 28−1.
This chapter describes how to mount and unmount file systems. This is a list of the step−by−step
instructions in this chapter.
• How to Determine Which File Systems Are Mounted @ 28−3
• How to Add an Entry to the /etc/vfstab File @ 28−2
• How to Mount Multiple File Systems Listed in the /etc/vfstab File @ 28−3
• How to Mount a File System Listed in the /etc/vfstab File @ 28−4
• How to Mount a UFS File System @ 28−1
• How to Mount an NFS File System @ 28−3
• x86: How to Mount a System V (S5FS) File System @ 28−4
• How to Mount a PCFS (DOS) File System From a Hard Disk @ 28−5
• How to Stop All Processes for a File System @ 28−3
• How to Unmount a File System @ 28−4
• How to Unmount File Systems Listed in the /etc/vfstab File @ 28−5
Local or remote file systems infrequently The mount command entered manually from the
command line.
Local file systems frequently The /etc/vfstab file, which will mount the file system
automatically when the system is booted in multi−user
state.
You can mount a CD−ROM containing a file system by simply inserting it into the drive (Volume
Management will automatically mount it). You can mount a diskette containing a file system by inserting
it into the drive and running the volcheck(1) command. See CHAPTER 11, Guidelines for Using CDs
and Diskettes (Overview) for more information.
Command Description
mount(1M) Mounts file systems and remote resources.
mountall(1M) Mounts all file systems specified in the /etc/vfstab file. The mountall command is
run automatically when entering multiuser run states.
The mount commands will not mount a read/write file system that has inconsistencies. If you receive an
error message from the mount or mountall command, you may need to check the file system. See
CHAPTER 31, Checking File System Integrity for information on how to check the file system.
The umount commands will not unmount a file system that is busy. A file system is considered busy if a
user is in a directory in the file system, or if a program has a file open in that file system.
hard | soft NFS Specifies the procedure if the server does not respond. soft
indicates that an error is returned. hard indicates that the
retry request is continued until the server responds. The
default is hard.
intr | nointr NFS Specifies whether keyboard interrupts are allowed to kill a
process hung while waiting for a response on hard−mounted
file systems. The default is intr (interrupts allowed).
largefiles | nolargefiles UFS Enables you to create file systems containing files larger than
2 Gbytes. The largefiles option means that a filesystem
mounted with this option may contain files larger than 2
Gbytes, but it is not a requirement. The default is largefiles.
logging | nologging UFS Enables logging for the file system. UFS logging is the
process of storing transactions (changes that make up a
complete UFS operation) into a log before the transactions
are applied to the UFS file system. Because the file system
can never become inconsistent, fsck can be bypassed,
which reduces the time to reboot a system if it crashes, or
after an unclean halt.
The log is allocated from free blocks on the file system,
and is sized approximately 1 Mbyte per 1 Gbyte of file
system, up to a maximum of 64 Mbytes. The default is
nologging.
m CacheFS, NFS, PCFS, Mounts the file system without making an entry in
S5FS, UFS /etc/mnttab.
noatime UFS Ignores access time updates on files, except when they
coincide with updates to the ctime or mtime. See stat(2).
This option reduces disk activity on file systems where
access times are unimportant (for example, a Usenet news
spool). The default is normal access time (atime) recording.
retry=n NFS Retries the mount operation when it fails. n is the number of
times to retry.
ro | rw CacheFS, NFS, PCFS, Specifies read/write or read−only. If you do not specify this
UFS, S5FS option, the default is read/write.
suid | nosuid CacheFS, HSFS, NFS, Allows or disallows setuid execution The default is to allow
S5FS, UFS setuid execution.
device to fsck The raw (character) device name that corresponds to the file system identified by the
device to mount field (for example, /dev/rdsk/c0t0d0s0). This determines the raw
interface that is used by fsck. Use a dash (−) when there is no applicable device, such as
for a read−only file system or a remote file system.
mount point The default mount point directory (for example, /usr).
FS type The type of file system identified by the device to mount field.
fsck pass The pass number used by fsck 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; non−UFS file systems
are checked. When the field contains a value greater than zero, the file system is
checked.
When the field contains a value of 1, the file system is checked sequentially. When
fsck is run on multiple UFS file systems that have fsck pass values greater than one
and the preen option ( −o p) is used, fsck automatcially checks the file systems on
different disks in parallel to maximize efficiency. Otherwise, the value of the pass
number does not have any effect.
The fsck pass field does not explicitly specify the order in which file systems are
checked.
mount at boot Set to yes or no for whether the file system should be automatically mounted by
mountall when the system is booted. Note that this field has nothing to do with AutoFS.
mount options A list of comma−separated options (with no spaces) that are used in mounting the file
system. Use a dash (−) to show no options. See Table 104 for a list of commonly used
mount options.
Note − You must have an entry in each field in the /etc/vfstab file. If there is no value for the field, be sure
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.
See Table 105 for detailed information about the /etc/vfstab field entries. Make sure that you:
• Separate each field with white space (a space or a tab).
• Enter a dash (−) if a field has no contents.
3. Save the changes.
The following example mounts the directory /export/man from the system pluto as an NFS file system on
mount point /usr/man. It does not specify a device to fsck or a fsck pass because it’s an NFS file system.
In this example, mount options are ro (read−only) and soft. For greater reliability, specify the hard
mount option for read/write NFS file systems.
#device device mount FS fsck mount
mount
#to mount to fsck point type pass at boot
options
If no options are specified, all file systems listed in the /etc/vfstab file with yes in the mount at boot
field are mounted.
−l Mounts all the local file systems listed in the /etc/vfstab file with yes in the
mount at boot field.
−r Mounts all the remote file systems listed in the /etc/vfstab file with yes in the
mount at boot field.
−F fstype Mounts all file systems of the specified type listed in the /etc/vfstab file with
yes in the mount at boot field.
All the file systems with a device to fsck entry are checked and fixed, if necessary, before mounting.
/dev/dsk/device−name Specifies the disk device name for the slice holding the file system (for
example, /dev/dsk/c0t3d0s7). See How to Display Disk Slice Information @
22−1 to get slice information for a disk.
mount−point Specifies the mount point of the file system you want to check for large files.
If large files exist within this file system, they must be removed or moved to another file system.
3. Unmount the file system.
# umount mount−point
4. Reset the file system state.
# fsck mount−point
5. Remount the file system with the nolargefiles option.
# mount −o nolargefiles mount−point
server:/directory Specifies the server’s host name that contains the shared resource, and the
/dev/dsk/device−name Specifies the disk device name of the slice holding the file system (for
example, /dev/dsk/c0t3d0s7). See How to Display Disk Slice Information @
22−1 to get slice information for a disk.
/dev/dsk/device−name Specifies the device name of the whole disk (for example, /dev/dsk/c0t0d0p0).
logical−drive Specifies either the DOS logical drive letter (c through z) or a drive number 1
through 24. Drive c is equivalent to drive 1 and represents the Primary DOS
slice on the drive; all other letters or numbers represent DOS logical drives
within the Extended DOS slice.
Note − File systems are automatically unmounted as part of the system shutdown procedure.
mount−point The name of the file system for which you want to stop processes.
Note − The root (/) and /usr file systems are special cases. The root (/) file system can be unmounted only
during a shutdown, since the system needs the root (/) file system to function.
1. Make sure you have met the prerequisites listed on Prerequisites @ 28−1.
2. Unmount the file system.
# umount mount−point
mount−point The name of the file system that you want to unmount. This can either be the
directory name where the file system is mounted, the device name path of the
file system, the resource for an NFS file system, or the loopback directory for
LOFS file systems.
All systems that are unmounted, except those that are busy.
3. For the file systems that were busy and not unmounted, make them available to be unmounted
as described in How to Stop All Processes for a File System @ 28−3.
4. Repeat Step 2 as needed until all file systems are unmounted.
The Cache File System (CacheFS) is a general purpose file system caching mechanism that improves NFS
server performance and scalability by reducing server and network load. Designed as a layered file system,
CacheFS provides the ability to cache one file system on another. In an NFS environment, CacheFS
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).
The following is a list of the step−by−step instructions in this chapter.
• How CacheFS Works @ 29−1
• Setting Up a Cached File System Task Map @ 29−2
• How to Create a Cache @ 29−1
• How to Specify a File System to Be Mounted in a Cache With mount @ 29−1
• How to Mount a File System in a Cache by Editing the /etc/vfstab File @ 29−2
• How to Mount a File System in a Cache With AutoFS @ 29−3
• How to Modify File Systems in a Cache @ 29−1
• How to Display Information About Cached File Systems @ 29−2
• How to Specify Consistency Checking on Demand @ 29−3
• How to Delete a Cached File System @ 29−4
• How to Check the Integrity of Cached File Systems @ 29−5
• CacheFS Statistics @ 29−13
• Prerequisites for Setting Up and Viewing the CacheFS Statistics @ 29−14
• Setting Up CacheFS Statistics Task Map @ 29−15
• How to Set Up the Logging Process @ 29−1
• Viewing the Cache Size @ 29−17
• How to View the Working Set (Cache) Size @ 29−1
• Viewing the Statistics @ 29−18
• How to View Cache Statistics @ 29−1
• The Cache Structure and Behavior @ 29−19
Note − You can mount only file systems that are shared. See share(1M) for information on sharing file
systems.
1. Create a Cache Use the cfsadmin command to create a cache. How to Create a Cache @ 29−1
Cache a file system by editing the /etc/vfstab How to Mount a File System in a
file. Cache by Editing the /etc/vfstab
File @ 29−2
Creating a Cache
Note − After you have created the cache, do not perform any operations within the cache directory
itself. This causes conflicts within the CacheFS software.
ExampleCreating a Cache
The following example creates a cache in the /local/mycache directory by using the default cache
parameter values.
# mkdir /local
# cfsadmin −c /local/mycache
Note − Caching of the root (/) and /usr file systems is not supported in CacheFS. To cache the root (/) and
/usr file systems, you must purchase the Solstice AutoClient product. For more information about the
AutoClient product, see the Solstice AutoClient 2.1 Administration Guide.
cache−directory Indicates the name of the directory where the cache resides. This is the same
name you specified when you created the cache in How to Create a Cache
@ 29−1.
options Specifies other mount options that you can include when mounting a file
system in a cache. See mount_cachefs(1M) for a list of CacheFS mount
options.
back−filesystem 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: /usr/openwin
4. Verify that the cache you created was actually mounted by using the cachefsstat(1M) command,
as follows:
# cachefsstat mount−point
For example:
# cachefsstat /docs
/docs
cache hit rate: 100% (0 hits, 0 misses)
consistency checks: 1 (1 pass, 0 fail)
modifies: 0
garbage collection: 0
The mount point is the cached file system you created. For more information about the
cachefsstat command, see CacheFS Statistics @ 29−13.
If the file system was not mounted in the cache, you will receive an error message similar to the
following:
# cachefsstat mount−point
cachefsstat: mount−point: not a cachefs mountpoint
The following example makes a CD−ROM (HSFS file system) available as a cached file system named
/docs. Because you cannot write to the CD−ROM, the ro argument is specified to make the cached file
system read−only. You must specify the backpath option because Volume Management automatically
mounts the CD−ROM when it is inserted. The mount point is in the /cdrom directory and is determined by
the name of the CD−ROM. The special device to mount is the same as the value for the backpath
command.
# mount −F cachefs −o backfstype=hsfs,cachedir=/local/mycache,ro backpa
th=/cdrom/cdrom_name
/cdrom/cdrom_name /docs
The following example uses the demandconst option to specify consistency checking on demand for
the NFS cached file system /docs, whose back file system is merlin:/docs. See Consistency Checking of
Cached File Systems With the Back File System @ 29−20 for more information.
# mount −F cachefs −o backfstype=nfs,cachedir=/local/mycache,demandcons
t merlin:/docs /docs
1. Modify the Cache Modify the cache behavior. How to Modify File Systems in a
Cache @ 29−1
2. Display Cache Information Display information about cached file systems How to Display Information
by using the cfsadmin command. About Cached File Systems @
29−2
4. Delete a Cache Delete cached file systems by using the umount How to Delete a Cached File
command and the cfsadmin command. System @ 29−4
5. Check File System Integrity Check the integrity of cached file systems by How to Check the Integrity of
using the fsck_cachefs command. Cached File Systems @ 29−5
Note − If you are using the /etc/vfstab file to mount file systems, you modify the cache by editing the
file systems options in the /etc/vfstab file. If you are using AutoFS, you modify the cache by editing
the file systems options in the AutoFS maps.
# shutdown −g30 −y
.
.
.
Type Cntrl−d to proceed with normal startup,
(or give root password for system maintenance):
# enter password:
.
.
.
# 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, demandcons
t merlin:/docs /docs
#
If you did not successfully remount the file system in the cache, the system displays an error message
similar to the following:
cachefsstat: /doc: not a cachefs mount point
server:/file−system /mount−point
3. To initiate consistency checking on a specific cached file system, use the cfsadmin command
with the −s option as follows:
# cfsadmin −s /mount−point
For more information about consistency checking, see Consistency Checking of Cached File Systems
With the Back File System @ 29−20.
−o noclean Forces a check on the cached file systems only. Does not make any repairs.
cache−directory Indicates the name of the directory where the cache resides.
filename Specifies the name of the file 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 several files specified to be packed in the cache.
$ cachefspack −p projects updates master_plan
Packing Lists
One of the features of the cachefspack command is the ability to pack packing lists. This saves the
time of having to specify each individual file that you want packed in the cache.
A packing list contains files or directories to be packed in the cache. If a directory is in the packing list, all
of its subdirectories and files will also be packed.
This means you want the software to read the packing list and pack files based on the information
specified in the packing list.
−f Specifies that you want to use a packing list.
−f Specifies that you want the packing list packed in the cache.
packing_list Indicates the name of the packing list that contains the LIST command with
the file or files you want treated as regular expressions.
The software will pack the file list.pkg into the cache and treat the file names defined in the LIST
command as regular expressions, and not as literal file names.
Note − The −s option must be used with the −f option. The −s option cannot be used alone.
Unpacking Files
You may need to remove, or unpack, a file from the cache. Perhaps you have some files or directories that
are a higher priority than others, so you need to unpack the less critical files. For example, you finished up
a project and have archived the files associated with that project. You are now working on a new project,
and therefore, a new set of files.
filename Specifies the name of the file or packing list you want unpacked in the cache.
For more information about the cachefspack command, see the man page.
cached−filename−or−directory Specifies the name of the file or directory for which to display information.
cachefspack Errors
You may see the following error messages when you use the cachefspack command.
cachefspack: pathname − can’t open directory: permission denied
CacheFS Statistics
CacheFS statistics enable you to:
• Determine an appropriate cache size
• Observe the performance of the cache
These two pieces of information will help you determine the trade−off between your cache size and the
desired performance of the cache.
The CacheFS statistics consist of three commands:
cachefslog Specifies the location of the log file. This command also displays where the
statistics are currently being logged, and enables you to halt logging. See
cachefslog(1M) for more information.
cachefswssize Interprets the log file to give a recommended cache size. See cachefswssize(1M)
for more information.
cachefsstat Displays statistical information about a specific file system or all cached file
systems. The information provided in the output of this command is taken directly
from the cache. See cachefsstat(1M) for more information.
Note − The CacheFS statistics commands can be issued from any directory. You must be superuser to
issue the cachefswssize(1M) command.
The statistics begin accumulating when you create the log file. When the work session length of time is up,
stop the logging by using the cachefslog −h command, as described in How to Stop the Logging
Process @ 29−3.
1. Set Up Logging Set up logging on a cached file system using the How to Set Up the Logging
cachefslog command. Process @ 29−1
2. Locate the Log File Locate the log file with the cachefslog How to Locate the Log File @
command. 29−2
3. Stop the Logging Process Stop the logging process with the cachefslog How to Stop the Logging Process
command. @ 29−3
4. View the Cache Size View the cache size using the How to View the Working Set
cachefswssize command. (Cache) Size @ 29−1
5. View the Cache Statistics View the statistics using the cachefsstat How to View Cache Statistics @
command. 29−1
CacheFS Logging
This section describes how to set up and view CacheFS 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 (cached file system) for which statistics are being
collected.
/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
high water size: 1472k
/usr/openwin
end size: 7168k
high water size: 7168k
/usr
end size: 4992k
high water size: 4992k
checks The number of consistency checks performed, followed by the number that passed, and the
number that failed.
If you do not specify the mount point, statistics for all mounted CacheFS file systems will be displayed.
threshblocks 85% Sets the number of blocks that must be available in the front file
system before CacheFS can claim more than the blocks specified
by minblocks.
maxfiles 90% Sets the maximum number of available inodes (number of files)
that CacheFS is allowed to claim within the front file system.
threshfiles 85% Sets the number of inodes (number of files) that must be
available in the front file system before CacheFS can claim more
than the files specified in minfiles.
Typically, you should not change any of these parameter values. They are set to default values to achieve
optimal cache behavior. However, you may want to modify the maxblocks and maxfiles settings if you
have some room in the front file system that is not used by the cache, and you wish to use it for some other
file system. You do this using the cfsadmin(1M) command. For example:
$ cfsadmin −o maxblocks=60
This is a list of the overview conceptual information and step−by−step instructions in this chapter.
• Swap Space and Virtual Memory @ 30−1
• Swap Space and the TMPFS File System @ 30−2
• How Do I Know If I Need More Swap Space? @ 30−2
• How Swap Space Is Allocated @ 30−3
• Planning for Swap Space @ 30−4
• Monitoring Swap Resources @ 30−5
• Adding More Swap Space @ 30−6
• Removing a Swap File From Use @ 30−7
malloc error O
Because the file system containing a swap file must be mounted before the swap file is activated, make
sure that the entry that mounts the file system comes before the entry that activates the swap file in the
/etc/vfstab file.
The used plus available figures equals total swap space on the system, which includes a portion of
physical memory and swap devices (or files).
You can use the amount of swap space available and used (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 swap space
available to see if it has decreased. Then you can identify what changes to the system might have caused
swap space usage to increase.
Keep in mind when using this command 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, it 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.
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 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.
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 creating an NFS swap file.
The swap file name is removed from the list so that it is no longer available for swapping. The file
itself is not deleted.
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 swap−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.
See CHAPTER 28, Mounting and Unmounting File Systems (Tasks) for more information.
This is a list of the conceptual information and step−by−step instructions in this chapter.
• Understanding How the File System State Is Recorded @ 31−1
• What fsck Checks and Tries to Repair @ 31−2
• Modifying Automatic Boot Checking @ 31−3
• Interactively Checking and Repairing a UFS File System @ 31−4
• Restoring a Bad Superblock @ 31−5
• Syntax and Options for the fsck Command @ 31−6
See "Troubleshooting File System Problems" in System Administration Guide, Volume II for information
about fsck error messages.
The UFS file system relies on an internal set of tables to keep track of inodes used and available blocks.
When these internal tables are not properly synchronized with data on a disk, inconsistencies result and file
systems need to be repaired.
File systems can be damaged or become inconsistent because of abrupt termination of the operating
system in these ways:
• Power failure
• Accidental unplugging of the system
• Turning the system off without proper shutdown procedure
• A software error in the kernel
File system corruption, while serious, is not common. When a system is booted, a file system consistency
check is automatically performed (with the fsck program). Most of the time, this file system check
repairs problems it encounters.
This chapter describes what the fsck program checks, and repairs and the fsck options. It also describes
the following tasks:
• How to modify the automatic checking done during booting
• How to find out if a file system needs to be checked
• How to check and repair a UFS file system interactively
• How to restore a bad superblock
The fsck error messages are covered in "Troubleshooting File System Problems" in System
Administration Guide, Volume II.
The fsck program places files and directories that are allocated but unreferenced in the lost+found
directory. The inode number of each file is assigned as the name. If the lost+found directory does not exist,
fsck creates it. If there is not enough space in the lost+found directory, fsck increases its size.
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 fsck on the raw root device. Then remount the root (/) file
system as read/write.
FSCLEAN If the file system was 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 the file system was 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) which 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 FSSTABLE. If the system crashes, the file system structure is stable, but
users may lose a small amount of data. File systems that are marked FSSTABLE can skip the
checking before mounting. The mount(2) system call will not mount a file system for
read/write if the file system state is not FSCLEAN or FSSTABLE.
Superblock
The superblock stores summary information, which is the most commonly corrupted item 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 will almost certainly be corrupted.
The superblock is checked for inconsistencies in:
• File system size
• Number of inodes
• Free−block count
• Free−inode count
Free Blocks
Free blocks are stored in the cylinder group block maps. fsck checks that all the blocks marked as free
are not claimed by any files. When all the blocks have been accounted for, fsck checks to see if the
number of free blocks plus the number of blocks claimed by the inodes equal the total number of blocks in
the file system. If anything is wrong with the block allocation maps, fsck rebuilds them, leaving out
Free Inodes
The summary information in the superblock contains a count of the free inodes within the file system. The
fsck program compares this count to the number of free inodes it finds within the file system. If the
counts do not agree, fsck replaces the count in the superblock with the actual free inode 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:
• Format and type
• Link count
• Duplicate block
• Bad block numbers
• Inode size
When the file system is created, a fixed number of inodes are set aside, but they are not allocated until they
are needed. An allocated inode is one that points to a file. An unallocated inode does not point to a file
and, therefore, should be empty. The partially allocated state means that the inode is incorrectly formatted.
An inode can get into this state if, for example, bad data is written into the inode list because of a hardware
failure. The only corrective action fsck can take is to clear the inode.
Link Count
Each inode contains a count of the number of directory entries linked to it. The fsck program verifies the
link count of each inode by examining the entire directory structure, starting from the root directory, and
calculating an actual link count for each inode.
Discrepancies between the link count stored in the inode and the actual link count as determined by fsck
may 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, fsck 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, fsck 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 fsck changes the link count of the inode to the actual count.
Duplicate Blocks
Each inode contains a list, or pointers to lists (indirect blocks), of all the blocks claimed by the inode.
Because indirect blocks are owned by an inode, inconsistencies in indirect blocks directly affect the inode
that owns the indirect block.
The fsck program 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, fsck 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 may 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 program prompts you to choose which inode should be kept and which should be cleared.
Inode Size
Each inode contains a count of the number of data blocks that it references. The number of actual data
blocks is the sum of the allocated data blocks and the indirect blocks. fsck computes the number of data
blocks and compares that block count against the number of blocks the inode claims. If an inode contains
an incorrect count, fsck prompts you to fix it.
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:
• Blocks already claimed by another inode
• Block numbers outside the range of the file system
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:
• 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. fsck can check the validity only
of directory data blocks.
Directories are distinguished from regular files by an entry in the mode field of the inode. Data blocks
associated with a directory contain the directory entries. Directory data blocks are checked for
Directory Unallocated
If the inode number in a directory data block points to an unallocated inode, fsck removes the directory
entry. This condition can occur if the data blocks containing the directory entries are modified and written
out but the inode does not get written out. This condition can occur if the CPU is halted without warning.
Disconnected Directories
The fsck program checks the general connectivity of the file system. If a directory is found that is not
linked to the file system, fsck 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.)
0 or greater The file system specific fsck command When the value is greater for UFS file
is called. systems, the file system is not checked.
1 or greater and fsck −o p The file system specific fsck The value can be any number greater than
is used automatically checks UFS file systems in 1.
parallel.
In preen mode, fsck allows only one active file system check per disk, starting a new check only after
the previous one is completed. fsck automatically uses the major and minor numbers of the devices on
which the file systems reside to determine how to check file systems on different disks at the same time.
When the fsck pass number is 1, file systems are checked sequentially, in the order they appear in the
/etc/vfstab file. Usually, the root (/) file system has the fsck pass set to 1.
Note − fsck does not use the fsck pass number to determine the sequence of file system checking.
In this command, the state flag in the superblock of the file system you specify is checked to see
whether the file system is clean or requires checking.
If you omit the device argument, all the UFS file systems listed in /etc/vfstab with a fsck pass value
greater than 0 are checked.
fsck may not be able to fix all errors in one execution. If you see the message FILE SYSTEM
STATE NOT SET TO OKAY, run the command again. If that does not work, see How to Fix a
UFS File System fsck Cannot Repair @ 31−2.
5. Rename and move any files put in the lost+found directory.
Caution − Be sure to use the −N option with newfs in the next step. If you omit the −N option, you
will create a new, empty file system.
special Specifies the mount point or raw device name of one or more
file systems. An entry for the mount point must exist in
/etc/vfstab. If you omit the special argument, entries in
/etc/vfstab with a specified fsck device and a fsck pass number
greater than zero are checked. If preening (−o p) is in effect
and more than one entry has an fsck pass number greater than
1, file systems on different disks are checked in parallel.
Directory Description
Directories in the root (/) file system:
/etc/fs Binaries organized by file system types for operations required before /usr is
mounted.
Directory Description
/etc/tm Trademark files; contents displayed at boot time
/sbin Essential executables used in the booting process and in manual system
failure recovery
/var/news Community service messages (note: not the same as USENET−style news)
/var/opt Root of a subtree for varying files associated with software packages
Table 120 − Default Directories for root (/) and /usr File Systems (Continued)
Directory Description
/var/spool/uucp Queued uucp jobs
/var/tmp Directory for temporary files; not cleared during boot sequence
/var/yp NIS databases (for backwards compatibility with NIS and unnecessary after
full transition to NIS+)
lib/fs File system type−dependent modules; not invoked directly by the user
lib/sa Scripts and commands for the system activity report package
lib/saf Auxiliary programs and daemons related to the service access facility
Table 121 − Default Directories for root (/) and /usr File Systems (Continued)
Directory Description
lib/uucp Auxiliary uucp−related programs and daemons
sadm Various files and directories related to system administration; see specifics
below
sbin/static Statically linked version of selected programs from /usr/bin and /usr/sbin
Directory Description
/platform Contains a series of directories, one per supported platform that need to reside
in the root (/) file system.
/platform/*/kernel Contains platform−dependent kernel components, including the file unix, the
core kernel that is platform dependent. See kernel(1M).
/usr/platform Contains platform−dependent objects that do not need to reside in the root (/)
file system. It contains objects which replace the contents of /usr/kvm, which
has been removed.
This section provides additional information about the organization and function of these blocks.
The superblock is located at the beginning of the disk slice, and is replicated in each cylinder group.
Because the superblock contains critical data, multiple superblocks are made when the file system is
created. Each of the superblock replicas is offset by a different amount from the beginning of its cylinder
group. For multiple−platter disk drives, the offsets are calculated so that a superblock appears on each
platter of the drive. That way, if the first platter is lost, an alternate superblock can always be retrieved.
Except for the leading blocks in the first cylinder group, the leading blocks created by the offsets are used
for data storage.
A summary information block is kept with the superblock. It is not replicated, but is grouped with the first
superblock, usually in cylinder group 0. The summary block records changes that take place as the file
system is used, and lists the number of inodes, directories, fragments, and storage blocks within the file
system.
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 type of the file
• Regular
• Directory
• Block special
• Character special
The array of 15 disk addresses (0 to 14) point 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 contents of
the file. 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, if they are
ever needed. @ 32−1 shows this chaining of address blocks starting from the inode.
Figure 8 − The File System Address Chain in a UFS System
Data Blocks
The rest of the space allocated to the file system is occupied by data blocks, also called storage blocks. The
size of these data blocks is determined at the time a file system is created. Data blocks are allocated, by
default, in two sizes: an 8−Kbyte logical block size, and a 1−Kbyte fragmentation size.
Free Blocks
Blocks 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, @ 32−1 shows a series of cylinder
groups in a generic UFS file system.
Figure 9 − A Typical UFS File System
Fragment Size
As files are created or expanded, they are allocated disk space in either full logical blocks or portions of
logical blocks called fragments. When disk space is needed to hold a data for a file, full blocks are
allocated first, and then one or more fragments of a block are allocated for the remainder. For small files,
allocation begins with fragments.
The ability to allocate fragments of blocks to files, rather than just whole blocks, saves space by reducing
fragmentation of disk space resulting 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.
Note − The upper bound may equal the full block size, in which case the fragment is not a fragment at all.
This configuration may 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.
Note − It is not necessary to specify the rotational delay ( −d option to newfs) for some devices.
Place blocks consecutively only if your system is fast enough to read them on the same disk rotation. If the
system is too slow, the disk spins past the beginning of the next block in the file and must complete a full
rotation before the block can be read, which takes a lot of time. You should try to specify an appropriate
value for the gap so that the head is located over the appropriate block when the next disk request occurs.
You can change the value of this parameter for an existing file system by using the tunefs command.
The change applies only to subsequent block allocation, not to blocks already allocated.
Optimization Type
Number of Files
The number of inodes determines the number of files you can have in the file system: one inode for each
file. The number of bytes per inode determines the total number of inodes created when the file system is
made: the total size of the file system divided by the number of bytes per inode. Once the inodes are
allocated, you cannot change the number without recreating the file system.
The default number of bytes per inode is 2048 bytes (2 Kbytes), which assumes the average size of each
file is 2 Kbytes or greater. Most files are larger than 2 Kbytes. 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 them. If you have too few inodes, you could reach the maximum number of files on a disk
slice that is practically empty.
Option Description
−v Displays the parameters that are passed to the mkfs command and creates the file
system, unless used with the −N option.
mkfs−options Use the following options to set the parameters passed to the mkfs command. The
options are listed below in the order they are passed to mkfs. Separate the options
with spaces without any preceding keywords.
−s size The size of the file system in sectors. The default is automatically determined
from the disk label.
−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 in bytes to use for data transfers. Specify the size of 4096 or
8192 (4 or 8 Kbytes). The default is 8192 bytes (8 Kbytes).
−f fragsize The smallest amount of disk space in bytes that is allocated to a file. Specify the
fragment size in powers of two in the range from 512 to 8192 bytes. The default is
1024 bytes (1 Kbyte).
−c cgsize The number of disk cylinders per cylinder group. This number must be in the
range 1 to 32. The default is 16.
−m free The minimum percentage of free disk space to allow. The default is ((64
Mbytes/partition size) * 100), rounded down to the nearest integer and limited
between 1% and 10%, inclusively.
−r rpm The speed of the disk, in revolutions per minute. The default is 3600. This
parameter is converted to revolutions per second before it is passed to mkfs.
−i nbpi The number of bytes per inode to use in computing how may inodes to create. The
default is 2048.
−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 blocks per disk cylinder (SCSI devices only) to reserve
for bad block placement. The default is 0.
−d gap (Rotational delay) The expected minimum number of milliseconds it takes the
CPU to complete a data transfer and initiate a new data transfer on the same disk
cylinder. The default is 4.
−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/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 mount, not by newfs or mkfs.)
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 to contain the file
system. This argument is required.
CHAPTER 34, Backing Up Files and Provides step−by−step instructions for backing up individual files
File Systems (Tasks) and complete file systems from local or remote devices.
CHAPTER 35, Restoring Files and File Provides step−by−step instructions for restoring individual files and
Systems (Tasks) complete file systems.
CHAPTER 36, The ufsdump and Describes how ufsdump works, and the syntax and options for the
ufsrestore Commands (Reference) ufsdump and ufsrestore commands.
CHAPTER 37, Copying UFS Files and Provides step−by−step instructions for copying file systems to disk,
File Systems (Tasks) for using the dd, cpio, and tar commands with different backup
media, and copying files with a different header format.
CHAPTER 38, Managing Tape Drives Provides step−by−step instructions for how to add a tape drive, how
(Tasks) to determine the type of tape drive, backup device names, and
working with tape drives and magnetic tape cartridges.
CHAPTER 33
This chapter provides guidelines and planning information on backing up and restoring complete file
systems using the ufsdump and ufsrestore commands.
This is a list of overview information in this chapter.
• Where to Find Backup and Restore Tasks @ 33−1
• Definition: Backing Up and Restoring File Systems @ 33−2
Back up complete file systems for all systems Solstice Backup(TM) software Solstice Backup 5.1
on a network from a server Administration Guide
Backup and restore a NIS+ master server nisbackup(1M) and Solaris Naming Administration
nisrestore(1M) commands Guide
Copy, list, and retrieve files on tape tar(1), cpio(1), or pax(1) CHAPTER 37, Copying UFS
Copy master disk to a clone disk dd(1M) command CHAPTER 37, Copying UFS
Files and File Systems (Tasks)
Restore complete file systems or individual ufsrestore(1M) command CHAPTER 35, Restoring Files
files from removable media to a working and File Systems (Tasks)
directory
/export/home The /export/home file system More often than root (/) or /usr, perhaps as
contains directories and often as once a day, depending on your site
subdirectories of all users on the needs.
standalone system.
/export , /var, or other file systems During installation of Solaris As your site requires.
software, you may have created
these file systems.
root (/) − partition 0[25 Indicates These file systems contain the Once a day to once a month depending on
the file systems created by default kernel, major commands, and your site’s needs.
when installing Solaris software.] executables.
root (/) − if you frequently add and
/export − partition 32 remove clients and hardware on the
network, you have to change important
/usr − partition 6 2 files in root (/), including the kernel
configuration file. In this case, you should
/export/home − partition 7 2 The /export/home file system Once a day to once a week.
contains the home directories and
subdirectories of all the users on
the system; its files are volatile.
With This
Command ... You Can ... Comments
ufsdump Back up complete or partial file systems to local The tape device can be on any system in the
or remote tape drives network to which the user has access. This
command works quickly because it is aware
of the structure of the UFS file system type,
and works directly through the raw device
interface.
Back up groups of systems over the network You can run ufsdump from one system on
from a single system each remote system through a remote shell
or remote login, and direct the output to the
system on which the drive is located. Or,
you can pipe the output to the dd command
or a file.
Keep a log of when each file system was backed Use the −u option.
up
Verify the contents of the tape against the source Use the −v option.
file system
Incremental Only files in the specified file Easier to retrieve small Finding which incremental
Note − In the following example, you could have used other numbers in the 1−9 range to produce the same
results. The key is having the same number each day, with any lower number on Friday. For example, you
could have specified levels 4, 4, 4, 4, 2 or 7, 7, 7, 7, 5.
Note − In the following example, you could have used the sequence 6,7,8,9 followed by 2, or 5,6,7,8
followed by 3. Remember, the number themselves have no defined meaning; you attribute meaning by
ordering them in a high/low sequence.
9 9 9 9 5
Week 1
9 9 9 9 5
Week 2
9 9 9 9 5
Week 3
9 9 9 9 5
Week 4
Table 131 shows how the contents of the tapes can change across two weeks using the previous schedule.
Each letter represents a different file.
Table 131 − Contents of Tapes for Daily/Weekly Cumulative Schedule
Tape Needs
With this schedule, you will need six tapes (if you want to reuse daily tapes), or nine tapes (if you want to
use four different daily tapes): one for the level 0, four for the Fridays, and one or four daily tapes.
9 9 9 9 3
Week 1
9 9 9 9 4
Week 2
9 9 9 9 5
Week 3
9 9 9 9 6
Week 4
Table 133 shows how the contents of the tapes can change across two weeks using the previous schedule.
Each letter represents a different file.
Table 133 − Contents of Tapes for Daily Cumulative/Weekly Incremental Backup Schedule
Tape Needs
With this schedule, you will need six tapes (if you want to reuse daily tapes), or nine tapes (if you want to
use four different daily tapes): one for the level 0, four for the Fridays, and one or four daily tapes.
If you need to restore a complete file system, you will need the following tapes: the level 0, all the Friday
tapes, and the most recent daily tape since the last Friday tape (if any).
3 4 5 6 2
Week 1
3 4 5 6 2
Week 2
3 4 5 6 2
Week 3
3 4 5 6 2
Week 4
Table 135 shows how the contents of the tapes can change across two weeks using the previous schedule.
Each letter represents a different file.
Table 135 − Contents of Tapes for Daily/Weekly Cumulative Backup Schedule
Tape Needs
With this schedule you will need at least nine tapes (if you want to reuse daily tapesnot recommended),
or 21 tapes (if you save weekly tapes for a month): one for the level 0, four for the Fridays, and four or 16
daily tapes.
If you need to restore the complete file system, you will need the following tapes: the level 0, the most
recent Friday tape, and 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 plan, you use 4n tapes (the number of tapes needed for four full backups of root (/), /usr, /export,
and /export/home), plus 24 additional tapes for the incremental backups of /export/home. This plan
assumes that each incremental backup uses one tape and you save the tapes for a month.
Here’s how this plan works:
1. On each Sunday, do a full backup (level 0) of root (/), /usr, /export, and /export/home. Save the level 0
tapes for at least 3 months.
2. On the first Monday of the month, use tape A to do a level 9 backup of /export/home. ufsdump
copies all files changed since the previous lower−level backup (in this case, the level 0 backup that
This plan lets you save files in their various states for a month. It requires many tapes, but ensures that
you have a library of tapes to draw upon. To reduce the number of tapes, you could reuse Tapes A−F
each week.
Need to minimize tapes Increase the level of incremental This means only changes from day to day are
backups done across the week. saved on each daily tape.
Increase the level of backups This means only changes from week to week
done at the end of the week. (rather than the entire month) are saved on the
weekly tapes.
Put each day’s and week’s This is done by using the no rewind option in
incremental backups onto the the ufsdump command.
same tape.
This chapter describes the procedures for backing up file systems using the ufsdump command.
For detailed information on syntax, options, and arguments for the ufsdump command, see CHAPTER
36, The ufsdump and ufsrestore Commands (Reference).
Preparing to Do Backups
Preparing to back up file systems begins with planning, which is described in CHAPTER 33, Backing
Up and Restoring File Systems (Overview) and covers choosing:
• A tape drive
• Which file systems to back up
• The type of backup (full or incremental)
• A backup schedule
This section describes other tasks you may need to perform before backing up file systems including:
• Finding names of file systems to back up
• Determining the number of tapes for a full backup
3. Divide the estimated size by the capacity of the tape to see how many tapes you need.
See Table 125 for a list of tape capacities.
Doing Backups
The following are general guidelines for performing backups:
• Use single−user mode or unmount the file system.
• Be aware that backing up file systems when there are directory−level operations (such as creating,
removing, and renaming files) and file−level activity occurring means that some data will not be
included in the backup.
• You can run the ufsdump command from a single system and remotely back up groups of systems
across the network through remote shell or remote login, and direct the output to the system on which
Note − Use the nisbackup command to backup a NIS+ master server running the Solaris 2.5 release or
compatible versions. See Solaris Naming Administration Guide for information on using this command.
b. On the tape server, verify that the host added to the /.rhosts file is accessible through the
name service.
5. Identify the device name of the tape drive.
The default tape drive is /dev/rmt/0.
6. Insert a tape that is not write protected into the tape drive.
Use the following table to select the most common options and arguments for the ufsdump
command. See CHAPTER 36, The ufsdump and ufsrestore Commands (Reference) for other
options and arguments.
8. If prompted, remove the tape and replace with the next volume.
9. Label each tape with the volume number, level, date, system name, disk slice, and file system.
10. Bring the system back to run level 3 by pressing Control−d.
11. Verify the backup was successful by using the ufsrestore command to display the tape
contents.
This command is described in CHAPTER 35, Restoring Files and File Systems (Tasks).
Note − Notice the SunOS 4.x−style device name (/dev/rst0) used with the ufsdump command.
# ufsdump 0ucf mars:/dev/rst0 /export/home
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Fri Oct 24 15:06:47 1997
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t3d0s7 (earth:/export/home) to (mars:/dev/r
st0).
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 19574 blocks (9.56MB)
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: level 0 dump on Fri Oct 24 15:06:47 1997
DUMP: Tape rewinding
DUMP: 19574 blocks (9.56MB) on 1 volume
DUMP: DUMP IS DONE
#
ufsrestore tf mars:/dev/rst0
2 .
3 ./lost+found
2688 ./kryten
5409 ./kryten/letters
5410 ./kryten/letters/letter1
5411 ./kryten/letters/letter2
5412 ./kryten/letters/letter3
2689 ./kryten/.profile
8096 ./kryten/memos
30 ./kryten/reports
Note − Notice that when you back up data on a system running SunOS 4.1.3 or a compatible version, you
must use the dump commandnot the ufsdump command.
# dump 0ucf pluto:/dev/rmt/0 /
DUMP: Date of this level 0 dump: Tue Oct 21 16:05:19 1997
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rsd2a (/) to /dev/rmt/0 on host pluto
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 8686 blocks (4.24MB) on 0.10 tape(s).
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: level 0 dump on Tue Oct 21 16:05:19 1997
DUMP: Tape rewinding
DUMP: 8690 blocks (4.24MB) on 1 volume
DUMP: DUMP IS DONE
# restore tf pluto:/dev/rmt/0
2 .
3 ./lost+found
3776 ./export
7552 ./home
11328 ./usr
15104 ./pcfs
3777 ./tftpboot
3778 ./tftpboot/tftpboot
3794 ./tftpboot/boot.sun4c.sunos.4.1.3
7553 ./etc
7554 ./etc/sendmail.cf
7555 ./etc/aliases
7556 ./etc/aliases.dir
7557 ./etc/aliases.pag
7558 ./etc/holidays
7559 ./etc/dumpdates
This chapter describes how to use the ufsrestore(1M) command to restore files and file systems that were
backed up using the ufsdump command. See CHAPTER 37, Copying UFS Files and File Systems
(Tasks) for information about other commands you can use to archive, restore, copy, or move files and file
systems.
Note − Do not restore files in the /tmp directory even temporarily. The /tmp directory is usually mounted
as a TMPFS file system and TMPFS does not support UFS file system attributes such as ACLs.
a Reads the table of contents from the online archive file instead of the
tape.
./path/filename Identifies the file name(s) you are looking for on the online archive. If
successful, ufsrestore will print out the inode number and file
name. If unsuccessful, ufsrestore will print an error message.
4. Insert the media containing the backups in the drive and use the ufsrestore command to
verify the correct media.
# ufsrestore tf device−name ./path/filename ./path/filename
Be sure to use the complete path for the filename(s). If a file is in the backup, its name and inode
number is listed. Otherwise, a message says it is not on the volume.
5. If you have multiple dump files on the same tape, use the s /dev/rmt/n option to position the
tape at the dump you want to use.
# ufsrestore tfs /dev/rmt/n tape_number
filename ... One or more individual file or directory names separated by spaces, for
example: ./export/home/user1/mail ./export/home/user2/mail.
6. Type the volume number where files are located and press Return.
Specify next volume #: 1
The file is restored to the current working directory.
7. To keep the mode of the current directory unchanged, type n and press Return at the set
owner/mode prompt.
set owner/mode for ’.’? [yn] n
8. Verify the restored files.
a. List the restored files and directories.
# ls −l
A list of files and directories is displayed.
b. Check the list to be sure all the files and directories you specified in the list have been
1. Become superuser.
2. If necessary, unmount the file system.
# umount /dev/rdsk/device−name
3. Create the new file system with the newfs(1M) command.
# newfs /dev/rdsk/device−name
You are asked if you want to construct a new file system on the raw device. Verify that the
device−name is correct so you don’t wipe out the wrong file system.
4. Confirm that the new file system should be created.
newfs: construct a new file system /dev/rdsk/cwtxdysz:(y/n)? y
The new file system is created.
5. Mount the new file system on a temporary mount point.
# mount /dev/dsk/device−name /mnt
6. Change to the /mnt directory.
# cd /mnt
You have changed to the mount−point directory.
7. Write−protect the tapes.
8. Insert the first volume of the level 0 tape into the tape drive.
9. Use the ufsrestore command to restore the files on the tapes.
# ufsrestore rvf /dev/rmt/n
The level 0 dump is restored. If the dump required multiple tapes, you will be prompted to load each
tape in order.
10. Remove the tape and load the next level tape in the drive.
Always restore tapes starting with 0 and continuing until you reach the highest level.
11. Repeat Step 7 through Step 10 for each level of dump, from the lowest to the highest level.
12. Verify the file system is restored.
# ls
13. Remove the restoresymtable file.
# rm restoresymtable
The restoresymtable file created by ufsrestore is removed.
14. Change to another directory.
# cd /
You should always do an immediate backup of a newly created file system, because ufsrestore
repositions the files and changes the inode allocation (the restored file system will appear to have
changed since the previous backup).
18. Mount the restored file system.
# mount /dev/dsk/device−name mount−point
The restored file system is mounted and available for use.
19. Verify the restored and mounted file system is available.
# ls mount−point
.
# mount /dev/dsk/c0t3d0s7 /export/home
# ls /export/home
Removes the restoresymtable file that is created and used by ufsrestore to check point the restore.
11. Change to the root (/) directory.
# cd /
12. Unmount the newly created file system.
# umount /mnt
13. Check the new file system.
# fsck /dev/rdsk/device−name
The restored file system is checked for consistency.
14. Create the boot blocks on the root partition by using the installboot(1M) command.
# installboot /usr/platform/‘uname−i‘/lib/fs/ufs/bootblk /dev/rdsk/
devicename
See Example Restoring the root ( / ) File System on a SPARC System @ 35−1 for an example of
using the installboot command on a SPARC system or Example Restoring the root ( / ) File
System on an x86 System @ 35−2 for an example of using the installboot command on an x86
system.
15. Insert a new tape in the tape drive.
16. Back up the new file system.
# ufsdump 0uf /dev/rmt/n /dev/rdsk/device−name
A level 0 backup is performed. Always do an immediate backup of a newly created file system
because ufsrestore repositions the files and changes the inode allocation.
17. Repeat steps 5 through 18 for the /usr file system, if necessary.
18. Reboot the system.
# init 6
The system is rebooted.
This chapter contains reference information on the ufsdump and ufsrestore commands.
This is a list of reference information in this chapter.
• How ufsdump Works @ 36−1
• Options and Arguments for the ufsdump Command @ 36−2
• The ufsdump Command and Security Issues @ 36−3
• Options and Arguments for the ufsrestore Command @ 36−4
Note − DAT devices and 8mm tape devices detect end−of−media. Cartridge tape devices and 1/2−inch
Copying Data
The ufsdump command copies data only from the raw disk slice. If the file system is still active,
anything in memory buffers is probably not copied. The backup done by ufsdump does not copy free
blocks, nor does it make an image of the disk slice. If symbolic links point to files on other slices, the link
itself is copied.
Note − The /etc/dumpdates file is a text file that can be edited, but edit it only at your own risk. If you
make changes to the file that do not match your archive tapes, you may not be able to find the tapes (or
files) you need.
Note − The dump−file argument can also point to a file on a local or remote disk, which, if used by
mistake, can fill up a file system.
Note − You must specify remote devices explicitly with the dump−file argument. In previous SunOS
releases, the rdump command directed the output to the remote device defined by the dumphost alias.
ufsdump does not have an rufsdump counterpart.
Note − The −v option (verify) does not work when the dump−file argument is standard output.
You can use the ufsdump and ufsrestore commands in a pipeline to copy a file system by writing to
the standard output with ufsdump and reading from the standard input with ufsrestore, as shown in
this example:
# ufsdump 0f − /dev/rdsk/c0t0d0s7 | (cd /home; ufsrestore xf −)
Note − When you use ufsdump to back up one or more directories or files (rather than a whole file
system), a level 0 backup is done. Incremental backups do not apply.
End−of−Media Detection
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 time you need to use the end−of−media options is when ufsdump does not understand the way
the device detects the end−of−media or you are going to restore the files on a system with an older version
of the restore command. To ensure compatibility with older versions of the restore command, the
size option can still force ufsdump to go to the next tape or diskette before reaching the end of the
current tape or diskette.
Enable you to back up files that are remotely mounted Files on the server must be backed up on the server itself.
from a server Users are denied permission to run ufsdump on files
they own that are located on a server.
arguments Identifies option arguments and may be multiple strings. The option letters
and the arguments that go with them must be in the same order
files−to−back−up Identifies the files to back up and these arguments must always come last.
Option Description
0−9 Backup level. Level 0 is for a full backup of the whole file system specified by
files−to−backup. Levels 1−9 are for incremental backups of files that have
changed since the last lower−level backup.
a archive−file Archive file. Store (archive) a backup table of contents in a specified file on the
disk. The file can be understood only by ufsrestore, which uses it to
determine whether a file to be restored is present in a backup file, and if so, on
which volume of the media it resides.
b factor Blocking factor. The number of 512−byte blocks to write to tape at a time.
d bpi Tape density. You need to use this option only when ufsdump cannot detect the
end of the media.
f dump−file Dump file. Write the files to the destination specified by dump−file instead of the
default device. If the file is specified as user@system:device, ufsdump 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 invoking the
command on the local system to access the remote system.
l Autoload. Use this option if you have an autoloading (stackloader) tape drive.
When the end of a tape is reached, this option takes the drive offline and waits up
to two minutes for the tape drive to be ready again. If the drive is ready within two
minutes, it continues. If it is not ready after two minutes, it prompts the operator
to load another tape.
n Notify. When intervention is needed, send a message to all terminals of all users
in the sys group.
s size Size. Specify the length of tapes in feet or number of 1024−byte blocks for
diskettes. You need to use this option only when ufsdump cannot detect the end
of the media.
S Estimate size of backup. Determine the amount of space that is needed to perform
the backup, without actually doing it, and output a single number indicating the
estimated size of the backup in bytes.
t tracks Tracks. Specify the number of tracks for 1/4−inch cartridge tape. You need to use
this option only when ufsdump cannot detect the end of the media.
u Update the dump record. For a completed backup on a file system, add an entry to
the /etc/dumpdates file. The entry indicates the device name for the file system’s
disk slice, the backup level (0−9), and the date. No record is written when you do
not use the u option or when you back up individual files or directories. If a
record already exists for a backup at the same level, it is replaced.
v Verify. After each tape or diskette is written, verify the contents of the media
against the source file system. If any discrepancies occur, prompt the operator to
mount new media, then repeat the process. Use this option on an unmounted file
system only, because any activity in the file system causes it to report
discrepancies.
w Warning. List the file systems appearing in /etc/dumpdates that have not been
backed up within a day. When you use this option all other options are ignored.
W Warning with highlight. Show all the file systems that appear in /etc/dumpdates
and highlight 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.
Command Syntax
The syntax of the ufsrestore command is:
ufsrestore [options][arguments][filename ...]
options Is a single string of one−letter option names. You must choose one and only
one of these options: i, r, R, t, or x.
arguments Follows the option string with the arguments that match the options. The
option names and the arguments that go with them must be in the same order.
Option Description
i Interactive. Runs ufsrestore in an interactive mode. In this mode, you can use
a limited set of shell−like commands to browse the contents of the media and
select individual files or directories to restore. See Commands for Interactive
Restore @ 36−3 for a list of available commands.
r Recursive. Restores the entire contents of the media into the current working
directory (which should be the top level of the file system). Information used to
restore incremental dumps on top of the full dump (e.g., restoresymtable) is also
included. To completely restore a file system, use this option to restore the full
(level 0) dump and each subsequent incremental dump. Although intended for a
new file system (one just created with the newfs command), files not on the
backup media are preserved.
R Resume restoring. Prompts for the volume from which to resume restoring and
restarts from a checkpoint. You rerun the ufsrestore command with this
option after a full restore (r option) is interrupted.
x [filename...] Extract. Selectively restores the files you specify by the filename argument.
t [filename...] Table of contents. Checks the files specified in the filename argument against the
media. For each file, lists the full file name and the inode number (if the file is
found) or indicates the file is not on the "volume" (meaning any volume in a
multivolume dump). If you do not enter the filename 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 specified in
filename, 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.
In addition to one of the options shown in Table 140, you can choose from the options shown in Table
141.
Table 141 − Additional Options for the ufsrestore Command
Option Description
a archive−file [filename...] Takes the dump table of contents from the specified archive−file instead of from
the media (first volume). You can use this option in combination with the t, i, or
x options to check for the files in the dump without having to mount any media. If
you use it with the x and interactive extract options, you will be prompted to
mount the appropriate volume before extracting the file(s).
b factor Blocking factor. Number of 512−byte blocks read from tape at a time. By default,
ufsrestore tries to figure out the block size that was used in writing the tape.
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,
ufsrestore reads from the remote device. You can also use the backup−file
argument to specify a file on a local or remote disk. If backup−file is ‘−’, the files
are read from standard input.
h Turns off directory expansion. Only the directory file you specify is extracted or
listed.
m Restores specified files into the current directory on the disk regardless of where
they are located in the backup hierarchy and renames them with their inode
number. For example, if the current working directory is /files, a file in the backup
named ./dready/fcs/test with inode number 42, is restored as /files/42. This option
is useful only when you are extracting a few files.
v Verbose. Displays the names and inode numbers of each file as it is restored.
y Continues when errors occur reading the media and tries to skip over bad blocks
instead of stopping and asking whether to continue. This option tells the command
to assume a yes response.
Option Description
ls [directory−name] Lists the contents of either the current directory or the specified directory.
Directories are marked by a / suffix and entries in the current list to be restored
(extracted) are marked by an * prefix. Inode numbers are shown if the verbose
option 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. Note that 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 revisions
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. Note that 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. Specify 1 when asked for a volume number for a
single−volume backup. If you are doing a multitape or multidiskette restore and
restoring a small number of files, start with the last tape or diskette instead.
pwd Displays the path name of the current working directory in the backup hierarchy.
verbose Turns on or off the verbose option (which can also be entered 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 using various
backup commands.
This is a list of the step−by−step instructions in this chapter.
• How to Clone a Disk ( dd ) @ 37−2
• How to Copy Directories Between File Systems ( cpio ) @ 37−1
• How to Copy Files to a Tape ( tar ) @ 37−1
• How to List the Files on a Tape ( tar ) @ 37−2
• How to Retrieve Files From a Tape ( tar ) @ 37−3
• How to Copy All Files in a Directory to a Tape ( cpio ) @ 37−2
• How to List the Files on a Tape ( cpio ) @ 37−3
• How to Retrieve All Files From a Tape ( cpio ) @ 37−4
• How to Retrieve Specific Files From a Tape ( cpio ) @ 37−5
• How to Copy Files to a Remote Tape Drive ( tar and dd ) @ 37−6
• How to Extract Files From a Remote Tape Drive @ 37−7
• How to Copy Files to a Single Formatted Diskette ( tar ) @ 37−2
• How to List the Files on a Diskette ( tar ) @ 37−3
• How to Retrieve Files From a Diskette ( tar ) @ 37−4
• How to Archive Files to Multiple Diskettes @ 37−5
• How to Create an Archive for Older SunOS Releases @ 37−1
• How to Retrieve bar Files From a Diskette @ 37−3
Transport files to other systems pax(1), tar(1), or cpio(1) Copying Files and
File Systems to Tape
@ 37−4
Copy files or file systems between disks dd(1M) How to Clone a Disk
( dd ) @ 37−2
tar No No Logical
dd Yes No Physical
The following sections describe the advantages and disadvantages of each method and provide examples
of how to use the commands.
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 specifying an appropriate
block size.
You can specify a device name in place of the standard input or the standard output or both. In this
example, 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 the standard input and output with this syntax:
$ dd if=input−file of=output−file
For example, to use the keyword=value pairs instead of the redirect symbols in the previous example, you
would type:
$ dd if=/floppy/floppy0 of=/tmp/output.file
of=/dev/rdsk/device−name Represents the overlap slice of the clone disk device, usually slice 2.
bs=blocksize Block size, such as 128 Kbytes or 256 Kbytes. A large block size
value will decrease the time to copy.
Note − The installboot command is not needed for the clone disk because the boot blocks are
copied as part of the overlap slice.
The cpio command is an archiving program that takes a list of files and copies them into a single, large
output file. It 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 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 cpio, you frequently use commands like ls and find to list and select the files you want to copy
and then pipe the output to the cpio command.
−depth Descends the directory hierarchy and prints file names on the way back up.
The files from the directory name you specify are copied, and symbolic links are preserved.
You may also specify the −u option. This option forces an unconditional copy. Otherwise older files
will not replace newer files. This may be useful if an exact copy of a directory is desired, and some of
the files being copied may already exist in the target directory.
4. Verify the copy was successful by displaying the destination directory contents.
# cd filesystem2
# ls
5. If appropriate, remove the source directory.
# rm −rf filesystem1
The tape drive and device name you use depend on the hardware and configuration for each system. See
Choosing Which Media to Use @ 38−1 for more information about tape drives and device names.
f /dev/rmt/n Indicates that the archive should be written to the specified device or file.
filename ... Indicates the files and directories you want to copy.
The file names you specify are copied to the tape, overwriting any existing files on the tape.
4. Remove the tape from the drive and write the names of the files on the tape label.
5. Verify that the files copied are on the tape using the tar command with the t option, which
displays the tape’s contents. See How to List the Files on a Tape ( tar ) @ 37−2 for more
information on listing files on a tar tape.
$ tar tvf /dev/rmt/n
v Used with the t option, and provides detailed information about the files on
the tape.
filename ... Indicates the files and directories you want to retrieve.
4. Verify the files are copied by listing the contents of the current directory.
$ ls −l
Note − The names of the files extracted from the tape must exactly match the names of the files stored on
the archive. If you have any doubts about the names or paths of the files, first list the files on the tape. See
How to List the Files on a Tape ( tar ) @ 37−2 for instructions.
filename ... Indicates the files and directories you want to copy.
cpio −oc Specifies that cpio should operate in copy−out mode ( −o) and
write header information in ASCII character format ( −c). This
ensures portability to other vendor’s systems.
All of the 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 copied is displayed.
3. Verify the files are copied to tape by using the following cpio command.
$ cpio −civt < /dev/rmt/0
4. Remove the tape from the drive and write the names of the files on the tape label.
−i Specifies that cpio should operate in copy−in mode (even though its only listing
files at this point).
−v Displays the output in a format similar to the output from the ls −l command.
−t Lists the table of contents for the files on the tape in the tape drive you specify.
Caution − Using absolute path names can be dangerous because you may overwrite existing files on your
system.
4. Verify the files are copied by listing the contents of the current directory.
$ ls −l
−v Displays the files as they are retrieved in a format similar to the output from
the ls command.
"*file" Specifies that all of the files that match the pattern are copied to the current
directory. You can specify multiple patterns, but each must be enclosed in
double quotation marks.
4. Verify the files are copied by listing the contents of the current directory.
If "test" is echoed back to you, you have permission to execute remote commands. If "Permission
denied" is echoed, check your setup as described in step 1 above.
3. To copy files to a remote tape drive use the tar and dd commands.
$ tar cf − files | rsh remotehost dd of=/dev/rmt/n obs=blocksize
tar cf Creates a tape archive and specifies the tape device.
| rsh remotehost Pipe the tar command’s output to a remote shell to copy the files.
4. Remove the tape from the drive and write the names of the files on the tape label.
| tar xvBpf − Pipes the output of the dd command to the tar command used to
restored the files.
Use the cpio command if you need to copy UFS files to multiple formatted diskettes. cpio recognizes
end−of−media and prompts you to insert the next volume.
Note − Using the cpio command to copy UFS files to multiple formatted diskettes is not a
straightforward procedure because of Volume Management.
Use double−sided high−density 3.5−inch diskettes (diskettes are marked "DS, HD").
The file names you specify are copied to the diskette, overwriting any existing files on the diskette.
6. Verify that the files copied are on the diskette using the tar command with the −t option,
which displays the diskette’s contents. See How to List the Files on a Diskette ( tar ) @ 37−3 for
more information on listing files.
The file names you specify are extracted from the diskette and placed in the current working directory.
113 blocks
$ cpio −iH bar < /tmp/test
cpio: Invalid header "bar" specified
USAGE:
cpio −i[bcdfkmrstuvBSV6] [−C size] [−E file] [−H hdr]
[−I file [−M msg]] [−R id] [patterns]
cpio −o[acvABLV] [−C size] [−H hdr] [−O file [−M msg]]
cpio −p[adlmuvLV] [−R id] directory
When you create an archive using different options, always write the command syntax on the media label
along with the names of the files or file system on the archive.
If you do not know which cpio options were used when an archive was created, all you can do is
experiment with different combinations of the options to see which ones allow the archive to be read.
See cpio(1) for a complete list of options.
You can perform backups using diskettes, but this is time−consuming and cumbersome.
The media 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.
Table 146 shows typical media used for backing up file systems and shows the storage capacity for each.
Table 146 − Media Storage Capacities
Diskette /vol/dev/rdiskette0/unlabeled
If you don’t specify the density, a tape drive will typically write at its "preferred" density, which usually
means the highest density it supports. Most SCSI drives can automatically sense 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, which 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.
By default, the drive writes at its "preferred" density, which is usually the highest density it supports. If
you do not specify a tape device, the command writes to drive number 0 at the default density the device
supports.
Currently, the only platforms capable of supporting the 64−bit Solaris 7 operating environment are systems
that have an UltraSPARC(TM) processor. Developing 64−bit applications on other platforms or previous
Solaris releases is not supported.
Note − Systems that have an UltraSPARC processor are referred to as UltraSPARC systems for the
remainder of this appendix.
Look for the 64−bit support option during the various Solaris 7 installation scenarios:
• For an initial installation using the Solaris interactive installation program, the 64−bit support option
is displayed on the Software Selection screen, which prompts for the type of system software to be
installed: End User, Developer, or Entire Distribution.
• For an upgrade using the Solaris interactive installation program, the 64−bit support option is
displayed on the Customize Software screen that appears prior to the start of the software upgrade.
• For an initial installation using Solaris Web Start, the 64−bit support option is displayed on the
Configure Solaris screen, which is found after pressing the Custom Install button.
• For an initial installation or upgrade using the custom JumpStart(TM) technology, 32−bit or 64−bit
support can be selected using the profile. Add one of the following keyword value pairs to the profile:
isa_bits 64
If the output of the uname −m command is sun4u, then the machine is an UltraSPARC system.
If you are running the Solaris 7 release, you can verify this by using the psrinfo command:
# psrinfo −v
Status of processor 0 as of: 02/10/98 14:25:55
Processor has been on−line since 01/30/98 15:10:29.
The sparcv9 processor operates at 168 MHz,
and has a sparcv9 floating point processor.
Status of processor 1 as of: 02/10/98 14:25:55
Processor has been on−line since 01/30/98 15:10:33.
The sparcv9 processor operates at 168 MHz,
and has a sparcv9 floating point processor.
If the processor type is sparcv9, the platform is capable of running the 64−bit Solaris operating
environment. This test does not work on previous versions of the psrinfo command, where all platforms
report the less precise sparc as the processor type.
The isainfo(1) command, (for instruction set architecture information), has two functions:
• It describes the supported applications of the running system (the isainfo −v command).
• It reports the number of bits supported by native applications on the running system, which can be
passed as a token to scripts (the isainfo −b command).
The output from a 64−bit UltraSPARC system running the 64−bit Solaris operating environment looks
like:
$ isainfo −b
64
The command returns 64 only. Even though a 64−bit UltraSPARC system is capable of running both types
of applications, 64−bit applications are the best kind of applications to run on a 64−bit system.
The uname −p output remains sparc or i386 to ensure that existing 32−bit applications continue to run
without interruption.
A user’s PATH environment variable does not need to change to use a 64−bit Solaris system. Although
most system utilities remain 32−bit applications, some are available in 64−bit versions. The 64−bit
command versions are automatically invoked by a command wrapper program that transparently starts the
correct version of the command based upon the capabilities of the running system.
Other issues to keep in mind when running applications in the 64−bit Solaris operating environment:
• If a 32−bit application reads kernel memory, it needs to be compiled as a 64−bit program because the
This output means the system is running the 64−bit Solaris kernel.
You cannot boot the 64−bit Solaris operating environment on a 32−bit Solaris system.
You can add 64−bit application tools (64−bit shared libraries) to 32−bit platforms if you want to develop
64−bit applications on a 32−bit system.