Sun System Admin Guide
Sun System Admin Guide
Volume 1
Copyright 2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, Californie 94303-4900 Etats-Unis. Tous droits réservés.
Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la
distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque
moyen que ce soit, sans l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu par des tiers, et
qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun.
Des parties de ce produit pourront être dérivées du système Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque
déposée aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd.
Sun, Sun Microsystems, le logo Sun, docs.sun.com, AnswerBook, AnswerBook2, SunOS, Solstice, Solstice AdminSuite, Solstice DiskSuite,
Solaris Solve, Java, JavaStation, DeskSet, OpenWindows, NFS et Solaris sont des marques de fabrique ou des marques déposées, ou
marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC sont utilisées sous licence
et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres pays. Les produits
portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc.Quantum Corporation riclame DLT
comme sa marque de fabrique aux Etats-Unis et dans d’autres pays.
L’interface d’utilisation graphique OPEN LOOK et SunTM a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés.
Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d’utilisation visuelle ou
graphique pour l’industrie de l’informatique. Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox,
cette licence couvrant également les licenciés de Sun qui mettent en place l’interface d’utilisation graphique OPEN LOOK et qui en outre
se conforment aux licences écrites de Sun.
CETTE PUBLICATION EST FOURNIE “EN L’ETAT” ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N’EST ACCORDEE, Y
COMPRIS DES GARANTIES CONCERNANT LA VALEUR MARCHANDE, L’APTITUDE DE LA PUBLICATION A REPONDRE A UNE
UTILISATION PARTICULIERE, OU LE FAIT QU’ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE
GARANTIE NE S’APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU.
Please
Recycle
Contents
Name Services 37
User ID Numbers 38
Passwords 40
Password Aging 41
Home Directories 42
3
Administer Passwords 48
Shell Features 58
Shell Environment 59
Locale Variables 64
Servers 97
Standalone Systems 98
JavaStation Client 98
IA: Booting From CD-ROM Without the Solaris Boot Diskette 102
Contents 5
Guidelines for Booting a System 104
H SPARC: How to Force a Crash Dump and Reboot the System 146
H SPARC: How to Boot the System With the Kernel Debugger (kadb) 147
H IA: How to Boot a System with the Kernel Debugger (kadb) 160
H IA: How to Force a Crash Dump and Reboot the System 161
Contents 7
12. The Boot Process (Reference) 163
16. Formatting and Using Diskettes From the Command Line (Tasks) 193
17. Using PCMCIA Memory Cards From the Command Line (Tasks) 217
Contents 9
H How to Copy or Move Information From a PCMCIA Memory Card 229
H How to Make Local PCMCIA Memory Cards Available to Other Systems 235
Volume Management Supplies Convenient Mount Points for Easier Access 242
Contents 11
23. Managing Devices Topics 277
Contents 13
Introduction 322
Definition 328
Contents 15
H IA: How to Connect a System Disk and Boot 377
H How to Label a Device with a UDF File System and Volume Name 414
How the File System Commands Determine the File System Type 421
Contents 17
UFS Logging 424
AutoFS 429
H How to Mount a PCFS (DOS) File System From a Hard Disk 455
Prerequisites 457
H How to Mount a File System in a Cache by Editing the /etc/vfstab File 468
Contents 19
H How to Check the Integrity of Cached File Systems 475
Consistency Checking of Cached File Systems With the Back File System 496
Contents 21
H How to See If a File System Needs Checking 519
Default Directories for root (/) and /usr File Systems 529
Inodes 539
Contents 23
Preparing to Restore Files and File Systems 583
H How to Restore the root (/) and /usr File Systems 595
H How to Copy Files to a Remote Tape Drive (tar and dd) 631
Contents 25
H How to Retrieve Files From a Diskette (tar) 636
Index 647
27
How the System Administration
Volumes Are Organized
Here is a list of the topics covered by the three volumes of the System
Administration Guides.
Typeface or
Symbol Meaning Example
AaBbCc123 The names of commands, files, and Edit your .login file.
directories; on-screen computer output
Use ls −a to list all files.
Shell Prompt
This section provides instructions for managing users and groups. This section
contains these chapters.
33
34 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 2
This chapter provides guidelines and planning information for managing user
accounts and groups. It also provides overview information about setting up user
accounts and groups in a network environment. This chapter 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 concept information in this chapter.
4 “What Are User Accounts and Groups?” on page 36
4 “Guidelines for Managing User Accounts” on page 37
4 “Guidelines for Managing Groups” on page 43
4 “Tools for Managing User Accounts and Groups” on page 44
4 “Where User Account and Group Information Is Stored” on page 49
4 “Customizing a User’s Work Environment” on page 56
For step-by-step instructions on managing user accounts and groups, see Chapter 3.
35
See “Role-Based Access Control” in System Administration Guide, Volume 2 for more
information.
Component Description
User initialization files Shell scripts that control how the user’s
working environment is set up when a user
logs in to a system.
Also, when you set up a user account, you can add the user to predefined groups of
users. A typical use of groups is to set up file and directory access only to users who
are part of a group (using the group permissions on a file or directory).
For example, you might have a directory containing top secret files that only a few
users should be able to access. You could set up a group called topsecret that
include the users working on the top secret project, and you could set up the top
secret files with read permission for the topsecret group. That way, only the users
in the topsecret group would be able to read the files.
There is also a special type of user account called a role, which is used to give
selected users special privileges. See “Role-Based Access Control” in System
Administration Guide, Volume 2 for more information.
Name Services
If you are managing user accounts for a large site, you might 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.
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 might be delivered to the alias
rather than to the actual user.
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 UID, “wipe the slate clean” so the new user is not
affected by attributes set for a former user. For example, a former user might have
been denied access to a printer—by being included in a printer deny list—but that
attribute might not be appropriate for the new user. If need be, you can use duplicate
UIDs in an NIS+ domain if the supply of unique UIDs is exhausted.
NFSTM SunOSTM 4.0 NFS NFS server and client code truncates large
Interoperability software and UIDs and GIDs to 16 bits. This can create
compatible versions security problems if SunOS 4.0 and
compatible machines are used in an
environment where large UIDs and GIDs are
being used. SunOS 4.0 and compatible
systems require a patch.
Name Service NIS name service Users with UIDs above 60000 can log in or
Interoperability File-based name use the su command on systems running the
service 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 do not display
Manager correctly if the OpenWindowsTM File
Manager is used with the extended file
listing display option.
60003 or greater 4 Users in this category logging into systems running Solaris
2.5 and compatible releases and the NIS or files name service
get a UID and GID of nobody.
65535 or greater 4 Solaris 2.5 and compatible releases systems running the NFS
version 2 software see UIDs in this category truncated to 16
bits, creating possible security problems.
4 Users in this category using the cpio command (using the
default archive format) to copy file see an error message for
each file and the UIDs and GIDs are set to nobody in the
archive.
4 SPARC based systems: Users in this category running SunOS
4.0 and compatible applications see EOVERFLOW returns
from some system calls, and their UIDs and GIDs are
mapped to nobody.
4 IA based systems: Users in this category running
SVR3-compatible applications will probably see EOVERFLOW
return codes from system calls.
4 IA based systems: If users in this category attempt to create
a file or directory on a mounted System V file system, the
System V file system returns an EOVERFLOW error.
262144 or greater 4 Users in this category using the cpio command (using -H
odc format) or the pax -x cpio command to copy files see
an error message returned for each file, and the UIDs and
GIDs are set to nobody in the archive.
1000000 or greater 4 Users in this category using the ar command have their
UIDs and GIDs set to nobody in the archive.
2097152 or greater 4 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.
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 become disabled.
Another way to customize user accounts is through role-based access control. See
“Role-Based Access Control” in System Administration Guide, Volume 2 for more
information.
If You Are The Recommended And You Will Need To Start This Tool
Managing Users and Tool Is ... ... See ...
Groups ...
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. The table below describes the Solaris command used to manage user accounts
and groups if you are not using AdminSuite 2.3 or Admintool.
nisclient
NIS useradd
make
None useradd
NIS usermod
make
None usermod
nisclient
NIS userdel
make
None userdel
NIS useradd -D
make
None useradd -D
make
sort
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 is
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.
username:password:uid:gid:comment:home-directory:login-shell
For example:
username Contains the user or login name. User names should be unique
and consist of 1-8 letters (A-Z, a-z) and numerals (0-9). The first
character must be a letter, and at least one character must be a
lowercase letter. User names cannot contain underscores or
spaces.
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 2–13 contains a description of
shell features.
root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
(continued)
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
listen:x:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
username:password:lastchg:min:max:warn:inactive:expire
For example:
rimmer:86Kg/MNT/dGu.:8882:0::5:20:8978
lastchg Indicates the number of days between January 1, 1970, and the
last password modification date.
expire Contains the absolute date when the user account expires. Past
this date, the user cannot log in to the system.
group-name:group-password:gid:user-list
For example:
bin::2:root,bin,daemon
group-name Contains the name assigned to the group. For example, members of
the chemistry department in a university might be called chem.
Group names can have a maximum of eight characters.
gid Contains the group’s GID number. It must be unique on the local
system, and should be unique across the entire organization. Each
GID number must be a whole number between 0 and 60002.
Numbers under 100 are reserved for system default group accounts.
User defined groups can range from 100 to 60000. (60001 and 60002
are reserved and assigned to nobody and noaccess, respectively.)
root::0:root
other::1:
bin::2:root,bin,daemon
sys::3:root,bin,sys,adm
adm::4:root,adm,daemon
uucp::5:root,uucp
mail::6:root
tty::7:root,tty,adm
lp::8:root,lp,adm
nuucp::9:root,nuucp
staff::10:
daemon::12:root,daemon
sysadmin::14:root
nobody::60001:
noaccess::60002:
nogroup::65534:
other 1
noaccess 60002
nogroup 65534
TABLE 2–11 User Initialization Files for Bourne, C, and Korn Shells
The Solaris environment provides default user initialization files for each shell in the
/etc/skel directory on each system, as shown in the table below.
C /etc/skel/local.login
/etc/skel/local.cshrc
You can use these files as a starting point and modify them to create a standard set
of files that provide the work environment common to all users, or you can modify
them to provide the working environment for different types of users. See “How to
Customize User Initialization Files” on page 72 for step-by-step instructions on how
to create sets of user initialization files for different types of users.
When you use Admintool to create a new user account and select the create home
directory option, the following files are created, depending on which login shell is
selected:
Bourne and The /etc/skel/local.profile file is copied into the user’s home
Korn directory and renamed .profile.
If you use the useradd command to add a new user account and specify the
/etc/skel directory by using the −k and −m options, all three /etc/skel/local*
and /etc/skel/.profile files are copied into the user’s home directory. At this
point, you’ll need to rename them to whatever is appropriate for the user’s login
shell.
source /net/machine-name/export/site-files/site-init-file
. /net/machine-name/export/site-files/site-init-file
4 To make a user’s home directory available anywhere on the network, always refer
to the home directory with the variable $HOME. For example, use $HOME/bin; do
not use /export/home/username/bin. $HOME works when the user logs in to
another system, when home directories are automounted.
Shell Features
The table below lists basic shell features that each shell provides, which can help you
determine what you can and can’t do when creating user initialization files for each
shell.
Shell Environment
A shell maintains an environment that includes a set of variables defined by the
login program, the system initialization file, and the user initialization files. In
addition, some variables are defined by default. A shell can have two types of
variables:
4 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.
4 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.
If You Want to Set a User’s Environment Then Add the Following Line to the User
Variables for The ... Initialization File ...
Example:
MAIL=/var/mail/ripley;export MAIL
The table below describes environment and shell variables you might want to
customize in a user initialization file. For more information about variables used by
the different shells, see sh(1), ksh(1), or csh(1).
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). No built-in behavior
of the shell depends on this variable. It’s only a useful variable for
branching within shell scripts.
Variable Description
CDPATH (or Sets a variable used by the cd command. If the target directory of the
cdpath in the C cd command is specified as a relative path name, the cd command
shell) first looks for the target directory in the current directory (“.”). If the
target is not found, the path names listed in the CDPATH variable are
searched consecutively until the target directory is found and the
directory change is completed. If the target directory is not found, the
current working directory is left unmodified. For example, the CDPATH
variable is set to /home/jean, and two directories exist under /
home/jean: bin and rje. If you are in the /home/jean/bin
directory and type cd rje, you change directories to /home/jean/
rje, even though you do not specify a full path.
HOME (or home in Sets the path to the user’s home directory.
the C shell)
LOGNAME Defines the name of the user currently logged in. The default value of
LOGNAME is set automatically by the login program to the user name
specified in the passwd file. You should only need to refer to (not
reset) this variable.
Variable Description
PATH (or path in Lists, in order, the directories that the shell searches to find the program
the C shell) to run when the user types a command. If the directory is not in the
search path, users must type the complete path name of a command.
The default PATH is automatically defined and set as specified in
.profile (Bourne or Korn shell) or .cshrc (C shell) as part of the
login process.
The order of the search path is important. When identical commands
exist in different locations, the first command found with that name is
used. For example, suppose that PATH is defined (in Bourne and Korn
shell syntax) as PATH=/bin:/usr/bin:/usr/sbin:$HOME/bin
and a file named sample resides in both /usr/bin and /home/
jean/bin. If the user types the command sample without specifying
its full path name, the version found in /usr/bin is used.
PS1 Defines the shell prompt for the Bourne or Korn shell.
SHELL (or shell in Sets the default shell used by make, vi, and other tools.
the C shell)
TERMINFO Specifies the path name for an unsupported terminal that has been
added to the terminfo file. Use the TERMINFO variable in /etc/
profile or /etc/.login.
TERM (or term in Defines the terminal. This variable should be reset in /etc/profile
the C shell) or /etc/.login. When the user invokes an editor, the system looks
for a file with the same name as the definition of this environment
variable. The system searches the directory referenced by TERMINFO to
determine the terminal characteristics.
TZ Sets the time zone, which is used to display dates, for example, in the
ls -l command. If TZ is not set in the user’s environment, the system
setting is used; otherwise, Greenwich Mean Time is used.
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
Value Locale
de German
fr French
it Italian
japanese Japanese
korean Korean
sv Swedish
tchinese Taiwanese
setenv LANG DE
In a Bourne- or Korn-shell user initialization file, you would add the following:
The user mask can be set with a three-digit octal value. The first digit sets
permissions for the user; the second sets permissions for group; the third sets
permissions for other (also referred to as “world”). Note that if the first digit is zero,
it is not displayed. For example, if umask is set to 022, 22 is displayed.
To determine the umask value you want to set, subtract the value of the permissions
you want from 666 (for a file) or 777 (for a directory). The remainder is the value to
use with the umask command. For example, suppose you want to change the default
mode for files to 644 (rw-r--r--). The difference between 666 and 644 is 022, which
is the value you would use as an argument to the umask command.
You can also determine the umask value you want to set by using the table below,
which shows the file and directory permissions that are created for each of the octal
values of umask.
0 rw- rwx
1 rw- rw-
2 r-- r-x
3 r-- r--
4 -w- -wx
5 -w- -w-
6 --x --x
umask 000
Example—.profile File
1
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/ccs/bin:.
MAIL=/var/mail/$LOGNAME 2
NNTPSERVER=server1 3
4
MANPATH=/usr/share/man:/usr/local/man
PRINTER=printer1 5
6
umask 022
7
export PATH MAIL NNTPSERVER MANPATH PRINTER
Example—.cshrc File
# @(#)site.login
main:
echo "Application Environment Selection"
echo ""
echo "1. Application, Version 1"
echo "2. Application, Version 2"
echo ""
echo -n "Type 1 or 2 and press Return to set your
application environment: "
switch ($choice)
case "1":
setenv APPHOME /opt/app-v.1
breaksw
case "2":
setenv APPHOME /opt/app-v.2
endsw
This site initialization file could be referenced in a user’s .cshrc file (C shell users
only) with the following line:
source /net/server2/site-init-files/site.login
In this line, the site initialization file is named site.login and is located on a
server named server2. This line also assumes that the automounter is running on
the user’s system.
This chapter describes the procedures for setting up and maintaining user accounts
and groups.
This is a list of the step-by-step instructions in this chapter.
4 “How to Customize User Initialization Files” on page 72
4 “How to Start Admintool” on page 74
4 “How to Add a Group” on page 75
4 “How to Add a New User Account” on page 76
4 “How to Share a User’s Home Directory” on page 77
4 “How to Mount a User’s Home Directory” on page 79
4 “How to Modify a Group” on page 81
4 “How to Delete a Group” on page 82
4 “How to Modify a User Account” on page 82
4 “How to Disable a User Account” on page 84
4 “How to Change a User’s Password” on page 85
4 “How to Change Password Aging for a User Account” on page 86
4 “How to Delete a User Account” on page 88
4 “How to Restart Solaris User Registration” on page 91
4 “How to Disable User Registration” on page 91
For overview information about Managing User Accounts and Groups, see Chapter 2.
69
Becoming Superuser (root)
Most administrative tasks such as adding users require that you log in as root
(UID=0) first. The root account is also known as the superuser account because it’s
used to make system changes and can override user file protection in emergency
situations.
The superuser account should be used only to perform administrative tasks to
prevent indiscriminate changes to the system.
You can either log into the system as superuser or use the su(1M) command to
change to the superuser account.
If you are using role-based access control, you must assume a role (either superuser
or some other role) to perform administrative tasks. Roles are assumed by using the
su command; you cannot log in to a role directly. See “Role-Based Access Control”
in System Administration Guide, Volume 2 for more information.
% su
Password: root_password
#
The pound sign (#) is the Bourne shell prompt for the superuser account.
4 Log in as superuser on the system console.
1. Customize User Optional. Set up user initialization files “How to Customize User
Initialization Files (.cshrc, .profile, .login), so you can Initialization Files” on page 72
provide new users with consistent
environments.
2. Add a Group Optional. To help administer users, add “How to Add a Group” on
groups by using the Groups main window. page 75
4. Share the User’s Home Share the user’s home directory, so the
“How to Share a User’s Home
Directory directory can be remotely mounted from the
Directory” on page 77
user’s system.
5. Mount the User’s Home Manually mount the user’s home directory
“How to Mount a User’s Home
Directory on the user’s system by using the mount
Directory” on page 79
command.
Item Description
User Name:
UID:
Secondary Groups:
Comment:
Default Shell:
Mounting Method:
Mail Server:
Department Name:
Department Administrator:
Manager:
Employee Name:
Employee Title:
Employee Status:
Employee Number:
Start Date:
3. Copy the default user initialization files into the directories you created for
different types of users.
# cp /etc/skel/local.cshrc /shared-dir/skel/user-type/.cshrc
# cp /etc/skel/local.login /shared-dir/skel/user-type/.login
# cp /etc/skel/local.profile /shared-dir/skel/user-type/.profile
Note - If the account has profiles assigned to it, then the user has to launch a
special version of the shell called a profile shell to use commands (with any
security attributes) that are assigned to the profile. There are three profile shells
corresponding to the types of shells: pfsh (Bourne shell), pfcsh (C shell), and
pfksh (Korn shell).
4. Edit the user initialization files for each user type and customize them based
on your site’s needs.
See “Customizing a User’s Work Environment” on page 56 for a detailed
description on the ways to customize the user initialization files.
6. Verify the permissions for the user initialization files are correct with the
ls -la command.
2. Start Admintool.
$ admintool &
Example—Starting Admintool
The Users main window enables you to manage user account information.
4. Type the name of the new group in the Group Name text box.
5. Type the group ID for the new group in the Group ID text box.
The group ID should be unique.
7. Click OK.
The list of groups displayed in the Groups window is updated to include the new
group.
5. Click OK.
The list of user accounts displayed in the Users main window is updated to
include the new user account.
# /etc/init.d/nfs.server start
# share
5. Determine your next step based on whether the file system containing the
user’s home directory is already shared.
# shareall -F nfs
This command executes all the share commands in the /etc/dfs/dfstab file,
so you do not have to wait to reboot the system.
# share
3. Edit the /etc/vfstab file and create an entry for the user’s home directory.
# mkdir -p /export/home/user-name
# 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.
2. Select the group entry you want to modify from the Groups window.
5. Click OK.
The group information displayed in the Groups window is updated.
Example—Modifying a Group
The following example adds the users r2d2, holly, and kryten to the staff
group.
2. Select the group entry you want to delete from Groups window.
4. Click OK.
The group entry is deleted from the Groups window.
2. Select the user account entry to modify from the Users window.
5. Click OK.
6. To verify that the modifications were made, double-click the modified user
account entry in the Users window, then click Cancel to close the window
without making any modifications.
1. Start Admintool, if it’s not already running. Select Users from the Browse
menu, if necessary.
See “How to Start Admintool” on page 74 for more information.
5. Click OK.
6. Verify that you have disabled the user account by attempting to log in with the
disabled user account.
2. Select the user account entry that needs the password changed.
5. Click OK.
2. Select the user account entry that needs its password aging changed.
5. Click OK.
2. Select the user account entry to remove from the Users window.
4. (Optional) Click the check box to delete the user’s home directory and its
contents.
Completing the Solaris User Registration process provides access to Solaris Solve, an
exclusive web site that offers valuable Solaris product information and solutions—all
in one convenient location. It provides a quick and easy method for getting the most
recent information on what’s happening around the latest Solaris release. Solaris
Solve also provides a preview to additional Sun contract and service opportunities.
Basically, the steps for completing Solaris User Registration and accessing Solaris
Solve are:
1. Fill in the electronic Solaris User Registration profile.
2. Submit the profile by email or print the profile to fax or mail.
3. Create your login ID and password to access the Solaris Solve site.
Even if you do not access the Solaris Solve site immediately, we recommend that
you create your Solaris Solve login ID and password during the Solaris User
Note - Solaris User Registration is not invoked if the system administrator or user is
logged in as superuser.
4 Clicking the Registration icon in the Application Manager’s desktop tools folder
(Common Desktop Environment desktop only)
The following table describes problems that might occur when you try to register,
and actions required to resolve these conflicts.
The registration form failed to initialize: Web Check for missing registration files.
page window displays and requests that
user see system administrator to resolve
problem preventing registration setup.
The form could not be emailed: Dialog box Check to see if email is configured correctly.
displays and requests that user see system Also check if CDE is on user’s system since
administrator to resolve problem. 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 Check to see if the printer is configured
displays and requests that user see system correctly. Alternatively, the user can email
administrator to resolve problem. form.
The form could not be saved: Dialog box Check the user’s home directory. Required
displays and verifies that registration action depends on the system’s
succeeded; however, the registration configuration.
information cannot be recalled when
updating registration in the future.
You forgot your Solaris Solve login ID and Send a mail message describing the problem
password. to [email protected] or see “How to
Restart Solaris User Registration” on page 91
% cd $HOME/.solregis
% rm uprops
% /usr/dt/bin/solregis &
This section provides a conceptual overview for managing server and client support
in the Solaris environment. This section contains this chapter.
93
94 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 5
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.
4 “What Are Servers and Clients?” on page 95
4 “What Does Support Mean?” on page 96
4 “Overview of System Types” on page 96
Note - AutoClientTM and diskless systems are not supported in the Solaris 8 release.
See Solstice AdminSuite 2.3 Administration Guide for information on managing
existing client systems.
95
4 Client – A system that uses remote services from a server. Some clients have
limited disk storage capacity, or perhaps none at all, and they have to rely on
remote file systems from a server to function.
Other clients might use remote services (such as installation software) from a
server, but they don’t rely on a server to function. A standalone system, which has
its own hard disk containing the root (/), /usr, and /export/home file systems
and swap space, is a good example of this type of client.
/usr
/home
/opt
/export/home
/export/root
/export/home
Servers
A server system has the following file systems:
4 The root (/) and /usr file systems, plus swap space
4 The /export, /export/swap, and /export/home file systems, which support
client systems and provide home directories for users
4 The /opt directory or file system for storing application software
Servers can also contain the following software to support other systems:
4 Solaris CD image and boot software for networked systems to perform remote
installations
4 JumpStartTM directory for networked systems to perform custom JumpStart
installations
Note - A standalone system requires sufficient disk space to hold the four necessary
file systems.
JavaStation Client
The JavaStationTM is a client designed for zero administration. This client optimizes
JavaTM ; 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.
This section provides instructions for shutting down and booting systems running
the Solaris release. This section contains these chapters.
99
100 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 7
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.
4 “What’s New in Shutting Down and Booting a System?” on page 101
4 “Where to Find Shutting Down and Booting Tasks” on page 102
4 “Shutting Down and Booting Terminology” on page 103
4 “Guidelines for Shutting Down a System” on page 103
4 “Guidelines for Booting a System” on page 104
4 “Performing a Reconfiguration Boot” on page 104
4 “When to Shut Down a System” on page 105
4 “When to Boot a System” on page 106
101
Booting a System Over the Network With DHCP
Dynamic Host Configuration Protocol (DHCP) functionality has been added to boot
a system over the network in this Solaris release. The previous network boot
technology based on RARP/bootparams is still available.
A DHCP server must have been installed and configured in your network before you
can use DHCP booting. For information on setting up a DHCP server, see
“Configuring DHCP Service” in System Administration Guide, Volume 3.
For information on booting a SPARC based system over the network, see “SPARC:
How to Boot a System Over the Network” on page 142. For information on booting
an IA based system over the network, see “IA: How to Boot a System Over the
Network” on page 156.
The Solaris boot diskette is still available for the systems that do not support this
feature.
See Solaris 8 (Intel Platform Edition) Installation Guide for information on booting
IA based systems with or without the boot diskette.
4 Interactive boot – You are prompted to provide information about how the
system is booted, such as the kernel and device path name.
4 Reconfiguration boot – The system is reconfigured to support newly added
hardware or new pseudo devices.
4 Recovery boot – The system is hung or an invalid entry is prohibiting the
system from booting successfully or from allowing users to log in.
4 Run level 3 – Means that all system resources are available and users can log
in. By default, booting a system brings it to run level 3, which is used for
normal day-to-day operations. Also known as multiuser level with NFS
resources shared.
4 Run level 6 – Stops the operating system and reboots to the state defined by
the initdefault entry in the /etc/inittab file.
4 Run level 0 – Means the operating system is shut down and it is safe to turn off
power. Bringing a system to run level 0 is needed whenever the system is
moved or hardware is added or removed.
4 Run levels are fully described in Chapter 8.
If You Are ... Change To This Run Level ... See ...
If You Are ... Change To This Run Level ... See ...
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.
4 “How to Determine a System’s Run Level” on page 110
4 “How to Use a Run Control Script to Stop or Start a Service” on page 116
4 “How to Add a Run Control Script” on page 117
4 “How to Disable a Run Control Script” on page 118
This is a list of overview information in this chapter.
4 “Run Levels” on page 109
4 “The /etc/inittab File” on page 111
4 “Run Control Scripts” on page 115
4 “Run Control Script Summaries” on page 119
Run Levels
A system’s run level (also known as an init state) defines what services and resources
are available to users. A system can be in only one run level at a time.
The Solaris environment has eight run levels, which are described in the following
table. The default run level is specified in the /etc/inittab file as run level 3.
109
TABLE 8–1 Solaris Run Levels
Run
Level Init State Type Use This Level ...
$ who -r
Use the who -r command to determine a system’s current run level for any level
except run level 0.
Field Description
action How the process specified in the process field is to be run. Possible
values include: initdefault, sysinit, boot, bootwait, wait,
and respawn.
1 ap::sysinit:/sbin/autopush -f /etc/iu.ap
2 ap::sysinit:/sbin/soconfig -f /etc/sock2path
3 fs::sysinit:/sbin/rcS sysinit >/dev/msglog 2<>/dev/msglog </dev/console
4 is:3:initdefault:
5 p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/...
6 sS:s:wait:/sbin/rcS >/dev/msglog 2<>/dev/msglog </dev/
console
7 s0:0:wait:/sbin/rc0 >/dev/msglog 2<>/dev/msglog </dev/
console
8 s1:1:respawn:/sbin/rc1 >/dev/msglog 2<>/dev/msglog </dev/
console
9 s2:23:wait:/sbin/rc2 >/dev/msglog 2<>/dev/msglog </dev/
console
10 s3:3:wait:/sbin/rc3 >/dev/msglog 2<>/dev/msglog </dev/
console
11 s5:5:wait:/sbin/rc5 >/dev/msglog 2<>/dev/msglog </dev/
console
12 s6:6:wait:/sbin/rc6 >/dev/msglog 2<>/dev/msglog </dev/
console
13 fw:0:wait:/sbin/uadmin 2 0 >/dev/msglog 2<>/dev/msglog </dev/
console
14 of:5:wait:/sbin/uadmin 2 6 >/dev/msglog 2<>/dev/msglog </dev/
console
15 rb:6:wait:/sbin/uadmin 2 1 >/dev/msglog 2<>/dev/msglog </dev/
console
16 sc:234:respawn:/usr/lib/saf/sac -t 300
17 co:234:respawn:/usr/lib/saf/ttymon -g -h -p "‘uname -n‘ console login: "
-T terminal-type -d /dev/console -l console -m ldterm,ttcompat
(continued)
a. Identify the initdefault entry, which defines the default run level (3).
b. Execute any process entries that have sysinit in the action field so that any
special initializations can take place before users login.
c. Execute any process entries that have 3 in the rstate field, which matches
the default run level, 3.
See init(1M) for a detailed description of how the init process uses the
inittab file.
The following table describes the key words used for run level 3’s action field.
The following table describes the processes (or commands) executed at run level 3.
/usr/sbin/shutdown Shuts down the system. The init process runs the
shutdown command only if the system has received
a powerfail signal.
/sbin/rcS Mounts and checks root (/), /usr, /var, and /var/
adm file systems.
4 rc0
4 rc1
4 rc2
4 rc3
4 rc5
4 rc6
4 rcS
For each rc script in the /sbin directory, there is a corresponding directory named
/etc/rcn.d that contains scripts to perform various actions for that run level. For
example, /etc/rc2.d contains files used to start and stop processes for run level 2.
# ls /etc/rc2.d
K07dmi S70uucp S75cron S91afbinit
K07snmpdx S71ldap.client S75flashprom S91ifbinit
K28nfs.server S71rpc S75savecore S92volmgt
README S71sysid.sys S76nscd S93cacheos.finish
S01MOUNTFSYS S72autoinstall S80PRESERVE S94ncalogd
S05RMTMPFILES S72inetsvc S80lp S95IIim
S20sysetup S72slpd S80spc S95amiserv
S21perf S73cachefs.daemon S85power S95ocfserv
S30sysid.net S73nfs.client S88sendmail S99audit
S40llc2 S74autofs S88utmpd S99dtlogin
S47asppp S74syslog S89bdconfig
S69inet S74xntpd S90wbem
The /etc/rcn.d scripts are always run in ASCII sort order. The scripts have names
of the form:
[KS][0-9][0-9]*
Files 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 8–5.
# /etc/init.d/filename stop
3. Restart functionality.
# /etc/init.d/filename start
4. Use the pgrep command to verify whether the service has been stopped or
started.
# pgrep -f service
# /etc/init.d/nfs.server stop
# pgrep -f nfs
#
# /etc/init.d/nfs.server start
# pgrep -f nfs
141
143
245
247
# pgrep -f nfs -d, | xargs ps -fp
daemon 141 1 40 Jul 31 ? 0:00 /usr/lib/nfs/statd
root 143 1 80 Jul 31 ? 0:01 /usr/lib/nfs/lockd
root 245 1 34 Jul 31 ? 0:00 /usr/lib/nfs/nfsd -a 16
root 247 1 80 Jul 31 ? 0:02 /usr/lib/nfs/mountd
See the README file in each /etc/rcn.d directory for more information on naming
run control scripts. The procedure below describes how to add a run control script.
# cp filename /etc/init.d
# chmod 0744 /etc/init.d/filename
# chown root:sys /etc/init.d/filename
# cd /etc/init.d
# ln filename /etc/rc2.d/Snnfilename
# ln filename /etc/rcn.d/Knnfilename
4. Use the ls command to verify that the script has links in the specified
directories.
2. Rename the script by adding an underscore (_) to the beginning of the new file.
# cd /etc/rcn.d
# mv filename _filename
# ls
# _filename
Note - Many of the system services and applications that are started at run level 2
depend on what software is installed on the system.
4 Cleans up sharetab
4 Starts nfsd
4 Starts mountd
4 If the system is a boot server, starts rarpd, rpc.bootparamd, and
rpld
4 Starts snmpdx (Solstice Enterprise AgentsTM process).
/sbin/rc5 and / Runs the /etc/rc0.d/K* scripts to perform the following tasks:
sbin/rc6
/sbin/rcS Runs the /etc/rcS.d scripts to bring the system up to run level S.
The following tasks are performed from these scripts:
This chapter describes the procedures for shutting down systems. This is a list of the
step-by-step instructions in this chapter.
4 “How to Determine Who Is Logged in to a System” on page 126
4 “How to Shut Down a Server” on page 126
4 “How to Shut Down a Standalone System” on page 130
4 “How to Turn Off Power to All Devices” on page 132
This is a list of the overview information in this chapter.
4 “When to Shut Down the System” on page 123
4 “How to Shut Down a System” on page 124
4 “When to Turn Off Power to Devices” on page 125
4 “Notifying Users of System Down Time” on page 125
For overview information about the available run levels, see Chapter 8.
123
4 Performing file system maintenance, such as a backup
See Chapter 7 for a complete list of system administration tasks requiring a system
shutdown.
For information on using your system’s power management features, see Using
Power Management.
reboot An executable that syncs the Not recommended; use the init
disks and passes booting command instead.
instructions to the uadmin
system call, which, in turn,
stops the processor.
$ who
$ who
1
holly console May 7 07:30
kryten pts/0 2 May 7 07:35 (starbug) 4
3
lister pts/1 May 7 07:40 (bluemidget)
# who
A list of all logged-in users is displayed. You might want to send mail or
broadcast a message to let users know that the system is being shut down.
If you used the shutdown -y command, you will not be prompted to continue.
6. After you have finished the system administration tasks, press Control-d to
return to the default run system level.
7. Use the following table to verify the system is at the run level specified in the
shutdown command.
If the System Was The SPARC Based System The IA Based System
Brought To ... Prompt Should Be ... Prompt Should Be ...
# who
root console Jul 14 13:53
# shutdown -g180 -y
# who
root console Jul 14 14:01
rimmer pts/0 Jul 14 14:03 (starbug)
pmorph pts/1 Jul 14 14:04 (bluemidget)
# shutdown -i0 -g300 -y
Shutdown started. Wed Jul 14 14:05:03 MDT 1999
(continued)
See “How to Turn Off Power to All Devices” on page 132 if you are bringing the
system to run level 0 to turn off power to all devices.
# who
root console Jul 14 14:14
rimmer pts/0 Jul 14 14:15 (starbug)
pmorph pts/1 Jul 14 14:15 (bluemidget)
# shutdown -i6 -g120 -y
Shutdown started. Wed Jul 14 14:16:08 MDT 1999
(continued)
# init run-level
3. Use the following table to verify the system is at the run level specified in the
init command.
If the System Was Brought The SPARC Based System The IA Based System
To ... Prompt Should Be ... Prompt Should Be ...
# init 0
#
INIT: New run level: 0
The system is coming down. Please wait.
.
.
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” on page 132 if you are bringing the
system to run level 0 to turn off power to all devices.
# init s
#
INIT: New run level: S
The system is coming down for administration. Please wait.
Unmounting remote filesystems: /vol nfs done.
Print services stopped.
syslogd: going down on signal 15
Killing user processes: done.
INIT: SINGLE USER MODE
See “How to Shut Down a Server” on page See “How to Shut Down a Standalone
126. System” on page 130.
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.
This chapter describes procedures for using the OpenBootTM PROM monitor and
procedures for booting a SPARC based system to different run levels.
This is a list of the step-by-step instructions in this chapter.
4 “SPARC: How to Switch to the ok Prompt” on page 134
4 “SPARC: How to Find the PROM Release for a System” on page 134
4 “SPARC: How to Change the Default Boot Device” on page 134
4 “SPARC: How to Reset the System” on page 137
4 “SPARC: How to Boot a System to Run Level 3 (Multiuser State)” on page 138
4 “SPARC: How to Boot a System to Run Level S (Single-User State)” on page 139
4 “SPARC: How to Boot a System Interactively” on page 140
4 “SPARC: How to Boot a System Over the Network” on page 142
4 “SPARC: How to Boot a System for Recovery Purposes” on page 143
4 “SPARC: How to Stop the System for Recovery Purposes” on page 145
4 “SPARC: How to Force a Crash Dump and Reboot the System” on page 146
4 “SPARC: How to Boot the System With the Kernel Debugger (kadb)” on page 147
For overview information about the boot process, see Chapter 12. For information on
troubleshooting booting problems, see “What to Do If Rebooting Fails” in System
Administration Guide, Volume 2.
For step-by-step instructions on booting an IA based system, see Chapter 11.
133
SPARC: Using the Boot PROM
System administrators typically use the PROM level to boot a system. Occasionally,
however, you might need to change the way the system works, such as resetting
which device to boot from or running hardware diagnostics, before the system is
brought to a multiuser state.
Changing the default boot device is necessary to add a new drive to the system
either permanently or temporarily, change the network boot strategy, or if you want
to temporarily boot a standalone system from the network.
See monitor(1M) or eeprom(1M) for a complete list of PROM commands.
> n
ok
ok banner
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #nnnnnnnn.
Ethernet address 8:0:20:a5:d1:3b, Host ID: nnnnnnnn.
# init 0
> n
ok
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
ok reset
# init 0
#
INIT: New run level: 0
.
.
.
The system is down.
syncing file systems... done
Program terminated
ok setenv boot-device net
boot-device = net
ok printenv boot-device
boot-device net disk
ok reset
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #nnnnnnnn.
Ethernet address 8:0:20:a3:d54:4b, Host ID: nnnnnnnn.
ok reset
The self-test program, which runs diagnostic tests on the hardware, is executed and
the system is rebooted.
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 8 for a description of run levels.
ok boot
The automatic boot procedure displays a series of startup messages, and brings
the system to run level 3.
ok boot
SPARCstation 10 (1 X 390Z50)
ROM Rev. 2.14, 32 MB memory installed, Serial #number.
Ethernet address number, Host ID: number.
ok boot -s
# who -r
. run-level 3 Jun 10 15:27 3 0
4. To bring the system up to multiuser state after the system maintenance task is
performed, press Control-d.
ok boot -s
.
.
.
SunOS Release 5.8 Version Generic 32-bit
Copyright (c) 1983-2000 by Sun Microsystems, Inc.
configuring IPv4 interfaces: le0.
Hostname: earth
ok boot -a
Name of default directory for Provide the name of another kernel to use
modules [/platform/‘uname -m‘/ for booting.
kernel /kernel /usr/kernel]: Or, press Return to use the default kernel
(/platform/‘uname -m‘/kernel/
unix).
root filesystem type [ufs]: Press Return to use the default root file
system type: UFS for local disk booting, or
NFS for network booting.
Enter physical name of root device Provide an alternate device name and
press Return.
[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 the table above, verify that
you entered the boot -a command correctly.
ok boot -a
.
.
.
Rebooting with command: boot -a
Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a File and args: -a
Enter filename [kernel/sparcv9/unix]: Return
Enter default directory for modules [/platform/SUNW,Ultra-5_10/kernel
(continued)
Note - Sun Ultra systems must have PROM version 3.25 or later to use the DHCP
network boot strategy.
If both methods are available, you can specify which service to use in the boot
command temporarily, or save the network boot strategy across system reboots at the
PROM level, by setting up an NVRAM alias. The following nvalias command
example sets up a network device alias for booting DHCP by default on a Sun Ultra
10 system.
This alias means that when you type boot net, the system will boot using DHCP.
1. Determine the method for booting over the network and select one of the
following.
There must be a RARP or DHCP boot server already set up in your network for
either of these methods to boot successfully.
a. Boot the system over the network by using the DHCP method.
ok boot net[:dhcp]
If you have changed the PROM setting to boot DHCP by default, like in the
nvalias example above, you only have to specify boot net to boot using
the DHCP method.
b. Boot the system over the network by using the RARP method.
ok boot net[:rarp]
Since RARP is the default network boot strategy, you only have to specify
boot net:rarp if you have changed the PROM value to boot DHCP.
ok boot cdrom -s
2. Mount the file system that has the file with an invalid entry.
# mount /dev/dsk/device-name /a
# cd /a/directory
# TERM=sun
# export TERM
# vi filename
# cd /
# umount /a
# init 6
The following example shows how to repair an important system file (in this case,
/etc/passwd) after booting from a local CD-ROM.
ok boot cdrom -s
# mount /dev/dsk/c0t3d0s0 /a
# cd /a/etc
# TERM=sun
# export TERM
# vi passwd
(Remove invalid entry)
# cd /
# umount /a
# init 6
ok
The specific stop key sequence depends on your keyboard type. For example, you
can press Stop-a or L1-a. On terminals, press the Break key.
ok sync
3. When you see the syncing file systems... message, press the abort key
sequence for your system again.
# who -r
. run-level 3 May 2 07:39 3 0 S
> n
ok sync
After the crash dump is written to disk, the system will continue to reboot.
2. Use the sync command at the ok prompt to synchronize the disk and write the
crash dump.
3. When you see the syncing file systems... message, press the abort key
sequence for your system again.
ok boot kadb
5. Identify kadb booting messages to verify that the system has booted using the
kernel debugger.
149
TABLE 11–1 Boot Type Descriptions
To run level 3 (multiuser state) After shutting down the system or performing
“IA: How to Boot a
some system hardware maintenance task. This
System to Run Level 3
is the default boot level where all resources are
(Multiuser State)” on
available and users can log into the system.
page 151
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.
2. Press any key to reboot the system if the system displays the Type any key
to reboot prompt. You can also use the reset button at this prompt. If the
system is shut down, turn the system on with the power (on/off) switch.
3. The first menu of the Configuration Assistant is displayed after a few minutes.
# who -r
. run-level S Jul 19 14:37 S 0 3
5. Perform the maintenance task that needed the run level change to S.
(continued)
2. Select the Solaris partition (if not marked as active) from the list and press
Enter. If you do not make a selection within 30 seconds, the active boot
partition is selected automatically.
The Current Boot Parameters menu is displayed after a few minutes.
Enter default directory for Provide an alternate path for the modules
modules: [/platform/i86pc/kernel directory and press Enter, or press Enter to
/kernel /usr/kernel]: use the default modules directory path.
root filesystem type [ufs]: Press Enter to use the default root file
system type: UFS for local disk booting, or
NFS for network booting.
Enter physical name of root device Provide an alternate device name and
[physical_device_name]: press Enter, or press Enter to use the
default physical name of the root device
bootpath.
The new menu, Set Network Configuration Strategy, on the Configuration Assistant’s
Boot Tasks Menu, enables you to select the appropriate boot strategy.
1. Determine whether you want to boot over the network using the RARP/
bootparams method or the DHCP method.
There are two network configuration strategies to choose from, RARP (Reverse
Address Resolution Protocol) or DHCP (Dynamic Host Configuration Protocol).
The default network boot strategy is set to RARP. You can use either one
depending on whether a RARP or DHCP boot server is available in your network.
3. Press any key to reboot the system if the system displays the Type any key
to reboot prompt. You can also use the reset button at this prompt. If the
system is shut down, turn the system on with the power (on/off) switch.
10. Select NET as the boot device from the Boot Solaris menu. Then press
F2_Continue to boot the network device.
The Solaris boot option screen is displayed.
Substitute the device name of the file system to be repaired for the devicename
variable in the procedures below. If you need help identifying a system’s device
names, refer to Chapter 26.
Follow the instructions below to boot from the Solaris installation CD or the network.
1. Boot from the Solaris installation CD (or the network) to single-user mode.
a. Insert the Configuration Assistant Boot Diskette or the Installation CD you
wish to boot from.
b. Press any key to reboot the system if the system displays the Type any
key to reboot prompt. You can also use the reset button at this prompt. If
the system is shut down, turn the system on with the power (on/off) switch.
g. Select the CD-ROM drive or network device from the Boot Solaris menu.
Then press the F2 key (F2_Continue).
The Current Boot Parameters menu is displayed.
2. Mount the root (/) file system that has the invalid passwd file.
# mount /dev/dsk/devicename /a
# cd /a/etc
# vi passwd
# cd /
# umount /a
# init 6
(continued)
Select one of the identified devices to boot the Solaris kernel and
choose Continue.
> To make a selection use the arrow keys, and press Enter to mark it [X].
1 Solaris Interactive
2 Custom JumpStart
3 Solaris Web Start
(continued)
.
# mount /dev/dsk/c0t0d0s0 /a
.
.
.
# cd /a/etc
# vi passwd
(Remove invalid entry)
# cd /
# umount /a
# init 6
If the system doesn’t respond to any input from the mouse or keyboard, press the
reset key, if it exists, to reboot the system. Or you can use the power (on/off) switch
to reboot the system.
4. Verify that you can access the kernel debugger by pressing F1-a.
The kadb[0]: prompt is displayed when you enter the kernel debugger.
1. Press F1–a.
kadb[0]:
Press <F1-a>
kadb[0]: vfs_syncall/W ffffffff
kadb[0]: 0>eip
kadb[0]: :c
kadb[0]: :c
kadb[0]: :c
After the first :c is typed, the system panics, so you need to type :c again. The
system panics again, so type :c a third time to force the crash dump and reboot
the system.
After the crash dump is written to disk, the system continues to reboot.
3. Verify that the system has rebooted by logging in at the console login prompt.
This chapter describes the hardware used for booting on SPARC based and IA based
systems and a conceptual overview of the boot process on each platform.
This is a list of overview information in this chapter.
4 “SPARC: The Boot PROM” on page 163
4 “SPARC: The Boot Process” on page 164
4 “IA: The PC BIOS” on page 164
4 “IA: Boot Subsystems” on page 165
4 “IA: The Boot Process” on page 170
For instructions on booting a system, see Chapter 10 or Chapter 11.
SPARC platform only - Some older systems might require PROM upgrades before
they will work with the Solaris system software. Contact your local service provider
for more information.
163
SPARC: The Boot Process
The following table describes the boot process.
Boot PROM 1. The PROM displays system identification information and then runs
self-test diagnostics to verify the system’s hardware and memory.
2. Then the PROM loads the primary boot program, bootblk, whose
purpose is to load the secondary boot program located in the ufs file
system from the default boot device.
Boot Programs 3. The bootblk program finds and executes the secondary boot
program, ufsboot, and loads it into memory.
Kernel 5. The kernel initializes itself and begins loading modules, using
Initialization 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.
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.
4 The normal Current Boot Parameters menu enables you to boot the Solaris
system with options, or enter the boot interpreter.
4 The install Current Boot Parameters menu enables you to select the type of
installation to be performed, or customize the boot.
The following table summarizes the purpose of the primary IA boot interfaces. See
the sections that follow for a detailed description and example of each boot
subsystem.
Primary Boot Subsystem This menu appears if the disk you are booting from contains
multiple operating environments, including the Solaris
operating environment.
Secondary Boot Subsystem This menu appears each time you boot the Solaris release.
The Solaris release is booted automatically unless you
choose to run the Solaris Device Configuration Assistant by
interrupting the autoboot process.
Solaris Device Configuration There are two ways to access the Solaris Device
Assistant/Boot Diskette Configuration Assistant menus:
1. Use the Solaris Device Configuration Assistant Boot
Diskette or the Solaris Installation CD (on systems that
can boot from the CD-ROM drive) to boot the system.
2. Interrupt the autoboot process when booting Solaris
from an installed disk.
Current Boot Parameters This menu appears when you boot the Solaris release from
Menu the disk, CD-ROM, or the network. The 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.
> To perform a full scan to identify all system hardware, choose Continue.
About navigation...
- The mouse cannot be used.
- If the keyboard does not have function keys or they do not respond,
press ESC. The legend at the bottom of the screen will change to
show the ESC keys to use for navigation.
- The F2 key performs the default action.
Scanning Devices
If the scanning stalls, press the system’s reset button. When the
system reboots, choose Specific Scan or Help.
#######################
| | | | | |
0 20 40 60 80 100
Identified Devices
(continued)
Boot Solaris
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].
BIOS 1. When the system is turned on, the PC BIOS runs self-test
diagnostics to verify the system’s hardware and memory. The system
begins to boot automatically if no errors are found. If errors are found,
error messages are displayed describing recovery options.
Additional hardware devices’ BIOS are run at this time.
2. The BIOS boot program tries to read the first physical sector from
the boot device. This first disk sector on the boot device contains the
master boot record mboot, which is loaded and executed. If no mboot
file is found, an error message is displayed.
Boot Programs 3. mboot, which contains disk information needed to find the active
partition and the location of the Solaris boot program, pboot, loads
and executes pboot.
Kernel 8. The kernel initializes itself and begins loading modules, using the
Initialization secondary boot program (boot.bin or 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.
init 10. The /sbin/init process starts the run control (rc) scripts, which
execute a series of other scripts. These scripts (/sbin/rc*) check and
mount file systems, start various processes, and perform system
maintenance tasks.
This section provides instructions for using removable media in the Solaris
environment. This section contains these chapters.
173
174 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 14
This chapter provides general guidelines for using diskettes and CDs in the Solaris
environment.
This is a list of overview information in this chapter.
4 “Where to Find Managing Removable Media Tasks” on page 175
4 “Removable Media Features and Benefits” on page 176
4 “Comparison of Automatic and Manual Mounting” on page 176
4 “What You Can Do With Diskettes and CDs” on page 177
175
Removable Media Features and Benefits
The Solaris environment gives users and software developers a standard interface for
dealing with diskettes and CDs. Referred to as Volume Management, this interface
provides three major benefits:
4 It enables you to access diskettes and CDs without having to become superuser.
4 It allows you to give other systems on the network automatic access to any
diskettes and CDs you insert into your system (see Chapter 15 and Chapter 16).
9 Become superuser.
If your system has more than one diskette or CD-ROM drive, see the table below for
their access points.
Media Device Access File Systems On ... Access Raw Data On ...
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.
4 “How to Load a CD” on page 181
4 “How to Examine the Contents of a CD” on page 181
4 “How to Copy Information From a CD” on page 181
4 “How to Find Out If a CD Is Still in Use” on page 182
4 “How to Eject a CD” on page 183
4 “How to Access CDs on Other Systems” on page 184
4 “How to Make Local CDs Available to Other Systems” on page 185
4 “How to Configure a System to Play Musical CDs” on page 188
4 “How to Prepare a System for a New CD-ROM Drive” on page 189
4 “How to Stop Volume Management” on page 190
4 “How to Restart Volume Management” on page 190
179
TABLE 15–1 Using CDs Task Map
2. Examine Its Contents Optional. To examine the contents of the CD, “How to Examine the Contents
look in the appropriate directory under / of a CD” on page 181
cdrom.
3. Copy Files or Directories Optional. Copy files or directories from the “How to Copy Information
CD as you would from any other location in From a CD” on page 181
the file system.
4. Is CD Still in Use? Optional. Before ejecting the CD, find out if it “How to Find Out If a CD Is
is still in use. Still in Use” on page 182
Using CD Names
When working with CDs, you can identify them by name or with a designator from
the table below. For brevity, task descriptions use cdrom0, but you can replace this
with either the CD name or a different designator.
CD Alternate Name
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 18,
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).
$ ls -L [-l] /cdrom/cdrom0
$ ls -L -l /cdrom/cdrom0
total 166
drwxr-xr-x 4 root root 2048 Jul 21 05:18 MU
drwxr-xr-x 4 root root 2048 Jul 21 05:18 Solaris_7_MU3
-rwxr-xr-x 1 root root 30952 Jul 21 05:18 backout_mu
-rwxr-xr-x 1 root root 49604 Jul 21 05:18 install_mu
$ ls /cdrom
A file cp
A directory cp -r
$ cp /cdrom/solstice_sysmgt_2_3/README .
$ ls -l
-r--r--r-- 1 pmorph users 4618 May 9 08:09 README
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 2 for more
information on using the chmod command.
The fuser command might not always identify all the killed processes. To be sure,
run it again with the −u option.
# fuser -u /cdrom/cdrom0
/cdrom/cdrom0: 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,
as shown in the following example.
# fuser -u -k /cdrom/cdrom0
/cdrom/cdrom0: 6400c(root)Killed 6399c(smith)Killed
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 might be accessing it), use the fuser
command, as described in “How to Find Out If a CD Is Still in Use” on page 182.
# eject cdrom0
$ mkdir directory
$ showmount -e system-name
export list for system-name:
/cdrom/sol_8_sparc (everyone)
local-mount-point The local directory onto which you will mount the
remote CD.
5. Verify that the CD is mounted by using the ls command to list the contents of
the mount point.
$ ls /cdrom
$ showmount -e starbug
export list for starbug:
/cdrom/sol_8_sparc (everyone)
$ su
Password: password
# mount -F nfs -o ro starbug:/cdrom/sol_8_sparc /cdrom
# exit
$ ls /cdrom
cdrom0 sol_8_sparc
# mkdir / dummy-dir
When you start the NFS daemon, it will see this entry, “wake up,” and notice the
shared CD-ROM drive. Note that the comment (preceded by −d) is optional.
# /etc/init.d/nfs.server start
# eject cdrom0
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).
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"
- /sol_7_sparc ro ""
2. Edit /etc/rmmount.conf.
Add the following line under # Actions, before the cdrom action, as shown in
the example below.
# Actions
action cdrom action_workman.so /usr/dist/exe/workman
action cdrom action_filemgr.so
action floppy action_filemgr.so
action rmscsi action_filemgr.so
# init 6
2. Become superuser.
# /etc/init.d/volmgt stop
#
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.
4 “How to Format a UFS Diskette” on page 197
4 “How to Place a UFS File System on a Diskette” on page 200
4 “How to Format a DOS Diskette” on page 201
4 “How to Load a Diskette” on page 205
4 “How to Examine the Contents of a Diskette” on page 207
4 “How to Copy or Move Information From a Diskette” on page 207
4 “How to Copy or Move Information to a Diskette” on page 208
4 “How to Find Out If a Diskette Is Still in Use” on page 209
4 “How to Eject a Diskette” on page 210
4 “How to Access Diskettes on Other Systems” on page 211
4 “How to Make Local Diskettes Available to Other Systems” on page 212
193
TABLE 16–1 Formatting Diskettes Task Map
1. Load Unformatted Insert the diskette into the drive and enter
“How to Load a Diskette” on
Diskette the volcheck command.
page 205
3. Add a UFS File System UFS Only. Optional. To use the diskette for “How to Place a UFS File
files, add a UFS file system. To use for System on a Diskette” on page
characters, skip this step. 200
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 based platform
cannot be used for UFS on an IA platform, nor can a diskette formatted on an IA
platform be used on a SPARC based platform. This is because the SPARC and IA
UFS formats are different. SPARC uses little-endian bit coding, IA uses big-endian.
A complete format for SunOS file systems consists of the basic “bit” formatting plus
the structure to support a SunOS file system. A complete format for a DOS file system
consists of the basic “bit” formatting plus the structure to support either an MS-DOS
or an NEC-DOS file system. The procedures required to prepare a diskette for each
type of file system are different. Therefore, before you format a diskette, consider
which procedure to follow. See “Formatting Diskettes Task Map” on page 193.
On a Solaris system (either SPARC or IA), you can format diskettes of seven different
densities (provided you have the appropriate drive).
Formatting and Using Diskettes From the Command Line (Tasks) 195
Diskette Size Diskette Density Capacity
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 not—unless 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 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:
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.
4. Invoke formatting.
Formatting and Using Diskettes From the Command Line (Tasks) 197
Verifies whether the diskette was formatted correctly.
−v
convenience-options
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:
Confirm the type of formatting Return (unless you used the −f option in
the previous step, in which case no
confirmation is necessary)
$ fdformat -v -U
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
.......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
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
Formatting and Using Diskettes From the Command Line (Tasks) 199
How to Place a UFS File System on a Diskette
Even though the procedure for adding a UFS file system is the same for UFS
diskettes formatted on IA platforms and SPARC platforms, a UFS diskette formatted
on a SPARC platform can only be used on another SPARC platform, and a UFS
diskette formatted on an IA platform can only be used on an IA platform.
$ /usr/sbin/newfs -v /vol/dev/aliases/floppy0
The newfs(1M) command displays a message asking you to confirm the creation
of the file system.
A status message is displayed, indicating the particulars of the file system and the
diskette’s formatting.
The diskette is now ready to be used on a SPARC platform. However, before
Volume Management recognizes it, you must run the volrmmount command, as
described in the following steps.
$ volrmmount -i floppy0
5. Verify that the UFS file system is on the diskette by using the ls command on
the /floppy directory.
$ ls /floppy
floppy0
Formatting and Using Diskettes From the Command Line (Tasks) 201
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.)
4. Invoke formatting.
convenience-options
Confirm the type of formatting Return (unless you used the −f option in
the previous step, in which case no
confirmation is necessary)
$ volrmmount -i floppy0
Formatting and Using Diskettes From the Command Line (Tasks) 203
$ fdformat -v -U -b myfiles
Formatting 1.44 M in /vol/dev/rdiskette0/unformatted
Press return to start formatting floppy. [ Return ]
......................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1. Load the Diskette Insert the diskette into its drive and enter the
“How to Load a Diskette” on
volcheck command.
page 205
2. Examine its Contents Optional. To examine the contents of the “How to Examine the Contents
diskette, look in the appropriate directory of a Diskette” on page 207
under /diskette.
3. Exchange Files Optional. Copy files or directories between “How to Copy or Move
the diskette and your file system. Information From a Diskette”
on page 207
4. Is Diskette Still in Use? Optional. Before ejecting the diskette, find out “How to Find Out If a Diskette
if the diskette is still in use. Is Still in Use” on page 209
5. Eject the Diskette When you finish, eject the diskette from its
“How to Eject a Diskette” on
drive.
page 210
$ volcheck -v
media was found
Formatting and Using Diskettes From the Command Line (Tasks) 205
media was found Volume Management detected the diskette and will
attempt to mount it in the /floppy directory.
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.
$ ls /floppy
floppy0 myfiles
$ ls -L [-l] floppy0
$ ls -L -l /floppy/floppy0
-rwxrwxrwx 1 smith staff 362284 Nov 16 20:54 text.doc
-rwxrwxrwx 1 smith staff 24562 Nov 16 12:20 art.gif
$ 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” on page 205. The diskette might also need to be
Formatting and Using Diskettes From the Command Line (Tasks) 207
formatted. See “How to Format a UFS Diskette” on page 197 or “How to Format
a DOS Diskette” on page 201.
A file cp
A directory cp -r
$ mv /floppy/floppy0/readme.doc .
$ cp /floppy/floppy0/readme2.doc .
$ cp -r /floppy/floppy0/morefiles .
If the diskette is properly formatted and mounted, its name and the symbolic
link, floppy0, will appear under /floppy.
If nothing appears under the /floppy directory, the diskette is not mounted. See
“How to Load a Diskette” on page 205. The diskette might also need to be
formatted. See “How to Format a UFS Diskette” on page 197 or “How to Format
a DOS Diskette” on page 201.
Copy a file cp
Copy a directory cp -r
$ mv readme.doc /floppy/floppy0
$ cp readme2.doc /floppy/floppy1
$ cp -r /home/smith/morefiles /floppy/floppy0
Formatting and Using Diskettes From the Command Line (Tasks) 209
2. Invoke the fuser command.
The fuser command lists the processes that are currently accessing the CD that
you specify.
# 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 might 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
On a SPARC based system the floppy is physically ejected from its drive, but on
an IA based system, you’ll have to eject the diskette by hand. If you are running
Windows, look for an onscreen message that says you can now eject the diskette.
If the diskette is still in use, the following message appears:
In this case, return to Step 1 and make sure no one is using the diskette, then
eject it again.
If the diskette jams, eject it manually by inserting an unfolded paper clip about
an inch into the small hole in the front of the drive.
$ mkdir directory
Formatting and Using Diskettes From the Command Line (Tasks) 211
system-name The name of the system whose diskette you will mount.
local-mount-point The local directory onto which you will mount the
remote diskette.
5. Verify that the diskette is mounted by using the ls command to list the
contents of the mount point.
$ ls /floppy
$ cd /net/mars
$ ls /floppy
floppy0 myfiles
$ su
Password: password
# mount -F nfs mars:/floppy/myfiles /floppy
# exit
$ ls /floppy
myfiles
# mkdir /dummy-dir
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.
# /etc/init.d/nfs.server start
Formatting and Using Diskettes From the Command Line (Tasks) 213
# 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
# eject floppy0
These lines share any diskette loaded into your system’s diskette drives.
The diskette you now load, and all subsequent diskettes, will be available to other
systems. To access the diskette, the remote user must mount it by name, according
to the instructions in “How to Access Diskettes on Other Systems” on page 211.
13. Verify that the diskette is available to other systems by using the share(1M)
command.
# share
- /dummy ro "dummy dir to wake up NFS daemon"
- /myfiles rw ""
Formatting and Using Diskettes From the Command Line (Tasks) 215
216 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 17
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.
4 “How to Format a UFS PCMCIA Memory Card” on page 219
4 “How to Place a UFS File System on a PCMCIA Memory Card” on page 222
4 “How to Format a DOS PCMCIA Memory Card” on page 224
4 “How to Load a PCMCIA Memory Card” on page 227
4 “How to Examine the Contents of a PCMCIA Memory Card” on page 229
4 “How to Copy or Move Information From a PCMCIA Memory Card” on page 229
4 “How to Copy or Move Information to a PCMCIA Memory Card” on page 230
4 “How to Find Out If a PCMCIA Memory Card Is Still In Use” on page 232
4 “How to Eject a PCMCIA Memory Card” on page 232
4 “How to Access PCMCIA Memory Cards on Other Systems” on page 233
4 “How to Make Local PCMCIA Memory Cards Available to Other Systems” on
page 235
217
TABLE 17–1 Formatting PCMCIA Memory Cards Task Map
2. Format the PCMCIA Format the PCMCIA memory card for UFS.
“How to Format a UFS
Memory Card
PCMCIA Memory Card” on
page 219
3. Add a UFS File System UFS Only. Optional. To use the PCMCIA “How to Place a UFS File
memory card for files, add a UFS file system. System on a PCMCIA Memory
To use for characters, skip this step. Card” on page 222
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 ...
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 IA platform. Likewise,
PCMCIA memory cards formatted on an IA platform cannot be used on a SPARC
platform. This is because the SPARC and IA 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” on page 217.
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.
Using PCMCIA Memory Cards From the Command Line (Tasks) 219
UFS PCMCIA memory card formatted on an IA platform can be used only on an IA
platform running the Solaris Intel Platform Edition.
4. Invoke formatting.
$ fdformat -v -U [convenience-options]
convenience-options
The fdformat command displays a confirmation message (unless you used the
−f option), indicating the type of formatting to be performed:
Confirm the type of formatting Return (unless you used the −f option in
the previous step, in which case no
confirmation is necessary)
$ fdformat -v -U
Formatting in /vol/dev/aliases/unformatted
Press return to start formatting pcmem0. [ Return ]
.........................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
The following example performs the same job, but assigns the PCMCIA memory
card the name myfiles:
$ fdformat -v -U -b myfiles
Formatting in /vol/dev/aliases/unformatted
Press return to start formatting pcmem0. [ Return ]
.........................................................
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Using PCMCIA Memory Cards From the Command Line (Tasks) 221
How to Place a UFS File System on a PCMCIA
Memory Card
Even though the procedure for adding a UFS file system is the same for UFS
PCMCIA memory cards formatted on IA platforms and SPARC based platforms, a
UFS PCMCIA memory card formatted on a SPARC based platform can only be used
on another SPARC based platform, and a UFS PCMCIA memory card formatted on
an IA platform can only be used on a IA platform.
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
The newfs(1M) command displays a message asking you to confirm the creation
of the 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:
(continued)
The PCMCIA memory card is now ready to be used on a SPARC based platform.
However, before Volume Management recognizes the memory card, you must use
the volrmmount(1) command as described in the following step.
$ volrmmount -i pcmem0
5. Verify the UFS file system is on the PCMCIA card by using the ls command
on the /pcmem directory.
If the pcmem0 subdirectory appears, the PCMCIA memory card has a UFS file
system and has been mounted properly.
$ ls /pcmem
pcmem0
$ volrmmount -i pcmem0
Using PCMCIA Memory Cards From the Command Line (Tasks) 223
How to Format a DOS PCMCIA Memory Card
You can format a DOS PCMCIA memory card on a SPARC or IA based platform.
The steps are similar, except that instead of a SunOS file system being placed on the
PCMCIA memory card, a DOS file system, either MS-DOS or NEC-DOS, is put on
the file system.
4. Invoke formatting.
convenience-options
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
Confirm the type of formatting Return (unless you used the −f option in
the previous step, in which case no
confirmation is necessary)
Using PCMCIA Memory Cards From the Command Line (Tasks) 225
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 Insert the PCMCIA memory card into its
“How to Load a PCMCIA
Memory Card drive and enter the volcheck command.
Memory Card” on page 227
2. Examine the Contents of a Optional. To examine the contents of the “How to Examine the Contents
PCMCIA Memory Card PCMCIA memory card, look in the of a PCMCIA Memory Card”
appropriate directory under / on page 229
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” on page 229
4. Is PCMCIA Memory Card Optional. Before ejecting the PCMCIA “How to Find Out If a
Still in Use? memory card, find out if the PCMCIA PCMCIA Memory Card Is Still
memory card is still in use. In Use” on page 232
5. Eject the PCMCIA When you finish, eject the PCMCIA memory
“How to Eject a PCMCIA
Memory Card card.
Memory Card” on page 232
$ volcheck -v
media was found
Using PCMCIA Memory Cards From the Command Line (Tasks) 227
media was Volume Management detected the PCMCIA memory card and will
found attempt to mount it in the /pcmem directory.
no media was Volume Management did not detect a PCMCIA memory card.
found 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):
If the line does not appear, the PCMCIA memory card was not mounted. Check
the Console for error messages.
$ ls -L [-l] pcmem0
$ ls -L -l /pcmem/pcmem0
-rwxrwxrwx 1 smith staff 362284 Nov 16 20:54 text.doc
-rwxrwxrwx 1 smith staff 24562 Nov 16 12:20 art.gif
$ ls /pcmem
pcmem0 PCMCIAmemorycard-name
Using PCMCIA Memory Cards From the Command Line (Tasks) 229
If the PCMCIA memory card is properly formatted and mounted, its name and
the symbolic link will appear under /pcmem.
If nothing appears under the /pcmem directory, the PCMCIA memory card is not
mounted. See “How to Load a PCMCIA Memory Card” on page 227. The
PCMCIA memory card might also need to be formatted. See “How to Format a
UFS PCMCIA Memory Card” on page 219 or “How to Format a DOS PCMCIA
Memory Card” on page 224.
A file cp
A directory cp -r
$ mv /pcmem/pcmem0/readme.doc .
$ cp /pcmem/pcmem0/readme2.doc .
$ cp -r /pcmem/pcmem0/morefiles .
If the PCMCIA memory card is properly formatted and mounted, its name and
the symbolic link, pcmem0, will appear under /pcmem.
If nothing appears under the /pcmem directory, the PCMCIA memory card is not
mounted. See “How to Load a PCMCIA Memory Card” on page 227. The
PCMCIA memory card might also need to be formatted. See “How to Format a
UFS PCMCIA Memory Card” on page 219 or “How to Format a DOS PCMCIA
Memory Card” on page 224.
Copy a file cp
Copy a directory cp -r
$ mv readme.doc /pcmem/pcmem0
$ cp readme2.doc /pcmem/pcmem1
$ cp -r /home/smith/morefiles /pcmem/pcmem0
Using PCMCIA Memory Cards From the Command Line (Tasks) 231
How to Find Out If a PCMCIA Memory Card Is
Still In Use
1. Become superuser.
# fuser -u /pcmem/pcmem0
/pcmem/pcmem0: 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:
# fuser -u -k /pcmem/pcmem0
/pcmem/pcmem0: 6400c(root)Killed 6399c(smith)Killed
The fuser command might not always identify all the killed processes. To be sure,
run it again with the −u option.
# 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:
In this case, return to Step 1 and make sure no one is using the PCMCIA memory
card, then eject it again.
$ mkdir directory
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
Using PCMCIA Memory Cards From the Command Line (Tasks) 233
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.
local-mount-point The local directory onto which you will mount the
remote PCMCIA memory card.
5. Verify that the PCMCIA memory card is indeed mounted by using the ls
command to list the contents of the mount point.
$ ls /pcmem
$ cd /net/mars
$ ls /pcmem
pcmem0 myfiles
$ su
Password: password
# mount -F nfs mars:/pcmem/myfiles /pcmem
# exit
$ ls /pcmem
myfiles
# mkdir /dummy-dir
Using PCMCIA Memory Cards From the Command Line (Tasks) 235
When you start the NFS daemon, it will see this entry, “wake up,” and notice the
shared PCMCIA memory card drive. Note that the comment (preceded by −d) is
optional.
# /etc/init.d/nfs.server start
# eject pcmem0
These lines share any PCMCIA memory card loaded into your system’s PCMCIA
memory card drives.
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” on page 233.
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"
- /myfiles rw ""
(continued)
Using PCMCIA Memory Cards From the Command Line (Tasks) 237
(Continuation)
- /pcmem/myfiles rw ""
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.
4 “Volume Management Mounts All Removable Media” on page 239
4 “Volume Management Provides Access to Diskettes” on page 240
4 “Volume Management Provides Access to CDs” on page 241
4 “Volume Management Supplies Convenient Mount Points for Easier Access ” on
page 242
4 “Volume Management Creates Two Sets of Symbolic Links” on page 244
4 “Volume Management Can Be Limited by UFS Formats” on page 245
239
/vol/dev
diskette0 rdiskette0
If a system has a second diskette drive, Volume Management creates a second pair of
directories named diskette1 and rdiskette1. For a third diskette drive, it would
create diskette2 and rdiskette2; and so on for additional drives.
The diskette directories provide access to file systems, and the rdiskette
directories provide access to raw characters. The diskettes themselves appear in
subdirectories beneath the drive directories. (In this and subsequent illustrations,
some nodes are "grayed out" to draw attention to the other nodes. There is no
structural significance to this convention; it is simply a means of highlighting.)
diskette0 rdiskette0
diskette-name diskette-name
Diskette
dsk rdsk
CD-ROM Drive
c0t6 c0t6
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 the directory belonging to their device:
dsk rdsk
CD-ROM Drive
c0t6 c0t6
CD-name /CD-name
CD
As a result of this arrangement, a system with one diskette drive and one CD-ROM
drive would have the following /vol/dev file system:
/vol/dev
floppy cdrom
dsk
diskette0 c0t6
/
Mounted Mounted
for block access for block access
floppy cdrom
Disk Drive
CD-ROM
Because of these mount points, when you insert a diskette, you can access it under
/floppy/diskette-name. Likewise, when you insert a CD, you can access it under
/cdrom/cd-name.
/
floppy cdrom
diskette-name cd-name
Slice 0
UFS — SPARC
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:
/vol/dev
c0t6
CD-name
CD
S0 S2
UFS—SPA
IS0 9660
$ ls /cdrom/cdrom0
S0 S2
$ ls /vol/dev/dsk/c0t6
S0 S2
This section provides instructions for managing Solaris software packages and
patches. This section contains these chapters.
247
248 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 20
249
For Information On ... See ...
Troubleshooting software
administration problems “Troubleshooting Software Administration
Problems” in System Administration Guide, Volume 2
See “Adding and Removing Software With the Product Registry” in Solaris 8
(SPARC Platform Edition) Installation Guide or “Adding and Removing Software
After Installing Solaris 8” in Solaris 8 (Intel Platform Edition) Installation Guide for
more information.
Package commands (pkgadd, pkgrm, Incorporate these commands into scripts, set up
pkginfo) optional files to avoid user interaction or perform
special checks, and copy software packages to
spool directories. If you’re already familiar with
adding and removing packages with these
commands, it’s probably easiest for you to
continue using them.
The table below describes the advantages of using Admintool rather than the
pkgadd and pkgrm commands to manage software.
4 Package naming conventions – Sun packages always begin with the prefix SUNW,
as in SUNWvolr, SUNWadmap, and SUNWab2m. Third-party packages usually begin
with a prefix that corresponds to the company’s stock symbol.
4 What software is already installed – You can use the product registry, Admintool,
or the pkginfo command to determine the software already installed on a
system.
4 How servers and clients share software – Clients might have software that resides
partially on a server and partially on the client. If this is the case, adding software
for the client requires adding packages to both the server and the client. (The
section below describes in more detail how to manage client software.)
If you intend to keep multiple versions of a package (for example, multiple versions
of a document processing application), install new versions into a different directory
than the already installed package. The directory where a package is installed is
referred to as the base directory, and you can manipulate the base directory by
setting the basedir keyword in a special file called an administration file. See
“Avoiding User Interaction When Adding Packages” on page 254 and admin(4) for
more information on use of an administration file and setting the base directory.
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.
The pkgadd command, by default, looks in the current working directory for an
administration file. If pkgadd doesn’t find an administration file in the current
working directory, pkgadd looks in the /var/sadm/install/admin directory for
the specified administration file. The pkgadd command also accepts an absolute path
to the administration file.
Caution - Use administration files judiciously. You should know where a package’s
files are installed and how a package’s installation scripts run before using an
administration file to avoid the checks and prompts pkgadd normally provides.
Besides using administration files to avoid user interaction when adding packages,
you can use them in several other ways. For example, you can use an administration
file to quit a package installation (without user interaction) if there’s an error or to
avoid interaction when removing packages with the pkgrm command.
You can also assign a special installation directory for a package. (It would make
sense to do this if you wanted to maintain multiple versions of a package on a
system.) To do this, set an alternate base directory in the administration file (using
the basedir keyword), which specifies where the package will be installed. See
admin(4) for more information.
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.
4 “How to Add Packages to a Standalone System” on page 258
4 “How to Add a Package to a Spool Directory” on page 261
4 “How to Check the Integrity of an Installed Package” on page 264
4 “How to List Information About All Installed Packages” on page 263
4 “How to Display Detailed Information About a Package” on page 265
4 “How to Remove a Package” on page 266
4 “How to Remove a Spooled Package” on page 267
4 “How to Add Packages With Admintool” on page 267
4 “How to Remove Packages With Admintool” on page 269
257
TABLE 21–1 Commands for Adding and Removing Packages
Command Description
NONABI_SCRIPTS=TRUE
Adding Packages
How to Add Packages to a Standalone System
1. Log in as superuser.
2. Remove any already installed packages with the same names as the ones you
are adding.
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 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.
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” on page 254. In this example,
2. Remove any already spooled packages with the same names as the ones you
are adding.
For information on removing spooled packages, see “How to Remove a Spooled
Package” on page 267.
4. Verify that the package has been copied successfully to the spool directory,
using the pkginfo command.
# pkgadd SUNWman
.
.
.
Installation of <SUNWman> was successful.
Use the pkginfo command to display information about the packages that are
installed on the system.
$ pkginfo
Specifies to audit only the file contents, rather than the file
−c
contents and attributes, which is the default for pkgchk.
# pkgchk -c SUNWadmfw
# pkgchk -a SUNWadmfw
If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it
reports the error.
# pkgchk -d /export/install/packages
## checking spooled package <SUNWadmap>
## checking spooled package <SUNWadmfw>
## checking spooled package <SUNWadmc>
## checking spooled package <SUNWsadml>
Note - The checks made on a spooled package are limited because not all
information can be audited until a package is installed.
$ su
3. Start Admintool.
# admintool &
$ su
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 &
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 20.)
271
Tools For Managing Patches
There are two utilities for managing patches:
4 patchadd - use to install directory-format patches to a Solaris system.
4 patchrm - use to remove patches installed on a Solaris system. This command
restores the file system to its state before a patch was applied.
Detailed information about how to install and back out a patch is provided in
patchadd(1M) and patchrm(1M). Each patch also contains a README file that
contains specific information about the patch.
Before installing patches, you might want to know more about patches that have
previously been installed. The table below describes commands that provide useful
information about patches already installed on a system.
Command Function
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
A Sun Service customer You have access to the SunSolve database of patches and
patch information. These are available via the World Wide
Web or anonymous ftp, as described in “Patch Access Via
the World Wide Web” on page 273 and “Patch Access Via
ftp” on page 274.
These patches are updated nightly. You also receive a patch
CD-ROM every 6 to 8 weeks.
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” on page 273 and “Patch
Access Via ftp” on page 274.
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 106925–02 is a SunOS 5.7 patch for the glm device driver.
This section provides instructions for managing devices in the Solaris environment.
This section contains these chapters.
277
278 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 24
279
Hot plugging is the ability to physically add, remove, or replace system components
while the system is running. Dynamic reconfiguration, available on certain SPARC
servers, allows a service provider to remove and replace hot-pluggable 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 SPARC hardware manufacturer’s documentation for information about
whether dynamic reconfiguration is supported on your system. See the Solaris 8
(Intel Platform Edition) Hardware Compatibility List to verify whether your PCI
controller supports hot-plugging.
Chapter 25 describes how to use the cfgadm command to hot-plug SCSI or PCI
controllers.
Adding a disk
Chapter 30 or Chapter 31
Adding a modem
“Managing Terminals and Modems (Overview)” in
System Administration Guide, Volume 2
Adding a printer
“Print Management (Overview)” in System
Administration Guide, Volume 2
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.
You can customize the way in which kernel modules are loaded by modifying the
/etc/system file. See system(4) for instructions on modifying this file.
See “Device Naming Conventions” on page 312 for information on the device names
used to identify devices on the system.
This message does not always mean that a driver is unavailable for this device. It
means that no driver is currently attached to the device instance because there is no
device at this node or the device is not in use. Drivers are loaded automatically
when the device is accessed and unloaded when the device is not in use.
$ /usr/sbin/prtconf
.
.
.
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1 (driver not attached)
sd, instance #2 (driver not attached)
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
sd, instance #6
.
.
.
The same device information can be gleaned from the sysdef output.
# /usr/sbin/prtconf
# /usr/sbin/sysdef
# prtconf
System Configuration: Sun Microsystems sun4u
Memory size: 128 Megabytes
System Peripherals (Software Nodes):
SUNW,Ultra-5_10
packages (driver not attached)
terminal-emulator (driver not attached)
deblocker (driver not attached)
obp-tftp (driver not attached)
disk-label (driver not attached)
SUNW,builtin-drivers (driver not attached)
sun-keyboard (driver not attached)
ufs-file-system (driver not attached)
chosen (driver not attached)
openprom (driver not attached)
client-services (driver not attached)
options, instance #0
aliases (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
pci, instance #0
pci, instance #0
ebus, instance #0
auxio (driver not attached)
power, instance #0
SUNW,pll (driver not attached)
se, instance #0
su, instance #0
su, instance #1
ecpp (driver not attached)
fdthree, instance #0
.
.
.
# /usr/sbin/dmesg
The dmesg output is displayed as messages on the system console and identifies
which devices are connected to the system since the last reboot.
# dmesg
date naboo genunix: [ID 540533 kern.notice] SunOS Release
5.8 Version Generic 32-bit
date naboo genunix: [ID 223299 kern.notice] Copyright (c)
1983-2000 by Sun Microsystems, Inc.
date naboo genunix: [ID 897550 kern.info] Using default
device instance data
date naboo unix: [ID 168242 kern.info] mem = 32380K (0x1f9f000)
date naboo unix: [ID 930857 kern.info] avail mem = 19390464
date naboo rootnex: [ID 466748 kern.info] root nexus =
i86pc
date naboo rootnex: [ID 349649 kern.info] pci0 at root:
space 0 offset 0
date naboo genunix: [ID 936769 kern.info] pci0 is /pci@0,0
date naboo genunix: [ID 678236 kern.info] Ethernet address
= 00:a0:24:89:b0:72
date naboo gld: [ID 944156 kern.info] elx0: 3COM EtherLink
III:
type "ether" mac address 00:a0:24:89:b0:72
date naboo pci: [ID 370704 kern.info] PCI-device: pci10b7,5950@c,
elx0
date naboo genunix: [ID 936769 kern.info] elx0 is /pci@0,0/pci10b7,5950@c
.
.
.
Configuring Devices
289
Adding a Peripheral Device to a System
Adding a new peripheral device usually involves:
4 Shutting down the system
4 Connecting the device to the system
4 Rebooting the system
Use the procedure below to add the following devices to a system:
4 CD-ROM
4 Secondary disk drive
4 Tape drive
4 SBUS card
In some cases, you might have to add a third-party device driver to support the new
device.
2. Follow steps 2 and 3 of “How to Add a Device Driver” on page 291 if you need
to add a device driver to support the device.
# touch /reconfigure
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.
It is safe to turn off power if the ok or > It is safe to turn off power if the type any
prompt is displayed. key to continue prompt is displayed.
Refer to the hardware installation guide that accompanies your system for the
location of the power switch.
7. Install the peripheral device, making sure the device you are adding has a
different target number than the other devices on the system.
You often will find a small switch located at the back of the disk for this purpose.
Refer to the hardware installation guide that accompanies the peripheral device
for information on installing and connecting the device.
9. Verify that the peripheral device has been added by attempting to access the
device. See Chapter 26 for information on accessing the device.
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
#
# pkgadd XYZdrv
(licensing messages displayed)
.
.
.
Installing XYZ Company driver as <XYZdrv>
.
.
.
Installation of <XYZdrv> was successful.
# pkgchk XYZdrv
#
Note - Not all SCSI and PCI controllers support hot-plugging with the cfgadm
command. For a list of PCI hardware that supports hot-plugging, please refer to the
Solaris 8 (Intel Platform Edition) Hardware Compatibility List.
Attachment Points
The cfgadm displays information about attachment points, which are locations in the
system where dynamic reconfiguration operations can occur.
Receptacle and occupant state mappings for SCSI device attachment points are:
The condition of SCSI attachment points are unknown unless there is special
hardware to indicate otherwise. See the instructions below on displaying SCSI
component configuration information.
See “IA: PCI Hot-Plugging With the cfgadm Command” on page 306 for
step-by-step instructions on adding or removing a PCI adapter card.
The procedures in this section use specific devices as examples to illustrate how to
use the cfgadm command to hot plug SCSI components. The device information that
you supply, and is displayed with the cfgadm command, depends on your system
configuration.
Note - If the SCSI device is not supported by the cfgadm command, it does not
display in the cfgadm command output.
1. Become superuser.
# cfgadm -l
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c1 scsi-bus connected configured unknown
Note - The cfgadm -l commands displays info about SCSI HBAs but not SCSI
devices. Use the cfgadm -al command to display information about SCSI
devices such as disk and tapes.
In the following examples, only SCSI attachment points are listed. The attachment
points displayed on your system will depend on your system configuration.
# cfgadm -c unconfigure c1
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected unconfigured unknown
Notice that the Occupant column specifies unconfigured, indicating that the
SCSI bus has no configured occupants.
# cfgadm -c configure c1
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 unavailable connected unconfigured unknown
The previous unconfigure procedure removed all devices on the SCSI bus. Now
all the devices are configured back into the system.
cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 unavailable connected unconfigured unknown
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
Caution - This command suspends all I/O activity on the SCSI bus until the
cfgadm -c connect command is used. The cfgadm command does some basic
checking to prevent critical partitions from being disconnected, but it cannot detect
all cases. Inappropriate use of this command may result in a system hang and could
require a system reboot.
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 unavailable disconnected configured unknown
c1::dsk/c1t10d0 unavailable disconnected configured unknown
c1::dsk/c1t4d0 unavailable disconnected configured unknown
The controller and all the devices attached to it are disconnected from the system.
# cfgadm -c connect c1
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
Note - When adding devices, the ap_id of the SCSI HBA (controller) to which the
device is attached is specified, not the ap_id of the device itself.
1. Become superuser.
# cfgadm -x insert_device c1
Adding device to SCSI HBA: /devices/sbus@1f,0/SUNW,fas@1,8800000
This operation will suspend activity on SCSI bus: c1
Continue (yes/no)? y
SCSI bus quiesced successfully.
It is now safe to proceed with hotplug operation.
Enter y if operation is complete or n to abort (yes/no)? y
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
1. Become superuser.
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
3. Replace a device on the SCSI bus with another device of the same type.
b. Power off the device to be removed and remove it. Add the replacement
device, which should be of the same type and at the same address (target
and lun) as the device to be removed. Then power it on.
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
c1::dsk/c1t4d0 disk connected configured unknown
# cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 disk connected configured unknown
c0::rmt/0 tape connected configured unknown
c1 scsi-bus connected configured unknown
c1::dsk/c1t3d0 disk connected configured unknown
Cause
Solution
Unmount the file system listed in the error message and try the cfgadm operation
again.
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp connected configured ok
pci1:hpc0_slot4 unknown empty unconfigured unknown
# cfgadm -s "cols=ap_id:type:info" pci
Ap_Id Type Information
pci1:hpc0_slot0 unknown Slot 7
pci1:hpc0_slot1 unknown Slot 8
pci1:hpc0_slot2 unknown Slot 9
pci1:hpc0_slot3 ethernet/hp Slot 10
pci1:hpc0_slot4 unknown Slot 11
The logical ap_id, pci1:hpc0_slot0, is the logical ap_id for that particular
hot-pluggable slot, Slot 7, (physical identification of this slot). The component hpc0
indicates the hot-pluggable adapter card for this slot and pci1 indicates the PCI bus
instance. The Type field indicates the type of PCI adapter card present in the slot.
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp connected configured ok
pci1:hpc0_slot4 unknown empty unconfigured unknown
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp connected unconfigured unknown
pci1:hpc0_slot4 unknown empty unconfigured unknown
4. Determine which slot the adapter card is in once it is inserted and the latches
are closed.
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp disconnected unconfigured unknown
pci1:hpc0_slot4 unknown empty unconfigured unknown
# cfgadm
Ap_Id Type Receptacle Occupant Condition
pci1:hpc0_slot0 unknown empty unconfigured unknown
pci1:hpc0_slot1 unknown empty unconfigured unknown
pci1:hpc0_slot2 unknown empty unconfigured unknown
pci1:hpc0_slot3 ethernet/hp connected configured unknown
pci1:hpc0_slot4 unknown empty unconfigured unknown
Cause
Check whether the cfgadm -c command was issued appropriately. Use cfgadm to
check the current receptacle and occupant state and make sure the ap_id is correct.
Error Message
Cause
Solution
Check whether the attachment point is correct. Use cfgadm to display a list of
available attachment points. Also check the physical path to see if the attachment
point is still there.
Note - In addition to the cfgadm command, several other commands are helpful
during hot-plug operations. The prtconf(1M) command displays whether or not
Solaris recognizes the hardware. After inserting hardware, use the prtconf
command to verify that the hardware is recognized. After a configure operation, use
the prtconf -D command to verify the driver is attached to the newly installed
hardware device.
This chapter provides information about how system administrators access the
devices on their systems.
This is a list of overview information in this chapter.
4 “Accessing Devices” on page 311
4 “Logical Disk Device Names” on page 312
4 “Logical Tape Device Names” on page 316
4 “Logical CD-ROM Device Names” on page 316
For overview information about configuring devices, see Chapter 24.
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.
311
pointers to the drivers that perform specific operations. See the OpenBoot 3.x
Command Reference Manual for more information on device hierarchy.
4 dmesg
4 format
4 sysdef
4 prtconf
4 dmesg
4 sysdef
4 prtconf
4 Logical device name – Used by system administrators with most file system
commands to refer to devices. See Table 26–1 for a list of file commands that use
logical device names. Logical device files in the /dev directory are symbolically
linked to physical device files in the /devices directory.
/dev/[r]dsk/cwtxdysz
TABLE 26–1 Device Interface Type Required by Some Frequently Used Commands
Block df /dev/dsk/c0t3d0s6
df(1M)
The conventions for both types of controllers are explained in the following
subsections.
Slice Number (0 to 7)
Drive Number
Slice Number (0 to 7)
Drive Number
Drive Number
This section provides instructions for managing disks in the Solaris environment.
This section contains these chapters.
319
320 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 28
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.
4 “Disk Terminology” on page 322
4 “About Disk Slices” on page 323
4 “SPARC: Disk Slices” on page 323
4 “IA: Disk Slices” on page 324
4 “Determining Which Slices to Use” on page 327
4 “The format Utility” on page 328
4 “Guidelines for Using the format Utility” on page 330
4 “Formatting a Disk” on page 331
4 “About Disk Labels” on page 332
4 “Partition Table” on page 332
For instructions on how to add a disk drive to your system, see Chapter 30 or
Chapter 31.
321
IA: Support for Large Disks
This Solaris release fully uses disks larger than 8 Gbytes because of improved BIOS
interfaces. Previously, the following limitations impacted IA based systems running
the Solaris Intel Platform Edition:
4 On IDE disks, only the first 8 Gbytes could be used by the system.
4 On either SCSI or IDE disks, only the first 8 Gbytes could only be used for the root
(/) slice.
Both of these restrictions have been removed on systems with improved BIOSes.
See Solaris 8 (Intel Platform Edition) Installation Guide for more information.
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 might 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:
4 Track
4 Cylinder
4 Sector
4 Disk controller
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.
Whole disk is devoted to Solaris environment Disk is divided into fdisk partitions, one
per operating environment
Disk is divided into eight slices, numbered The Solaris fdisk partition is divided into
0-7 10 slices, numbered 0-9
Usually Found on
Client or Server
Slice File System Systems? Purpose
/export/
home
Usually Found on
Client or Server
Slice File System Systems? Purpose
Usually Found on
Client or Server
Slice File System Systems? Purpose
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.
Standalone
Slice Servers Systems
0 root root
1 swap swap
2 — —
3 /export —
4 /export/swap —
5 /opt /opt
6 /usr /usr
7 /export/home /home
See “Overview of System Types” on page 96 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
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
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 32.
Use format To
... Considerations ... Where to Go ...
Use format To
... Considerations ... Where to Go ...
Formatting a Disk
In most cases, disks are formatted by the manufacturer or reseller and do not need to
be reformatted when you install the drive. To determine whether or not a disk is
formatted, use the format utility. See “How to Determine if a Disk is Formatted” on
page 341 for more information.
If you determine that a disk is not formatted, use the format utility to format 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. The table below describes
partition table terminology.
Flags
Partition flags and tags are assigned by convention and require no maintenance.
See “How to Display Disk Slice Information” on page 344 or “How to Examine a
Disk Label” on page 348 for more information on displaying the partition table.
Examples—Partition Tables
The following partition table example is displayed from a 1.05-Gbyte disk using the
format utility:
Part Partition (or slice number). See Table 28–7 for a description of this
column.
Tag Partition tag. See Table 28–7 for a description of this column.
Flags Partition flag. See Table 28–7 for a description of this column.
Cylinders The starting and ending cylinder number for the slice.
Blocks The total number of cylinders and the total number of sectors per
slice in the far right column.
The following example displays a disk label using the prtvtoc command.
# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 72 sectors/track
* 14 tracks/cylinder
* 1008 sectors/cylinder
* 2038 cylinders
* 2036 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 303408 303407 /
1 3 01 303408 225792 529199
2 5 00 0 2052288 2052287
6 4 00 529200 1523088 2052287 /usr
Dimensions – This section describes the physical dimensions of the disk drive.
Flags – This section describes the flags listed in the partition table section. See Table
28–7 for a description of partition flags.
Partition (or Slice) Table – This section contains the following information:
Partion Partition (or slice number). See Table 28–7 for a description of
this column.
Tag Partition tag. See Table 28–7 for a description of this column.
Flags Partition flag. See Table 28–7 for a description of this column.
Mount Directory The last mount point directory for the file system.
337
TABLE 29–1 Administering Disks Task Map
1. Identify the Disks on a If you are not sure of the types of disks on a
“How to Identify the Disks on
System system, use the format utility to identify the
a System” on page 339
disk types.
4. Label the Disk Create the disk label by using the format
“How to Label a Disk” on page
utility.
346
5. Examine the Disk Label Examine the disk label by using the
“How to Examine a Disk
prtvtoc command.
Label” on page 348
2. Identify the disks that are recognized on the system with the format utility.
# format
The format utility displays a list of disks that it recognizes under AVAILABLE
DISK SELECTIONS.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number):
The format output associates a disk’s physical and local device name to the disk’s
marketing name which appears in angle brackets <>. This is an easy way to identify
which local device names represent the disks connected to your system. See Chapter
26 for a description of local and physical device names.
The following example uses a wildcard to display the disks connected to a second
controller.
# format /dev/rdsk/c2*
AVAILABLE DISK SELECTIONS:
0. /dev/rdsk/c2t0d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@0,0
1. /dev/rdsk/c2t1d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@1,0
2. /dev/rdsk/c2t2d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@2,0
3. /dev/rdsk/c2t3d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@3,0
4. /dev/rdsk/c2t5d0s0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@5,0
Specify disk (enter its number):
# format
AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/
sd@3,0
Specify disk (enter its number):
The format output identifies that disk 0 (target 3) is connected to the first SCSI host
adapter (espdma@...), which is connected to the first SBus device (sbus@0...).
The output also associates both the physical and logical device name to the disk’s
marketing name, SUN02.1G.
The following example identifies the disks on an IA based system.
# format
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 615 alt 2 hd 64 sec 63>
/pci@0,0/pci-ide@7,1/ata@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63>
/pci@0,0/pci-ide@7,1/ata@0/cmdk@1,0
2. c1d0 <DEFAULT cyl 817 alt 2 hd 256 sec 63>
/pci@0,0/pci-ide@7,1/ata@1/cmdk@0,0
Specify disk (enter its number):
The format output identifies that disk 0 is connected to the first PCI host adapter
(pci-ide@7...), which is connected to the ATA device (ata...). The format
output on an IA based system does not identify disks by their marketing names.
Label was corrupted by a system problem, such as Go to “How to Label a Disk” on page
a power failure 346.
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:
4 You can write data to it. However, most disks are already formatted.
4 You can use the Solaris installation program to install the system.
Caution - Formatting is a destructive process—it 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.
# format
3. Enter the number of the disk that you want to check from the list displayed on
your screen.
[disk formatted]
# format
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 0
selecting c0t1d0
[disk formatted]
# format
3. Enter the number of the disk that you want to format from the list displayed
on your screen.
Warning - Do not select the system disk. Formatting your system disk deletes your
operating system and any data that you might have on this disk.
4. To begin formatting the disk, enter format at the format> prompt. Confirm
the command by typing y.
5. Verify that the disk format is successful by identifying the following messages.
Formatting...
done
Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18
Example—Formatting a Disk
The following example formats the disk c0t3d0.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number):1
Selecting c0t3d0
[disk formatted]
format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes
Beginning format. The current time is Wed Jul 14 10:03:34 1999
Formatting ...
done
Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18
(continued)
Note - The format utility uses the term partition in place of slice.
# format
3. Identify the disk for which you want to display slice information by selecting a
disk listed under AVAILABLE DISK SELECTIONS.
format> partition
5. Display the slice information for the current disk drive by typing print at the
partition> prompt.
6. Exit the format utility by typing q at the partition> prompt and typing q at
the format> prompt.
partition> q
format> q
#
7. Verify displayed slice information by identifying specific slice tags and slices.
If the screen output shows that no slice sizes are assigned, the disk probably does
not have slices.
# format
Searching for disks...done
Specify disk (enter its number):1
Selecting c0t3d0
format> partition
partition> print
Current partition table (original):
Total disk cylinders available: 2036 + 2 (reserved cylinders)
See Chapter 28 for a detailed description of the slice information displayed in these
examples.
The following example displays the slice information on disk /dev/dsk/c0t0d0.
# format
Format will ask if you want to label the You must specify the disk type. Go to steps
disk. Go to step 5 to label the disk. 6-7 to set the disk type and label the disk.
format> type
8. Label the disk. If the disk is not labeled, the following message is displayed.
9. Use the verify command from the format main menu to verify the disk label.
format> verify
partition> q
format> q
#
Example—Labeling a Disk
The following example automatically configures and labels a 1.05-Gbyte disk.
# format
c1t0d0: configured with capacity of 1002.09MB
# prtvtoc /dev/rdsk/device-name
# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 72 sectors/track
* 14 tracks/cylinder
* 1008 sectors/cylinder
* 2038 cylinders
* 2036 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 303408 303407 /
1 3 01 303408 225792 529199
2 5 00 0 2052288 2052287
6 4 00 529200 1523088 2052287 /usr
#
# format
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.
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.
format> verify
Warning: Could not read primary label.
Warning: Check the current partitioning and ’label’ the disk or
use the ’backup’ command.
Backup label contents:
Volume name = < >
ascii name = <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
pcyl = 2038
ncyl = 2036
acyl = 2
nhead = 14
nsect = 72
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 300 148.15MB (301/0/0) 303408
1 swap wu 301 - 524 110.25MB (224/0/0) 225792
2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
(continued)
6. If format was able to find a backup label and the backup label contents appear
satisfactory, use the backup command to label the disk with the backup label.
format> backup
Disk has a primary label, still continue? y
7. If format was not able to automatically configure the disk, specify the disk
type using the type command.
format> type
8. Select 0 to automatically configure the disk, or select a disk type from the list
of possible disk types.
9. If the disk was successfully configured, reply with no when format asks if
you want to label the disk.
11. If format was able to find a backup label and the backup label contents appear
satisfactory, use the backup command to label the disk with the backup label.
format> backup
Disk has a primary label, still continue? y
Searching for backup labels...found.
Restoring primary label
format> q
13. Verify the file systems on the recovered disk by using the fsck command.
See Chapter 39 for information about using the fsck command.
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 30 or Chapter 31.
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” on page 355 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 32
for more information on adding an entry to the /etc/format.dat file.
# cp /etc/format.dat /etc/format.dat.gen
3. Modify the /etc/format.dat file to include an entry for the third-party disk
using the format.dat information described in Chapter 32.
Use the disk’s hardware product documentation to gather the required
information.
In all cases, slice 6 (for the /usr file system) gets the remainder of the space on the
disk.
See Chapter 32 for more information about using SCSI automatic configuration.
2. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
Brings the system down to init state 0 (zero), the power-down state.
−i0
Notifies logged-in users that they have n seconds before the system
−g30
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.
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 1002.09MB
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 1
format> verify
format> q
The above console message indicates that block 179 might be bad. Relocate the
bad block by using the format utility’s repair command or use the analyze
command with the repair option enabled.
2. Unmount the file system in the slice that contains the defective sector.
See mount(1M) for more information.
# umount /dev/dsk/device-name
# format
format> analyze
6. Set up the analysis parameters by typing setup at the analyze> prompt. Use
the parameters shown here:
analyze> setup
Analyze entire disk [yes]? n
Enter starting block number [0, 0/0/0]: 12330
Enter ending block number [2052287, 2035/13/71]: 12360
Loop continuously [no]? y
Repair defective blocks [yes]? n
Stop after first error [no]? n
Use random bit patterns [no]? n
Enter number of blocks per transfer [126, 0/1/54]: 1
Verify media after formatting [yes]? y
Enable extended messages [no]? n
Restore defect list [yes]? y
Create defect label [yes]? y
analyze> read
Ready to analyze (won’t harm SunOS). This takes a long time,
but is interruptible with Control-C. Continue? y
pass 0
2035/12/1825/7/24
pass 1
Block 12354 (18/4/18), Corrected media error (hard data ecc)
25/7/24
^C
(continued)
2. Enter the format utility and select the disk that contains the defective sector.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t2d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@2,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 1
selecting c0t3d0
[disk formatted]
format>
format> repair
If you are unsure of the format used to identify the defective sector, see “How to
Identify a Defective Sector by Using Surface Analysis” on page 357 for more
information.
# format -M
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
# for i in x y z
> do
> prtvtoc /dev/rdsk/cwtxdysz | fmthard -s - /dev/rdsk/cwt${i}d0s2
> done
# for i in 1 2 3 5
> do
> prtvtoc /dev/rdsk/c2t0d0s0 | fmthard -s - /dev/rdsk/c2t${i}d0s2
> done
fmthard: New volume table of contents now in place.
fmthard: New volume table of contents now in place.
fmthard: New volume table of contents now in place.
fmthard: New volume table of contents now in place.
#
This chapter provides the procedures for adding a disk to a SPARC based system.
This is a list of the step-by-step instructions in this chapter.
4 “SPARC: How to Connect a System Disk and Boot” on page 365
4 “SPARC: How to Connect a Secondary Disk and Boot” on page 365
4 “SPARC: How to Create Disk Slices and Label a Disk” on page 367
4 “SPARC: How to Create File Systems” on page 371
4 “SPARC: How to Install a Boot Block on a System Disk” on page 372
For overview information about disk management, see Chapter 28. For step-by-step
instructions on adding a disk to an IA based system, see Chapter 31.
363
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” on page
Connect the new disk and boot from a local
365
or remote Solaris CD.
2. Create Slices and Label Create disk slices and label the disk if it has
“SPARC: How to Create Disk
the Disk not already been done by the disk
Slices and Label a Disk” on
manufacturer.
page 367
3. Create File Systems Create UFS file systems on the disk slices
“SPARC: How to Create File
with the newfs command. You must create
Systems” on page 371
the root (/) or /usr file system (or both) for
a system disk.
4. Restore File Systems Restore the root (/) or /usr file system (or
Chapter 44
both) on the system disk. If necessary, restore
file 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” on
page 372
2. 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.
3. Connect the replacement system disk to the system and check the physical
connections.
Refer to the disk’s hardware installation guide for installation details.
4. Follow the instructions in the table below depending on whether you are
booting from a local or remote Solaris CD.
A Solaris CD from a local CD-ROM drive 1. Make sure the CD is in the CD-ROM drive.
2. Boot from the CD to single-user mode:
ok boot cdrom -s
A Solaris CD from a CD-ROM drive over Boot from the net to single-user mode:
the network
ok boot net -s
2. If the disk type is unsupported by the Solaris software, add the device driver
for the disk by following the instructions included with the hardware.
3. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
The /reconfigure file will cause the SunOS software to check for the presence
of any newly installed peripheral devices when you power on or boot your
system later.
-i0 Brings the system down to init state 0 (zero), the power-down state.
-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.
# format
3. Enter the number of the disk that you want to repartition from the list
displayed on your screen.
4. Go into the partition menu (which lets you set up the slices).
format> partition
partition> print
partition> modify
See “Using the Free Hog Slice” on page 335 for more information about the free
hog slice.
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:
4 root (slice 0) and swap (slice 1) and/or
4 /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.
If you don’t want the current partition table and you want to change it, answer
no and go to Step 6 on page 367.
12. Label the disk with the new partition table when you have finished allocating
slices on the new disk.
partition> q
format> verify
format> q
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 0
selecting c0t1d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
(continued)
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 814 - 2035 601.45MB (1222/0/0) 1231776
7 unassigned wm 0 0 (0/0/0) 0
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): 0
selecting c0t1d0
[disk formatted]
format> partition
partition> print
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
(continued)
2. Create a file system for each slice with the newfs(1M) command.
# newfs /dev/rdsk/cwtxdysz
System Disk You need to restore the root (/) and /usr file systems on the
disk. Go to Chapter 44.
After the root (/) and /usr file systems are restored, install
the boot block. Go to “SPARC: How to Install a Boot Block
on a System Disk” on page 372.
Secondary Disk You might need to restore file systems on the new disk. Go
to Chapter 44.
If you are not restoring file systems on the new disk, you are
finished adding a secondary disk. See Chapter 36 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.
This chapter provides the procedures for adding a disk on an IA based system. This
is a list of the step-by-step instructions in this chapter.
4 “IA: How to Connect a System Disk and Boot” on page 377
4 “IA: How to Connect a Secondary Disk and Boot” on page 378
4 “IA: How to Create a Solaris fdisk Partition” on page 379
4 “IA: How to Create Disk Slices and Label a Disk” on page 386
4 “IA: How to Create File Systems” on page 388
4 “IA: How to Install a Boot Block on a System Disk” on page 389
For overview information about disk management, see Chapter 28. For step-by-step
instructions on adding a disk to a SPARC based system, see Chapter 30.
375
IA: Adding a System or Secondary Disk
Task Map
TABLE 31–1 IA: Adding a System or Secondary Disk Task Map
1. Connect the Disk and Boot System Disk “IA: How to Connect a System
Disk and Boot” on page 377
Connect the new disk and boot from a local
or remote Solaris CD.
2. Create Slices and Label Create disk slices and label the disk if it has
“IA: How to Create a Solaris
the Disk not already been done by the disk
fdisk Partition” on page 379
manufacturer.
and “IA: How to Create Disk
Slices and Label a Disk” on
page 386
3. Create File Systems Create UFS file systems on the disk slices
“IA: How to Create File
with the newfs command. You must create
Systems” on page 388
the root (/) or /usr file system (or both) for
a system disk.
4. Restore File Systems Restore the root (/) or /usr file system (or
Chapter 44
both) on the system disk. If necessary, restore
file systems on the secondary disk.
5. Install Boot Block System Disk Only. Install the boot block on the “IA: How to Install a Boot
root (/) file system, so the system can boot. Block on a System Disk” on
page 389
4 The Solaris partition must be made the active partition on the disk. The active
partition is the one whose operating system will be booted by default at system
start-up.
4 The Solaris fdisk partition can be the entire disk or you might want to make it
smaller to allow room for a DOS partition. You can also make a new fdisk
partition on a disk without disturbing existing partitions (if there is enough room
to create a new one).
x86 platform only - Solaris slices are sometimes called partitions. This user guide
uses the term slice, but some Solaris documentation and programs might refer to a
slice as a partition. To avoid confusion, Solaris documentation tries to distinguish
between fdisk partitions (which are supported only on SolarisTM (Intel Platform
Edition) and the divisions within the Solaris fdisk partition, which might be called
slices or partitions.
2. 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.
3. Connect the replacement system disk to the system and check the physical
connections.
Refer to the disk’s hardware installation guide for installation details. Also, refer
to the Solaris 8 (Intel Platform Edition) Device Configuration Guide about
hardware configuration requirements specific to the disk.
4. Follow steps a-e if you are booting from a local or remote Solaris CD.
If you are booting from the network, skip step a.
a. Insert the Solaris installation CD into the CD-ROM drive.
b. Insert the Solaris boot diskette into the primary diskette drive (DOS drive
A).
d. Select the CD-ROM drive or net(work) as the boot device from the Boot
Solaris screen.
The Current Boot Parameters screen is displayed.
2. If the disk is unsupported by the Solaris software, add the device driver for the
disk by following the instructions included with the hardware.
3. Create the /reconfigure file that will be read when the system is booted.
# touch /reconfigure
The /reconfigure file will cause the SunOS software to check for the presence
of any newly installed peripheral devices when you power on or boot your
system later.
Notifies logged-in users that they have n seconds before the system
−gn
begins to 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. Also, refer
to the Solaris 8 (Intel Platform Edition) Device Configuration Guide for hardware
configuration requirements specific to the disk.
2. Become superuser.
# format
format> fdisk
The fdisk menu displayed is dependent upon whether the disk has existing
fdisk partitions. Determine the next step using the following table.
6. Create and activate a Solaris fdisk partition spanning the entire disk by
specifying y at the prompt. Then go to step 14.
(continued)
7. Specify n at the prompt if you do not want the Solaris fdisk partition to span
the entire disk.
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
(continued)
Enter Selection: 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.
13. Update the disk configuration and exit the fdisk menu from the selection
menu.
format> quit
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2466 alt 2 hd 16 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c1d0 <DEFAULT cyl 13102 alt 2 hd 16 sec 63>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@0,0
Specify disk (enter its number): 0
selecting c0d0
Controller working list found
[disk formatted]
format> fdisk
The recommended default partitioning for your disk is:
(continued)
format> fdisk
Total disk size is 2694 cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 DOS-BIG 1 538 538 20
SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection: 1
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
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
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
Partition 2 is now the Active partition Total disk size is 2694
cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 DOS-BIG 1 538 538 20
2 Active SOLARIS 539 2693 2155 80
SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Change Active (Boot from) partition
(continued)
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection: Selection: 4
WARNING: Solaris fdisk partition changed - Please relabel the disk
format> label
Ready to label disk, continue? yes
format> q
This following example describes how to create a Solaris fdisk partition and a
DOSBIG fdisk partition.
format> fdisk
The recommended default partitioning for your disk is:
a 100% "SOLARIS System" partition.
To select this, please type "y". To partition your disk
differently, type "n" and the "fdisk" program will let you
select other partitions. n
Total disk size is 2694 cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
THERE ARE NO PARTITIONS CURRENTLY DEFINED SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection: 1
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) ?8
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 20
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". n
Total disk size is 2694 cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 DOS-BIG 1 538 538 20
SELECT ONE OF THE FOLLOWING:
(continued)
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
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
Indicate the percentage of the disk you want this partition
to use (or enter "c" to specify in cylinders). 80
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
Partition 2 is now the Active partition Total disk size is 2694
cylinders
Cylinder size is 765 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 DOS-BIG 1 538 538 20
2 Active SOLARIS 539 2693 2155 80
# format
3. Enter the number of the disk that you want to repartition from the list
displayed on your screen.
4. Go into the partition menu (which lets you set up the slices).
format> partition
partition> print
partition> modify
See “Using the Free Hog Slice” on page 335 for more information about the free
hog slice.
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:
4 root (slice 0) and swap (slice 1) and/or
4 /usr (slice 6)
After you identify the slices, the new partition table is displayed.
10. Make the displayed partition table the current partition table by answering
yes when asked.
If you don’t want the current partition table and you want to change it, answer
no and go to Step 6 on page 387.
12. Label the disk with the new partition table when you have finished allocating
slices on the new disk.
partition> quit
format> verify
format> quit
2. Create a file system for each slice with the newfs(1M) command.
System Disk You need to restore the root (/) and /usr file systems on the
disk. Go to Chapter 44.
After the root (/) and /usr file systems are restored, install
the boot block. Go to “IA: How to Install a Boot Block on a
System Disk” on page 389.
Secondary Disk You might need to restore file systems on the new disk. Go
to Chapter 44.
If you are not restoring file systems on the new disk, you are
finished adding a secondary disk. See Chapter 36 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
% format
Searching for disk...done
No permission (or no disk found)!
391
Recommendations for Preserving
Information When Using format
4 Back up all files on the disk drive before doing anything else.
4 Save all your defect lists in files by using format’s dump command. The file name
should include the drive type, model number, and serial number.
4 Save the paper copies of the manufacturer’s defect list shipped with your drive.
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format>
Command or
Item Menu? Allows You To ...
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” on page 396 for more information.
defect Menu Retrieve and print defect lists. See “The defect
Menu” on page 398 for more information.
Command or
Item Menu? Allows You To ...
inquiry Command Print the vendor, product name, and revision level
of the current drive (SCSI disks only).
format> partition
PARTITION MENU:
0 - change ‘0’ partition
1 - change ‘1’ partition
2 - change ‘2’ partition
3 - change ‘3’ partition
4 - change ‘4’ partition
5 - change ‘5’ partition
6 - change ‘6’ partition
7 - change ‘7’ partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
quit
partition>
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.
format> fdisk
Total disk size is 1855 cylinders
Cylinder size is 553 (512 byte) blocks
Cylinders
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 DOS-BIG 0 370 371 20
2 Active SOLARIS 370 1851 1482 80
(continued)
Enter Selection:
Change Active Specify which partition will be used for booting. This
partition identifies where the first stage boot program will look for the
second stage boot program.
Exit Write a new version of the partition table and exit the fdisk
menu.
Cancel Exit the fdisk menu without modifying the partition table.
format> analyze
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)
(continued)
read Read each sector on this disk. Repairs defective blocks as a default.
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.
format> defect
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>
primary Read the manufacturer’s defect list from the disk drive and update the
in-memory defect list.
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.
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.
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.
Identifier Description
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.
pcyl The number of physical cylinders in the disk type. This number is used
to calculate the boundaries of the disk media. This number is usually
equal to ncyl plus acyl.
nhead 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 might be necessary depending on the controller. The table below
describes the assignments required 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.
disk_type = "SUN2.1G" \
: ctlr = SCSI : fmt_time = 4 \
: ncyl = 2733 : acyl = 2 : pcyl = 3500 : nhead = 19 : nsect = 80 \
: rpm = 5400 : bpt = 44823
disk_type = "SUN2.9G" \
: ctlr = SCSI : fmt_time = 4 \
: ncyl = 2734 : acyl = 2 : pcyl = 3500 : nhead = 21 : nsect = 99 \
: rpm = 5400
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 = "SUN1.3G" \
: disk = "SUN1.3G" : ctlr = SCSI \
: 0 = 0, 34000 : 1 = 25, 133280 : 2 = 0, 2672400 : 6 = 123, 2505120
partition = "SUN2.1G" \
: disk = "SUN2.1G" : ctlr = SCSI \
(continued)
partition = "SUN2.9G" \
: disk = "SUN2.9G" : ctlr = SCSI \
: 0 = 0, 195426 : 1 = 94, 390852 : 2 = 0, 5683986 : 6 = 282, 5097708
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.
This section provides instructions for managing file systems in the Solaris operating
environment. This section contains these chapters.
407
Provides information on how the file system state is
Chapter 39
recorded, what is checked by the fsck program, how to
modify automatic boot checking, and how to use the
fsck program.
409
Because /var/run is mounted as a memory-based file system rather than a
disk-based file system, updates to this directory do not cause unnecessary disk traffic
that would interfere with systems running power management software.
The /var/run directory requires no administration. You may notice that it is not
unmounted with the umount -a or the umountall command.
For security reasons, /var/run is owned by root.
# touch /reconfigure
# init 0
$ ls /cdrom
Note - If the system has both a CD-ROM and DVD-ROM device, the CD-ROM
might be named /cdrom/cdrom0 and the DVD-ROM might be named
/cdrom/cdrom1. If the system only has a DVD-ROM device, then try using
/cdrom/cdrom0.
$ ls /cdrom/cdrom1
Copyright filea fileb
Automatic display with the CDE file manager is not implemented yet. All other
CDE file manager functions—drag and drop for copying and imagetool
features—are available.
3. Verify the UDF file system is created by mounting it. See “How to Mount a
UDF File System” on page 414 for more information.
# fstyp -v /rdev/dsk/device-name
# ls /mount-point
# umount /dev/dsk/device-name
2. Create a file system and volume name for the UDF file system.
Disk-Based File
System Format Description
UFS UNIX file system (based on the BSD Fast File system that was
provided in the 4.3 Tahoe release). UFS is the default disk-based
file system for the Solaris operating environment.
Before you can create a UFS file system on a disk, the disk must
be formatted and divided into slices. See Chapter 28 for complete
information on formatting disks and dividing disks into slices.
HSFS High Sierra, Rock Ridge, and ISO 9660 file system. High Sierra is
the first CD-ROM file system; ISO 9660 is the official standard
version of the High Sierra File System. The HSFS file system is
used on CD-ROMs, and is a read-only file system. Solaris HSFS
supports Rock Ridge extensions to ISO 9660, which, when present
on a CD-ROM, provide all UFS file system features and file types
except for writability and hard links.
UDF The UDF file system, the industry-standard format for storing
information on the optical media technology called DVD (Digital
Versatile Disc or Digital Video Disc).
Each type of disk-based file system is customarily associated with a particular media
device:
Caution - Do not delete the files in the /proc directory. Deleting processes from the
/proc directory will not kill them. Remember, /proc files do not use disk space, so
there is little reason to delete files from this directory.
FIFOFS (first-in first-out) Named pipe files that give processes common access to
data
FDFS (file descriptors) Provides explicit names for opening files using file
descriptors
Command Description
Clears inodes
clri(1M)
Command Description
Lists or provides labels for file systems when copied to tape (for
labelit(1M) use by the volcopy command only)
Mounts all file systems specified in the virtual file system table
mountall(1M) (/etc/vfstab)
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 NFS, UFS The mount point for users’ home directories, which
or /home store users work files. By default /home is an
automounted file system. On standalone systems, /
home might be a UFS file system on a local disk slice.
/var UFS System files and directories that are likely to change or
grow over the life of the local system. These include
system logs, vi and ex backup files, and uucp files.
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.
State flags Show the state of the file system: clean, stable, active,
logging, or unknown. These flags eliminate unnecessary
file system checks. If the file system is “clean,” “stable,”
or “logging,” file system checks are not run.
Extended fundamental types 32-bit user ID (UID), group ID (GID), and device numbers.
(EFT)
Large file systems A UFS file system can be as large as 1 Tbyte (terabyte).
The Solaris operating environment does not provide
striping, which is required to make a logical slice large
enough for a 1-Tbyte file system. However, the SolsticeTM
DiskSuiteTM software, available from Sun, provides this
capability.
Large files By default, a UFS file system can have regular files larger
than 2 Gbytes (gigabytes). You must explicitly use the
nolargefiles mount option to enforce a 2 Gbyte
maximum file size limit. This limit was removed in the
Solaris 2.6 release.
See Chapter 40 for detailed information about the UFS file system.
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 is true even when a system crashes, which
normally interrupts system calls and introduces inconsistencies into a UFS file
system.
UFS logging provides two advantages. It prevents file systems from becoming
inconsistent, therefore eliminating the need to run fsck. And, because fsck can be
bypassed, UFS logging reduces the time required to reboot a system if it crashes, or
after an unclean halt (see “What fsck Checks and Tries to Repair” on page 510 for
details on unclean halts). UFS logging can significantly reduce the boot time on
systems that have large file systems, which usually take a long time to read and
verify with fsck.
The log created by UFS logging is continually flushed as it fills up. The log is totally
flushed when the file system is unmounted or as a result of the lockfs -f
command.
UFS logging is not enabled by default. To enable UFS logging, you must specify the
−o logging option with the mount command in the /etc/vfstab file or when
mounting the file system. The log is allocated from free blocks on the file system,
and it is sized approximately 1 Mbyte per 1 Gbyte of file system, up to a maximum
of 64 Mbytes. Logging can be enabled on any UFS, including the root (/) file system.
Also, the fsdb command has been updated with new debugging commands to
support UFS logging.
fs opt SUNWleo
mount
rc0
shutdown group
ufs
system
ttydefs
mount
/
Mount Point
File System
sbin etc opt
$ more /etc/mnttab
/dev/dsk/c0t0d0s0 / ufs rw,intr,largefiles,onerror=panic,suid,dev=2200000 938557523
/proc /proc proc dev=3180000 938557522
fd /dev/fd fd rw,suid,dev=3240000 938557524
mnttab /etc/mnttab mntfs dev=3340000 938557526
swap /var/run tmpfs dev=1 938557526
swap /tmp tmpfs dev=2 938557529
/dev/dsk/c0t0d0s7 /export/
home ufs rw,intr,largefiles,onerror=panic,suid,dev=2200007 938557529
$
$ more /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 2 no -
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /test ufs 2 yes -
(continued)
In the above example, the last entry specifies that a UFS file system on the
/dev/dsk/c0t3d0s7 slice will be automatically mounted on the /test mount
point when the system boots. Note that, for root (/) and /usr, the mount at boot
field value is specified as no, because these file systems are mounted by the kernel as
part of the boot sequence before the mountall command is run.
See Chapter 36 for descriptions of each of the /etc/vfstab fields and information
on how to edit and use the file.
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.
Remote file systems frequently, such as home 4 The /etc/vfstab file, which will
directories automatically mount the file system
when the system is booted in multi-user
state.
4 AutoFS, which will automatically mount
or unmount the file system when you
change into (mount) or out of (unmount)
the directory.
To enhance performance, you can also cache
the remote file systems by using CacheFS.
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
command. See Chapter 14 for more information.
mount-point Specifies the mount point name of the file system for
which you want to know the type. For example, the /
var directory.
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).
The following example uses the /etc/mnttab file to determine the file system type
of the currently mounted diskette (mounted by volume management).
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 “access” them by mounting them.
This is a list of the step-by-step instructions in this chapter.
4 “How to Create a UFS File System” on page 435
4 “How to Create a TMPFS File System” on page 437
4 “How to Create a LOFS File System” on page 438
Note - For instructions on how to create UFS and DOS file systems on removable
media, see Chapter 14.
433
Note - Solaris device names use the term slice (and the letter s in the device name)
to refer to the slice number. Slices are also called “partitions.”
You need to create UFS file systems only occasionally, because the Solaris operating
environment automatically creates them as part of the installation process. You need
to create (or re-create) a UFS file system when you:
Minimum free space ((64 Mbytes/partition size) * 100), rounded down to the
nearest integer and limited to between 1% and 10%,
inclusively
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. This might cause the system to panic.
3. To verify the creation of the UFS file system, check the new file system with
the fsck(1M) command.
# fsck /dev/rdsk/device-name
The fsck command checks the consistency of the new file system, reports
problems it finds, and prompts you before repairing the problems. See Chapter 39
for more information on fsck.
# newfs /dev/rdsk/c0t1d0s7
/dev/rdsk/c0t1d0s7: 725760 sectors in 720 cylinders of 14 tracks, 72 sectors
354.4MB in 45 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 16240, 32448, 48656, 64864, 81072, 97280, 113488, 129696, 145904, 162112,
178320, 194528, 210736, 226944, 243152, 258080, 274288, 290496, 306704,
322912, 339120, 355328, 371536, 387744, 403952, 420160, 436368, 452576,
468784, 484992, 501200, 516128, 532336, 548544, 564752, 580960, 597168,
613376, 629584, 645792, 662000, 678208, 694416, 710624,
#
2. If necessary, create the directory where you want to mount the TMPFS file
system and set permissions and ownership as necessary.
4. Look at the output from the mount command to verify that the TMPFS file
system has been created.
# mount -v
# mkdir /export/reports
# chmod 777 /export/reports
# mount -F tmpfs -o size=50 swap /export/reports
For more information the /etc/vfstab file, see “The /etc/vfstab Field
Descriptions” on page 446.
A LOFS file system is a virtual file system that provides an alternate path to an
existing file system. When other file systems are mounted onto a LOFS file system,
the original file system does not change.
See the lofs(7FS) man page for more information.
Caution - Be careful when creating LOFS file systems. Because these are virtual file
systems, the potential for confusing both users and applications is enormous.
2. Create the directory where you want to mount the LOFS file system and give it
the appropriate permissions and ownership.
4. Look at the output from the mount command to verify that the LOFS file
system has been created.
# mkdir /tmp/newroot
# mount -F lofs /new/dist /tmp/newroot/usr/local
# chroot /tmp/newroot command
Caution - Make sure the loopback entries are the last entries in the /etc/vfstab
file. Otherwise, if the /etc/vfstab entry for a loopback file system precedes the file
systems to be included in it, the loopback file system cannot be created.
For more information the /etc/vfstab file, see “The /etc/vfstab Field
Descriptions” on page 446.
This chapter describes how to mount and unmount file systems. This is a list of the
step-by-step instructions in this chapter.
4 “How to Determine Which File Systems Are Mounted” on page 445
4 “How to Add an Entry to the /etc/vfstab File” on page 447
4 “How to Mount a File System (/etc/vfstab File)” on page 449
4 “How to Mount All File Systems (/etc/vfstab File)” on page 449
4 “How to Mount a UFS File System” on page 451
4 “How to Mount an NFS File System” on page 454
4 “IA: How to Mount a System V (S5FS) File System” on page 454
4 “IA: How to Mount a PCFS (DOS) File System From a Hard Disk” on page 455
4 “How to Stop All Processes Accessing a File System” on page 457
4 “How to Unmount a File System” on page 458
4 “How to Unmount All File Systems (/etc/vfstab File)” on page 459
441
The table below provides guidelines on mounting file systems based on how you use
them.
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.
Remote file systems frequently, such as home 4 The /etc/vfstab file, which will
directories automatically mount the file system
when the system is booted in multi-user
state.
4 AutoFS, which will automatically mount
or unmount the file system when you
change into (mount) or out of (unmount)
the directory.
To enhance performance, you can also cache
the remote file systems by using CacheFS.
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 14 for more information.
Command Description
The mount commands will not mount a read/write file system that has known
inconsistencies. If you receive an error message from the mount or mountall
command, you might need to check the file system. See Chapter 39 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 accessing a file or directory in the file system, if a
program has a file open in that file system, or if the file system is shared.
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.
logging | UFS Enables logging for the file system. UFS logging
nologging 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. Logging helps prevent UFS
file systems from becoming inconsistent, which
means fsck can be bypassed. Bypassing fsck
reduces the time to reboot a system if it crashes,
or after a system is shutdown uncleanly.
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.
$ mount [ -v ]
device to mount
4 The block device name for a local UFS file system (for example, /
dev/dsk/c0t0d0s0).
4 The resource name for a remote file system (for example,
myserver:/export/home). For more information about NFS, see
System Administration Guide, Volume 3.
4 The block device name of the slice on which to swap (for example,
/dev/dsk/c0t3d0s1).
4 The /proc directory for the proc file system type.
device to fsck The raw (character) device name that corresponds to the UFS file
system identified by the device to mount field (for example, /dev/
rdsk/c0t0d0s0). This 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 Identifies where to mount the file system (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 but
non-UFS file systems are checked. When the field contains a value
greater than zero, the file system is always checked.
All file systems with a value of 1 in this field, are checked one at a
time in the order they appear in the vfstab file. When 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 automatically checks the file
systems on different disks in parallel to maximize efficiency.
Otherwise, the value of the pass number does not have any effect.
The fsck pass field does not explicitly specify the order in which file
systems are checked, other than as described above.
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. The root (/), /usr and /var file
systems are not mounted from the vfstab file initially. This field
should always be set to no for these file systems and for virtual file
systems such as /proc and /dev/fd.
mount options A list of comma-separated options (with no spaces) that are used in
mounting the file system. Use a dash (-) to indicate no options. See
Table 36–3 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 to enter a dash (-), otherwise the system might not boot
successfully. Similarly, white space should not be used in a field value.
See Table 36–4 for detailed information about the /etc/vfstab field entries.
Make sure that you:
4 Separate each field with white space (a space or a tab).
4 Enter a dash (-) if a field has no contents.
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.
The following example mounts the root (/) file system on a loopback mount point
named /tmp/newroot. It specifies yes for mount at boot, no device to fsck,
and no fsck pass number. LOFS file systems must always be mounted after the
file systems used to make up the LOFS file system.
# mount mount-point
# mount /usr/dist
If no options are specified, all file systems listed in the /etc/vfstab file with
yes in the mount at boot field are mounted.
All the file systems with a device to fsck entry are checked and fixed, if
necessary, before mounting.
# mountall
/dev/rdsk/c0t0d0s7 already mounted
mount: /tmp already mounted
mount: /dev/dsk/c0t0d0s7 is already mounted, /export/home is busy,
or the allowable number of mount points has been exceeded
The following example mounts all the local systems listed in the /etc/vfstab file.
# mountall -l
# mount
/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/onerror=panic on ...
/usr on /dev/dsk/c0t0d0s6 read/write/setuid/intr/largefiles/onerror=panic on ...
/proc on /proc read/write/setuid on Fri Sep 10 16:09:48 1999
/dev/fd on fd read/write/setuid on Fri Sep 10 16:09:51 1999
/etc/mnttab on mnttab read/write/setuid on Fri Sep 10 16:10:06 1999
/var/run on swap read/write/setuid on Fri Sep 10 16:10:06 1999
/tmp on swap read/write/setuid on Fri Sep 10 16:10:09 1999
/export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/onerror=panic on ...
The following example mounts all the remote file systems listed in the
/etc/vfstab file.
1. Become superuser.
Also, there must be a mount point on the local system to mount a file system. A
mount point is a directory to which the mounted file system is attached.
/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” on page 344 to get slice
information for a disk.
1. Become superuser.
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.
# umount mount-point
# fsck mount-point
# cd /datab
# find . -xdev -size +20000000 -exec ls -l {} \;
# umount /datab
# fsck /datab
# mount -o nolargefiles /datab
server:/directory Specifies the server’s host name that contains the shared
resource, and the path to the file or directory to mount.
/dev/dsk/device-name Specifies the disk device name of the slice holding the file
system (for example, /dev/dsk/c0t3d0s7). See “How
to Display Disk Slice Information” on page 344 to get slice
information for a disk.
/dev/dsk/device-name Specifies the device name of the whole disk (for example,
/dev/dsk/c0t0d0p0).
The following example mounts the first logical drive in the Extended DOS slice
read-only on /mnt.
Note - File systems are automatically unmounted as part of the system shutdown
procedure.
Prerequisites
The prerequisites to unmounting file systems are:
4 You must be superuser.
4 A file system must be available for unmounting. You cannot unmount a file
system that is busy. A file system is considered busy if a user is accessing a
directory in the file system, if a program has a file open in that file system, or if it
is being shared. You can make a file system available for unmounting by:
2. List all the processes that are accessing the file system, so you know which
processes you are going to stop.
# fuser -c [ -u ] mount-point
mount-point The name of the file system for which you want to stop
processes.
# fuser -c -k mount-point
# fuser -c mount-point
# fuser -c /export/home
/export/home: 4006c
# fuser -c -k /export/home
/export/home: 4006c
# fuser -c /export/home
/export/home:
1. Make sure you have met the prerequisites listed on “Prerequisites” on page 457.
# 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.
# umount /export/home
# umount /dev/dsk/c0t0d0s7
# umountall
All systems that are unmounted, except those that are busy.
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.
4 “How CacheFS Works” on page 462
4 “Setting Up a Cached File System Task Map” on page 463
4 “How to Create a Cache” on page 464
4 “How to Specify a File System to Be Mounted in a Cache With mount” on page
465
4 “How to Mount a File System in a Cache by Editing the /etc/vfstab File” on
page 468
4 “How to Mount a File System in a Cache With AutoFS” on page 469
4 “How to Modify File Systems in a Cache” on page 471
4 “How to Display Information About Cached File Systems” on page 472
4 “How to Specify Consistency Checking on Demand” on page 473
4 “How to Delete a Cached File System” on page 473
4 “How to Check the Integrity of Cached File Systems” on page 475
4 “CacheFS Statistics” on page 489
4 “Prerequisites for Setting Up and Viewing the CacheFS Statistics” on page 489
4 “Setting Up CacheFS Statistics Task Map” on page 490
4 “How to Set Up the Logging Process” on page 491
461
4 “Viewing the Cache Size” on page 492
4 “How to View the Working Set (Cache) Size” on page 492
4 “Viewing the Statistics” on page 494
4 “How to View Cache Statistics” on page 494
4 “The Cache Structure and Behavior” on page 495
4 “Consistency Checking of Cached File Systems With the Back File System” on
page 496
4 “Consistency Checking on Demand” on page 496
Note - You can mount only file systems that are shared. See share(1M) for
information on sharing file systems.
Back file
system
Network
Client
Cached file
systems
2. Mount File Systems in the Mount a file system in a cache by using the
“How to Specify a File System
Cache mount command.
to Be Mounted in a Cache With
mount” on page 465
Creating a Cache
The following procedure describes how to create a cache directory.
# cfsadmin -c cache-directory
Note - After you have created the cache, do not perform any operations within
the cache directory itself. This causes conflicts within the CacheFS software.
Example—Creating a Cache
The following example creates a cache in the /local/mycache directory by using
the default cache parameter values.
Using the mount(1M) command Every time the system reboots in order to
access the same file system.
Editing the /etc/vfstab file Only once. The /etc/vfstab file remains
unchanged after the system reboots.
Choose the method of mounting file systems that best suits your environment.
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.
fstype Indicates the file system type of the back file system (can
be either NFS or HSFS).
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
(continued)
garbage collection: 0
The mount point is the cached file system you created. For more information
about the cachefsstat command, see “CacheFS Statistics” on page 489.
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
# mkdir /docs
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache merlin:/docs /docs
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.
3. Mount the cached file system using the mount command, as follows:
# mount /mount-point
or reboot.
# mount /usr/local
/mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs
server:/file-system
/-
5. Verify that the entry was made correctly by changing to the file system you
mounted in the cache, and then list the contents, as follows:
For more information about AutoFS and how to edit the maps, refer to the AutoFS
chapter of the System Administration Guide, Volume 3.
/docs -fstype=cachefs,cachedir=/local/mycache,backfstype=nfs
merlin:/docs
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.
In the following example, the cache is deleted, then re-created, and then mounted
again with the demandconst option specified for the file system /docs. This
example shows the steps including rebooting to single user mode. You might have
other commands you prefer to use to accomplish some of the tasks shown in this
example.
# shutdown -g30 -y
.
.
.
Type Cntrl-d to proceed with normal startup,
(or give root password for system maintenance):
# enter password:
.
.
.
Here is where you might be prompted from system to run fsck on the
file system where the cache is located.
# fsck /local
# mount /local
# cfsadmin -d all /local/mycache
# cfsadmin -c /local/mycache
# init 6
.
.
.
console login:
password:
# mount -F cachefs -o backfstype=nfs,cachedir=/local/cache1, demandconst merlin:/docs /docs
#
If you did not successfully remount the file system in the cache, the system displays
an error message similar to the following:
2. Display information about all file systems cached under a specified cache.
# cfsadmin -l cache-directory
# cfsadmin -l /local/mycache
cfsadmin: list cache FS information
maxblocks 90%
minblocks 0%
threshblocks 85%
maxfiles 90%
minfiles 0%
threshfiles 85%
maxfilesize 3MB
merlin:_docs:_docs
#
2. Mount the file system in the cache specifying the demandconst option of the
mount command, as follows:
# cfsadmin -s /mount-point
# umount mount-point
mount-point specifies the cached file system that you want to delete.
# cfsadmin -l cache-directory
cfsadmin: list cache FS information
maxblocks 90%
minblocks 0%
threshblocks 85%
maxfiles 90%
minfiles 0%
threshfiles 85%
maxfilesize 3MB
cache-ID
#
cache-id Indicates the name of the cached file system, which is the
last line of the cfsadmin -l output. See “How to Display
Information About Cached File Systems” on page 472 for
more information. You can delete all the cached file
systems in a particular cache by specifying all for
cache-id.
# umount /docs
# cfsadmin -d merlin:_docs:_docs /local/mycache
The following example deletes all the cached file systems in the /local/mycache
cache. This also deletes the cache.
$ cachefspack -p filename
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).
$ cachefspack -p projects
The following example shows several files specified to be packed in the cache.
$ cachefspack -p /usr/openwin/bin
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.
BASE /home/ignatz
LIST plans
LIST docs
IGNORE *.ps
4 The path identified with the BASE statement is the directory where you have items
you wish to pack.
4 The two LIST statements identify specific files within that directory to pack.
4 The IGNORE statement identifies the file type of .ps, which you do not wish to
pack.
$ cachefspack -f packing-list
This means you want the software to read the packing list and pack files based on
the information specified in the packing list.
$ cachefspack -f list.pkg
LIST *.doc
Specifies that you want the file or files defined in the LIST
−r
command treated as regular expressions, and not as literal
file names.
Specifies that you want the packing list packed in the cache.
−f
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.
2. Pack the packing list in the cache using the cachefspack -sf command.
Note - The −s option must be used with the −f option. The −s option cannot be
used alone.
The following example shows how you would then specify packing the packing list.
Unpacking Files
You might 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.
$ cachefspack -u /usr/openwin/bin/xlogo
The following example shows several files specified to be unpacked from the cache.
$ cd /usr/openwin/bin
$ cachefspack -u xlogo xview xcolor
You can also unpack a packing list, which is a file that contains the path to a
directory of files, as follows:
The following example uses the -U option to specify all files in a cache directory to
be unpacked.
$ cachefspack -U /local/mycache
You cannot unpack a cache that does not have at least one file system mounted. With
the -U option, if you specify a cache that does not contain mounted file systems, you
will see output similar to the following:
$ cachefspack -U /local/mycache
cachefspack: Could not unpack cache /local/mycache, no mounted
filesystems in the cache.
$ cachefspack -i doc_file
cachefspack: file doc_file marked packed YES, packed YES
$ cd /usr/openwin
$ cachefspack -i bin
.
.
.
cachefspack: file /bin/xterm marked packed YES, packed NO
cachefspack: file /bin/textedit marked packed YES,
packed YES
cachefspack: file /bin/resize marked packed YES,
packed NO
.
(continued)
.
.
If you use the −iv options in combination, you will get additional information as to
whether or not the file or directory specified has been flushed from the cache. For
example:
$ cd /usr/openwin
$ cachefspack -iv bin
.
.
.
cachefspack: file /bin/xterm marked packed YES, packed NO,
nocache YES
cachefspack: file /bin/textedit marked packed YES,
packed YES, nocache NO
cachefspack: file /bin/resize marked packed YES,
packed NO
nocache NO
.
.
.
The last line of the example above shows that the directory contents have not been
flushed from the cache.
$ cachefspack -h
Must select 1 and only 1 of the following 5 options
-d Display selected filenames
-i Display selected filenames packing status
-p Pack selected filenames
-u Unpack selected filenames
-U Unpack all files in directory ’dir’
cachefspack Errors
You might see the following error messages when you use the cachefspack
command.
Cause
You might not have the correct permissions to access the file or directory.
Action
Cause
Action
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Cause
You might have pressed Control-c inadvertently while issuing the command.
Action
Cause
A hardware problem.
Action
Cause
You might not have the correct file or directory. The path identified after the BASE
command in the file format could be a file and not a directory. The path specified
must be a directory.
Action
Check for a possible typo. Check the path identified after the BASE command in your
file format. Make sure it is a directory, and not a file.
Cause
Cause
You might not have the correct permissions to access the file or directory.
Action
Cause
Action
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Action
Cause
You might have pressed Control-c inadvertently while issuing the command.
Action
Cause
A hardware problem.
Cause
Action
You need to increase disk space. Increase the size of the cache.
Cause
You might not have the correct permissions to access the file or directory.
Action
Cause
Action
Cause
The file or directory might have been moved or deleted from the server at the time
you attempted to access it.
Action
Cause
You might have pressed Control-c inadvertently while issuing the command.
Cause
A hardware problem.
Action
Cause
You entered more than one of the above options in a command session.
Action
Cause
Action
Cause
Action
Note - The CacheFS statistics commands can be issued from any directory. You must
be superuser to issue the cachefswssize 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” on page 492.
Note - The following procedures are presented in a recommended order. The order
is not required.
2. Locate the Log File Locate the log file with the cachefslog
“How to Locate the Log File”
command.
on page 491
3. Stop the Logging Process Stop the logging process with the
“How to Stop the Logging
cachefslog command.
Process” on page 492
4. View the Cache Size View the cache size using the
“How to View the Working Set
cachefswssize command.
(Cache) Size” on page 492
5. View the Cache Statistics View the statistics using the cachefsstat
“How to View Cache Statistics”
command.
on page 494
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.
2. Verify that you set up the log file correctly by using the cachefslog
command, as follows:
$ cachefslog mount-point
$ cachefslog mount-point
mount-point Specifies the cached file system for which you want to view
the statistics.
$ cachefslog /home/stuff
/var/tmp/stufflog: /home/stuff
The following example shows that no log file has been set up for the specified file
system.
$ cachefslog /home/zap
not logged: /home/zap
$ cachefslog -h mount-point
$ cachefslog -h /home/stuff
not logged: /home/stuff
If you get a system response other than the one specified in the above example, you
did not successfully stop the logging process. Check to see if you are using the
correct log file name and mount point.
# cachefswssize log-file-path
# cachefswssize /var/tmp/samlog
/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
/nfs/venus.svr4
end size: 4688k
high water size: 5000k
/usr
end size: 4992k
high water size: 4992k
hit rate The rate of cache hits versus cache misses, followed by the actual
number of hits and misses. A cache hit occurs when the user wants to
perform an operation on a file or files, and the file or files are actually
in the cache. A cache miss occurs when the file was not in the cache.
The load on the server is the sum of cache misses, consistency checks,
and modifications (modifies).
$ cachefsstat mount-point
mount-point Specifies the cached file system for which you want to view
the statistics.
If you do not specify the mount point, statistics for all mounted CacheFS file systems
will be displayed.
(continued)
$ cfsadmin -o maxblocks=60
497
Swap Space and Virtual Memory
The Solaris software uses some disk slices for temporary storage rather than for file
systems. These slices are called swap slices. Swap slices are used as virtual memory
storage areas when the system does not have enough physical memory to handle
current processes.
The virtual memory system maps physical copies of files on disk to virtual addresses
in memory. Physical memory pages which contain the data for these mappings can
be backed by regular files in the file system, or by swap space. If the memory is
backed by swap space it is referred to as anonymous memory because there is no
identity assigned to the disk space backing the memory.
The Solaris environment uses the concept of virtual swap space, a layer between
anonymous memory pages and the physical storage (or disk-backed swap space) that
actually back these pages. A system’s virtual swap space is equal to the sum of all its
physical (disk-backed) swap space plus a portion of the currently available physical
memory.
Virtual swap space has these advantages:
4 The need for large amounts of physical swap space is reduced because virtual
swap space does not necessarily correspond to physical (disk) storage.
4 A pseudo file system called SWAPFS provides addresses for anonymous memory
pages. Because SWAPFS controls the allocation of memory pages, it has greater
flexibility in deciding what happens to a page. For example, it might change the
page’s requirements for disk-backed swap storage.
malloc error O
This message means TMPFS ran out of physical memory while attempting to create a
new file or directory.
See TMPFS(7FS) for information on recovering from the TMPFS-related error
messages.
If Your System Has n Mbytes of Then the Default Swap Space Allocated Is ...
Physical Memory ...
16-63 32 Mbytes
64-127 64 Mbytes
Additional swap space can also be added to the system by creating a swap file. See
“Adding More Swap Space” on page 503 for information about creating a swap file.
4 To save crash dumps, allocate 100% of physical memory to save a worst-case crash
dump.
4 If you are unsure of system or application requirements, allocate 50 to 100% of the
system’s physical memory. For example, allocate 16-32 Mbytes of swap space for a
system with 32 Mbytes of physical memory. This will provide 48-64 Mbytes of
total virtual swap space.
4 Determine whether large applications (like compilers) will be using the /tmp
directory. Then allocate additional swap space to be used by TMPFS. See “Swap
Space and the TMPFS File System” on page 498 for information about TMPFS.
# swap -l
swapfile dev swaplo blocks free
(continued)
# swap -s
total: 10492k bytes allocated + 7840k reserved = 18332k used, 21568k available
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.
The output from the swap -s command is summarized in the table below.
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).
Keyword Description
Option Description
Creates an empty file. The size is noted, but the disk blocks are not
−n
allocated until data is written to them.
Caution - Use the −n option only when creating an NFS swap file.
The swap file of the size nnn (in Kbytes, bytes, or Mbytes) and name you specify
is created.
# /usr/sbin/swap -a /path/filename
You must use the absolute path name to specify the swap file. The swap file is
added and available until the file system is unmounted, the system is rebooted, or
the swap file is removed. Keep in mind that you can’t unmount a file system
while some process or program is swapping to the swap file.
4. Add an entry for the swap file to the /etc/vfstab file that specifies the full
path name of the file, and designates swap as the file system type, like this:
/path/filename - - swap - no -
# mkdir /files
# mkfile 24m /files/swapfile
# swap -a /files/swapfile
# vi /etc/vfstab
(An entry is added for the swap file):
/files/swapfile - - swap - no -
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t2d0s1 32,17 8 205624 192704
/files/swapfile - 8 40952 40952
# /usr/sbin/swap -d /path/filename
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
# swap -d /files/swapfile
# (Remove the deleted swap entry from the /etc/vfstab file)
# rm /files/swapfile
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t2d0s1 32,17 8 205624 192720
507
4 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:
4 How to modify the automatic checking done during booting
4 How to find out if a file system needs to be checked
4 How to check and repair a UFS file system interactively
4 How to restore a bad superblock
4 How to fix a UFS file system that fsck cannot repair
The fsck error messages are covered in “Troubleshooting File System Problems” in
System Administration Guide, Volume 2.
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.
FSACTIVE When a file system is mounted and then modified, the state flag is set to
FSACTIVE. The file system might contain inconsistencies. A file system
will be marked as FSACTIVE before any modified metadata is written to
the disk. When a file system is unmounted gracefully, the state flag is set
to FSCLEAN. A file system with the FSACTIVE flag must be checked by
fsck because it might be inconsistent.
FSBAD If the root (/) file system is mounted when its state is not FSCLEAN or
FSSTABLE, the state flag is set to FSBAD. The kernel will not change this
file system state to FSCLEAN or FSSTABLE. If a root (/) file system is
flagged FSBAD as part of the boot process, it will be mounted read-only.
You can run 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 might 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, FSSTABLE, or FSLOG.
The table below shows how the state flag is modified by the fsck command, based
on its initial state.
When a user program does an operation to change the file system, such as a write,
the data to be written is first copied into an in-core buffer in the kernel. Normally,
the disk update is handled asynchronously; the user process is allowed to proceed
even though the data write might not happen until long after the write system call
has returned. Thus at any given time, the file system, as it resides on the disk, lags
behind the state of the file system represented by the in-core information.
Superblock Checks
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:
4 File system size
4 Number of inodes
4 Free-block count
4 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:
4 Format and type
4 Link count
4 Duplicate block
4 Bad block numbers
4 Inode size
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:
4 Blocks already claimed by another inode
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:
4 Plain data blocks
4 Symbolic-link data blocks
4 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 inconsistencies involving:
4 Directory inode numbers pointing to unallocated inodes
4 Directory inode numbers greater than the number of inodes in the file system
4 Incorrect directory inode numbers for “.” and “..” directories
4 Directories disconnected from the file system
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.)
# fsck /dev/rdsk/c0t0d0s7
** /dev/rdsk/c0t0d0s7
** Last Mounted on /export/home
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 9 used, 2833540 free (20 frags, 354190 blocks, 0.0% fragmentation)
#
The last line of fsck output describes the following information about the file
system:
When you create new file systems, add entries to /etc/vfstab indicating whether
they are to be checked and mounted at boot time. See Chapter 36 for more
information about adding entries to the /etc/vfstab file.
Information in the /etc/vfstab file is specific for the slices and file systems for
each system. Here is an example of an /etc/vfstab file:
The table below describes the function of the fsck pass field.
- (hyphen) The generic fsck command Use a hyphen for read-only file
will not check the file system systems, remote file systems, or
regardless of the state of the file pseudo file systems, such as /
system. proc, to which checking does
not apply.
0 The file system specific fsck When the value is 0 for UFS file
command is called. systems, the file system is not
checked.
1 or greater and fsck The file system specific fsck The value can be any number
-o p is used automatically checks UFS file greater than 1.
systems in parallel.
In preen mode (−o p option), 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.
2. Edit /etc/vfstab entries in the fsck pass field, and save the changes.
The next time the system is booted, the new values are used.
# umount /mount-point
# fsck -m /dev/rdsk/device-name
# fsck -m /dev/rdsk/c0t0d0s6
** /dev/rdsk/c0t0d0s6
ufs fsck: sanity check: /dev/rdsk/c0t0d0s6 needs checking
2. Unmount the local file systems except root (/) and /usr.
# umountall -l
# fsck
All file systems in the /etc/vfstab file with entries in the fsck pass field
greater than zero are checked. You can also specify the mount point directory or
/dev/rdsk/device-name as arguments to fsck. Any inconsistency messages are
displayed. See “Troubleshooting File System Problems” in System Administration
Guide, Volume 2 for information about how to respond to the error message
prompts to interactively check one or more UFS file systems.
Caution - Running fsck on a mounted file system might cause a system to crash if
fsck makes any changes, unless stated otherwise, such as running fsck in
single-user mode to repair a file system.
# fsck /dev/rdsk/c0t0d0s6
checkfilesys: /dev/rdsk/c0t0d0s6
** Phase 1 - Check Block and Sizes
INCORRECT BLOCK COUNT I=2529 (6 should be 2)
CORRECT? y
You can run fsck with the −o p option to preen the file systems after an unclean
shutdown. In this mode, fsck does not look at the clean flag and does a full check.
These actions are a subset of the actions that fsck takes when it runs interactively.
# umount mount-point
# fsck -o p /dev/rdsk/device-name
# fsck -o p /usr
# umount mount-point
Caution - Be sure to use the newfs -N in the next step. If you omit the −N option,
you will create a new, empty file system.
# newfs -N /dev/rdsk/device-name
The output of this command displays the block numbers that were used for the
superblock copies when newfs created the file system, unless the file system was
created with special parameters. See “Deciding on Custom File System
Parameters” on page 542 for information on creating a customized file system.
fsck uses the alternative superblock you specify to restore the primary
superblock. You can always try 32 as an alternative block, or use any of the
alternative blocks shown by newfs -N.
# cd /
# umount /files7
# newfs -N /dev/rdsk/c0t3d0s7
/dev/rdsk/c0t3d0s7: 163944 sectors in 506 cylinders of 9 tracks, 36 sectors
83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
super-block backups (for fsck -b #) at:
32, 5264, 10496, 15728, 20960, 26192, 31424, 36656, 41888,
47120, 52352, 57584, 62816, 68048, 73280, 78512, 82976, 88208,
93440, 98672, 103904, 109136, 114368, 119600, 124832, 130064, 135296,
140528, 145760, 150992, 156224, 161456,
# fsck -F ufs -o b=5264 /dev/rdsk/c0t3d0s7
Alternate superblock location: 5264.
** /dev/rdsk/c0t3d0s7
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
36 files, 867 used, 75712 free (16 frags, 9462 blocks, 0.0% fragmentation)
/dev/rdsk/c0t3d0s7 FILE SYSTEM STATE SET TO OKAY
If the superblock in the root (/) file system becomes damaged and you cannot boot
the system, reinstall /kernel/unix and rebuild the root (/) file system with newfs.
The table below describes the options and arguments to the generic fsck command.
Directory Description
529
TABLE 40–1 Default Directories in the root (/) File System (continued)
Directory Description
Directory Description
Directory Description
Directory Description
/usr Mount point for the /usr file system. See Table 40–2 for
more information.
/var/dt
dtlogin configuration files
Directory Description
/var/run Temporary system files that are not needed across system
reboots. This is a TMPFS-mounted directory.
The table below describes the default directories in the /usr file system.
Directory Description
Directory Description
Directory Description
Directory Description
Directory Description
This section provides additional information about the organization and function of
these blocks.
The Superblock
The superblock stores much of the information about the file system. A few of the
more important things it contains are:
4 Size and status of the file system
4 Label (file system name and volume name)
4 Size of the file system logical block
4 Date and time of the last update
4 Cylinder group size
4 Number of data blocks in a cylinder group
4 Summary data block
4 File system state: clean, stable, or active
4 Path name of the last mount point
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:
4 The type of the file:
Inode
Indirect
Block
Address 0
Array 11
Storage
12 Double Blocks
Indirect Indirect
13 Block Block
..
14 .
Indirect
Block
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, The figure below
shows a series of cylinder groups in a generic UFS file system.
Superblock
Inodes
Cylinder Group Map Superblock
Inodes
Storage Blocks Storage Blocks
Storage Blocks
SPARC platform only - You can only specify 8192–byte block size on the sun4u
platform.
To choose the best logical block size for your system, consider both the performance
desired and the available space. For most UFS systems, an 8-Kbyte file system
provides the best performance, offering a good balance between disk performance
and use of space in primary memory and on disk.
As a general rule, to increase efficiency, use a larger logical block size for file systems
where most of the files are very large. Use a smaller logical block size for file systems
where most of the files are very small. You can use the quot -c file-system command
on a file system to display a complete report on the distribution of files by block size.
Note - The upper bound might equal the full block size, in which case the fragment
is not a fragment at all. This configuration might be optimal for file systems with
very large files when you are more concerned with speed than with space.
When choosing a fragment size, look at the trade-off between time and space: a small
fragment size saves space, but requires more time to allocate. As a general rule, to
increase storage efficiency, use a larger fragment size for file systems where most of
the files are large. Use a smaller fragment size for file systems where most of the files
are small.
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
The optimization type is either space or time.
4 Space – When you select space optimization, disk blocks are allocated to minimize
fragmentation and disk use is optimized.
4 Time – When you select time optimization, disk blocks are allocated as quickly as
possible, with less emphasis on their placement. When there is enough free space,
it is relatively easy to allocate disk blocks effectively, without resulting in too
much fragmentation. The default is time.
You can change the value of the optimization type parameter for an existing file
system using the tunefs command.
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.
The table below describes the options and arguments to the newfs command.
Option Description
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.
The logical block size in bytes to use for data transfers. Specify
−b bsize
the size of 4096 or 8192 (4 or 8 Kbytes). The default is 8192
bytes (8 Kbytes).
Option Description
raw_device The special character (raw) device file name of the partition to
contain the file system. This argument is required.
# newfs -N /dev/rdsk/c0t0d0s0
/dev/rdsk/c0t0d0s0: 37260 sectors in 115 cylinders of 9 tracks, 36 sectors
19.1MB in 8 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
superblock backups (for fsck -b #) at:
32, 5264, 10496, 15728, 20960, 26192, 31424, 36656,
#
3. Verify the mounted file system has forced direct I/O enabled.
# mount
.
.
.
/export/home on /dev/dsk/c0t3d0s7 read/write/setuid/forcedirectio ...
This section provides instructions for backing up and restoring data in the Solaris
environment. This section contains these chapters.
551
552 System Administration Guide, Volume 1 ♦ February 2000
CHAPTER 42
553
Definition: Backing Up and Restoring
File Systems
Backing up file systems means copying file systems to removable media (such as
tape) to safeguard against loss, damage, or corruption. Restoring file systems means
copying reasonably current backup files from removable media to a working
directory.
This chapter describes the commands for scheduled backup and restore operations
(ufsdump and ufsrestore); however, other commands are available for copying
files and file systems for sharing or transporting files. The table below provides
pointers to all commands that copy individual files and/or file systems to media.
Media Capacity
Consider Backing Up
These File Systems ... Because ... And At This Interval ...
root (/) – partition 0 The root (/) file system At regular intervals.
contains the kernel and
might contain the /var
directory in which
frequently modified files
such as mail and
accounting are kept.
/export/home The /export/home file More often than root (/) or /usr,
system contains directories perhaps as often as once a day,
and subdirectories of all depending on your site needs.
users on the standalone
system.
Consider Backing Up
These File Systems ... Because ... And at This Interval ...
root (/) – partition 0 These file systems contain Once a day to once a month
the kernel, major depending on your site’s needs.
/export – partition 3 commands, and
root (/) - if you frequently add
executables.
/usr – partition 6 and remove clients and hardware
on the network, you have to
change important files in root (/),
including the kernel configuration
file. In this case, you should do a
full backup on the root (/) file
system between once a week and
once a month. If your site keeps
users’ mail in the /var/mail
directory on a mail server (which
client systems then mount), you
might want to back up root (/)
daily (or /var, if it is a separate
file system).
TABLE 42–5 Tasks You Can Perform With the ufsdump and ufsrestore Commands
With This
Command ... You Can ... Comments
ufsdump Back up complete or partial file The tape device can be on any
systems to local or remote tape drives system in the 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 You can run ufsdump from one
network from a single system system on 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.
With This
Command ... You Can ... Comments
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.
0 9 9 9 9 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 numbers themselves have no defined
meaning; you attribute meaning by ordering them in a high/low sequence.
0 3 4 5 6 2
4 All files that have changed since the lower-level backup at the end of the previous
week are saved each day.
4 For each weekday level 9 backup, the previous level 0 or level 5 is the closest
backup at a lower level. Therefore, each weekday tape contains all the files
changed since the end of the previous week (or the initial level 0 for the first
week).
4 For each Friday level 5 backup, the nearest lower-level backup is the level 0 done
at the beginning of the month. Therefore, each Friday’s tape contains all the files
changed during the month to that point.
1st of Month 0
Week 1 9 9 9 9 5
Week 2 9 9 9 9 5
Week 3 9 9 9 9 5
Week 4 9 9 9 9 5
The table below shows how the contents of the tapes can change across two weeks
using the previous schedule. Each letter represents a different file.
Tape Requirements
With this schedule, you 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, the most recent Friday tape, and the most recent daily tape since the last
Friday tape (if any).
1st of Month 0
Week 1 9 9 9 9 3
Week 2 9 9 9 9 4
Week 3 9 9 9 9 5
Week 4 9 9 9 9 6
Tape Requirements
With this schedule, you 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 need the following tapes: the level
0, all the Friday tapes, and the most recent daily tape since the last Friday tape (if
any).
1st of Month 0
Week 1 3 4 5 6 2
Week 2 3 4 5 6 2
Week 3 3 4 5 6 2
Week 4 3 4 5 6 2
The table below shows how the contents of the tapes can change across two weeks
using the previous schedule. Each letter represents a different file.
jkl m no pq abcdefghij
Week 2 klmnopqrs
Tape Requirements
With this schedule you need at least nine tapes (if you want to reuse daily
tapes—not 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 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
Need to restore different 4 Do daily incremental This schedule saves all files
versions of files (for backups every modified that day, as well as those
example, file systems working day. files still on disk that were
used for word processing) 4 Do not reuse the same modified since the last backup of a
tape for daily lower level. However, with this
incremental backups. schedule you should use a
different tape each day because a
file changed on Tuesday, and again
on Thursday, goes onto Friday’s
lower-level backup looking like it
did Thursday night—not Tuesday
night. If a user needs the Tuesday
version, you cannot restore it
unless you have a Tuesday backup
tape (or a Wednesday backup
tape). Similarly, a file that is
present on Tuesday and
Wednesday, but removed on
Thursday, does not appear on the
Friday lower-level backup.
Are backing up a number Consider offsetting the This way you’re not doing all level
of file systems on the schedule for different file 0 backups on the same day.
same server systems.
Need to minimize tapes Increase the level of This means only changes from day
incremental backups to day are saved on each daily tape.
done across the week.
This chapter describes the procedures for backing up file systems using the ufsdump
command.
This is a list of the step-by-step instructions in this chapter.
4 “How to Find File System Names” on page 572
4 “How to Determine the Number of Tapes for a Full Backup” on page 572
4 “How to Do Backups to Tape” on page 574
For detailed information on syntax, options, and arguments for the ufsdump
command, see Chapter 45.
Preparing to Do Backups
Preparing to back up file systems begins with planning, which is described in
Chapter 42 and includes choosing:
4 A tape drive
4 The file systems to back up
4 The type of backup (full or incremental)
4 A backup schedule
This section describes other tasks you might need to perform before backing up file
systems, including:
4 Finding names of file systems to back up
4 Determining the number of tapes for a full backup
571
How to Find File System Names
1. Display the contents of the /etc/vfstab file.
$ more /etc/vfstab
2. Look in the mount point column for the name of the file system.
3. You use the mount point in the mount point column when you back up the
file system.
2. Estimate the size of the backup in bytes by using the usfdump S command.
# ufsdump S filesystem
3. Divide the estimated size by the capacity of the tape to see how many tapes
you need.
# ufsdump S /export/home
489472
Doing Backups
The following are general guidelines for performing backups:
4 Use single-user mode or unmount the file system.
4 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.
4 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 the tape drive is located. (Typically, the
tape drive is located on the system from which you run the ufsdump command,
but it does not have to be.)
Another way to back up files to a remote drive is to pipe the output from the
ufsdump command to the dd command. See Chapter 46 for information about
using the dd command.
4 If you are doing remote backups across the network, the system with the tape
drive must have entries in its /.rhosts file for each client that will be using the
drive. Also, the system initiating the backup must be included in the /.rhosts
file on each system it will back up.
4 To specify a remote drive on a system, use the naming convention that matches
the OS release of the system with the remote tape drive. For example, use
/dev/rst0 for a remote drive on a system running the SunOS 4.1.1 release or
compatible versions; use /dev/rmt/0 for a system running the Solaris 8 release
or compatible versions.
Note - Use the nisbackup command to back up a NIS+ master server running the
Solaris 2.5 release or compatible versions. See Solaris Naming Administration Guide
for information on using this command.
# shutdown -g30 -y
3. [Optional] Check the file system for consistency with the fsck command.
Running the fsck -m command checks for consistency of file systems. For
example, power failures can leave files in an inconsistent state. For more
information on the fsck command, see Chapter 39.
host root
host Specifies the name of the system on which you will run ufsdump
to perform the backup.
b. On the tape server, verify that the host added to the /.rhosts file is
accessible through the name service.
6. Insert a tape that is not write protected into the tape drive.
Record dumps
−u option ufsdump 9ucf /dev/rmt/0 /export/ “Example—Incremental
to /etc/ home Backup, root (/) ” on
dumpdates
page 576
file
Specify a
−c option ufsdump 9ucf /dev/rmt/0 /export/ “Example—Incremental
cartridge tape home Backup, root (/) ” on
page 576
Specify the
−f dump-file ufsdump 9ucf /dev/rmt/0 /export/ “Example—Incremental
tape drive home Backup, root (/) ” on
page 576
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.
11. Verify the backup was successful by using the ufsrestore command to
display the tape contents.
This command is described in Chapter 44.
# shutdown -g30 -y
# ufsdump 0ucf /dev/rmt/0 /
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Tue Jul 13 10:46:09 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 71058 blocks (34.70MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 70936 blocks (34.64MB) on 1 volume at 64 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Tue Jul 13 10:46:09 1999
# ufsrestore tf /dev/rmt/0
2 .
3 ./lost+found
5696 ./usr
11392 ./var
17088 ./export
22784 ./export/home
28480 ./opt
5697 ./etc
11393 ./etc/default
11394 ./etc/default/sys-suspend
11429 ./etc/default/cron
11430 ./etc/default/devfsadm
11431 ./etc/default/dhcpagent
11432 ./etc/default/fs
11433 ./etc/default/inetinit
11434 ./etc/default/kbd
11435 ./etc/default/nfslogd
11436 ./etc/default/passwd
.
.
.
# (Press Control-d to bring system to run level 3)
(continued)
(continued)
7555 ./kryten/letters/letter2
7556 ./kryten/letters/letter3
11328 ./kryten/reports
11329 ./kryten/reports/reportA
11330 ./kryten/reports/reportB
11331 ./kryten/reports/reportC
.
.
.
#
Note - Notice the SunOS 4.x-style device name (/dev/rst0) used with the
ufsdump command.
(continued)
32 ./kryten/reports/reportB
33 ./kryten/reports/reportC
.
.
.
#
Note - When you back up data on a system running SunOS 4.1.4 or a compatible
version, you must use the dump command—not the ufsdump command.
(continued)
.
.
#
583
4 The tapes (or diskettes) you need
4 The raw device name on which you want to restore the file system
4 The type of tape drive you will use
4 The device name (local or remote) for the tape drive
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.
2. Refer to your backup plan to find the date of the last backup that would have
the file or file system on it.
To retrieve the most recent version of a file, work backward through the
incremental backups from highest to lowest level and most recent to least recent,
unless the user requests otherwise.
4. Insert the media containing the backups in the drive and use the ufsrestore
command to verify the correct media.
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.
# cd /var/tmp
To avoid conflicts with other users, you might want to create and change to a
subdirectory, such as /var/tmp/restore, in which to restore the files.
If you are restoring a hierarchy, you should restore the files in a temporary
directory on the same file system where the files will reside, so you can use the
mv command to move the entire hierarchy where it belongs after it is restored.
# ufsrestore if /dev/rmt/n
ufsrestore> ls directory
b. Change to a directory.
ufsrestore> cd directory-name
d. If you need to remove a directory or file name from the list of files to be
restored, use the delete command.
ufsrestore> verbose
ufsrestore> extract
9. Type the volume number and press Return. If you have only one volume, type
1 and press Return.
The files and directories in the list are extracted and restored to the current
working directory.
10. To keep the mode of the current directory unchanged, enter n at the set
owner/mode prompt.
ufsrestore> quit
# ls -l
b. Check the list to be sure all the files and directories you specified in the list
have been restored.
# cd /var/tmp
# ufsrestore if /dev/rmt/0
ufsrestore> ls
.:
.cpr_config etc/ lost+found/ sbin/ usr/
TT_DB/ export/ mnt/ sccs/ var/
b/ home/ net/ share/ vol/
bin kernel/ opt/ shared/ ws/
dev/ lib platform/ src/ xfn/
devices/ license/ proc/ tmp/
ufsrestore> cd etc
ufsrestore> add passwd shadow
ufsrestore> verbose
verbose mode on
ufsrestore> extract
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./etc/shadow
extract file ./etc/passwd
Add links
Set directory mode, owner, and times.
set owner/mode for ‘.’? [yn] n
ufsrestore> quit
#
# cd /var/tmp
To avoid conflicts with other users, you might want to create and change to a
subdirectory, such as /var/tmp/restore, in which to restore the files.
6. Type the volume number where files are located and press Return.
7. To keep the mode of the current directory unchanged, type n and press Return
at the set owner/mode prompt.
# ls -l
b. Check the list to be sure all the files and directories you specified in the list
have been restored.
# cd /var/tmp
# ufsrestore xvf /dev/rmt/0 ./etc/passwd ./etc/shadow
Verify volume and initialize maps
Media block size is 126
Dump date: Wed Jul 14 08:42:42 1999
Dumped from: the epoch
Level 0 dump of a partial file system on starbug:/etc
Label: none
Extract directories from tape
Initialize symbol table.
Make node ./etc
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./etc/passwd
extract file ./etc/shadow
Add links
Set directory mode, owner, and times.
set owner/mode for ‘.’? [yn] n
Directories already exist, set modes anyway? [yn] n
# cd etc
# mv passwd /etc
# mv shadow /etc
# ls -l /etc
Note - You cannot use this procedure to restore root (/) or /usr. See “How to
Restore the root (/) and /usr File Systems” on page 595 for instructions on restoring
these file systems.
1. Become superuser.
# umount /dev/rdsk/device-name
# 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 destroy the wrong file system.
# cd /mnt
8. Insert the first volume of the level 0 tape into the tape drive.
10. Remove the tape and load the next level tape in the drive.
Always restore tapes starting with 0 and continuing until you reach the highest
level.
11. Repeat Step 7 on page 592 through Step 10 on page 593 for each level of dump,
from the lowest to the highest level.
# ls
# rm restoresymtable
# cd /
# umount /mnt
16. Remove the last tape and insert a new tape that is not write-protected in the
tape drive.
17. Use the ufsdump command to make a level 0 backup of the newly restored file
system.
# ls mount-point
# umount /export/home
# newfs /dev/rdsk/c0t3d0s7
newfs: construct a new file system /dev/rdsk/c0t3d0s7: (y/n)? y
/dev/rdsk/c0t3d0s7:
410400 sectors in 270 cylinders of 19 tracks, 80 sectors
200.4MB in 17 cyl groups (16 c/g, 11.88MB/g, 5696 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 24432, 48832, 73232, 97632, 122032, 146432, 170832, 195232, 219632,
244032, 268432, 292832, 317232, 341632, 366032, 390432,
# mount /dev/dsk/c0t3d0s7 /mnt
# cd /mnt
# ufsrestore rvf /dev/rmt/0
Verify volume and initialize maps
Media block size is 126
Dump date: Wed Jul 14 08:49:33 1999
Dumped from: the epoch
Level 0 dump of /export/home on earth:/dev/dsk/c0t3d0s7
Label: none
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Warning: ./lost+found: File exists
Make node ./kryten
Make node ./kryten/letters
Make node ./kryten/reports
Extract new leaves.
Check pointing the restore
extract file ./kryten/.cshrc
extract file ./kryten/.login
extract file ./kryten/b
extract file ./kryten/memos
extract file ./kryten/letters/b
extract file ./kryten/letters/letter1
extract file ./kryten/letters/letter2
extract file ./kryten/letters/letter3
extract file ./kryten/reports/reportA
extract file ./kryten/reports/reportB
extract file ./kryten/reports/reportC
(continued)
Add links
Set directory mode, owner, and times.
Check the symbol table.
Check pointing the restore
# ls
# rm restoresymtable
# cd /
# umount /mnt
# ufsdump 0ucf /dev/rmt/0 /export/home
.
.
.
# mount /dev/dsk/c0t3d0s7 /export/home
# ls /export/home
# cd /mnt
6. Remove the tape and load the next level tape in the drive.
Always restore tapes starting with 0 and continuing from lowest to highest level.
8. Repeat Step 6 on page 595 and Step 7 on page 596 for each additional tape.
# ls
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/device-name
14. Create the boot blocks on the root partition by using the installboot(1M)
command.
See “SPARC: Example—Restoring the root (/) File System” on page 597 for an
example of using the installboot command on a SPARC based system or “IA:
Example—Restoring the root (/) File System” on page 597 for an example of
using the installboot command on an IA based system.
17. Repeat steps 5 through 18 for the /usr file system, if necessary.
# init 6
(continued)
ufs/bootblk /dev/rdsk/c0t3d0s0
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6
599
Detecting the End of Media
ufsdump writes a sequence of fixed-size records. When ufsdump receives
notification that a record was only partially written, it assumes that it has reached
the physical end of the media. This method works for most devices. If a device is not
able to notify ufsdump that only a partial record has been written, a media error
occurs as ufsdump tries to write.
Note - DAT devices and 8mm tape devices detect end-of-media. Cartridge tape
devices and 1/2–inch tape devices do not detect end-of-media.
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 might 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.
Use the naming convention for the device that matches the operating system for the
system on which the device resides, not the system from which you run the
ufsdump command. If the drive is on a system that is running a previous SunOS
release (for example, 4.1.1), use the SunOS 4.1 device name (for example,
/dev/rst0). If the system is running Solaris software, use the SunOS 5.8 convention
(for example, /dev/rmt/0).
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:
For a file system, specify the raw device file for a disk slice. It includes the disk
controller abbreviation (c), the target number (t) for SCSI devices only, a number
indicating the disk number (d), and the slice number (s). For example, if you have a
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.
Automatically calculate the number of tapes You can use the dry run mode (S option) to
or diskettes needed for backing up file determine the amount of space that is
systems needed before actually backing up file
systems.
Enable you to back up files that are remotely Files on the server must be backed up on
mounted from a server the server itself. Users are denied permission
to run ufsdump on files they own that are
located on a server.
files-to-back-up Identifies the files to back up; and these arguments must
always come last.
# ufsdump files-to-back-up
These options do a level 9 incremental backup to the default tape drive at its
preferred density.
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.
d bpi Tape density. You need to use this option only when ufsdump
cannot detect the end of the media.
Option Description
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.
Option Description
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.
4 Ensure root access entries are removed from /.rhosts files on clients and servers
if doing centralized backups.
ufsrestore [options][arguments][filename …]
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
Option Description
x [filename…] Extract. Selectively restores the files you specify by the filename
argument. filename can be a list of files and directories. All files
under a specified directory are restored unless you also use the
h option. If you omit filename or enter “.” for the root directory,
all files on all volumes of the media (or from standard input)
are restored. Existing files are overwritten, and warnings are
displayed.
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 are prompted to
mount the appropriate volume before extracting the file(s).
Option Description
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.
sn Skips to the nth backup file on the media (first volume). This
option is useful when you put more than one backup on a
single tape.
Option Description
ls [directory-name] Lists the contents of either the current directory or the specified
directory. Directories are marked by a / suffix 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. 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. 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.
setmodes Lets you set the mode for files to be restored to match the mode
of the root directory of the file system from which they were
backed up. You are prompted with: set owner/mode for ’.’
[yn]? Type y (for yes) to set the mode (permissions, owner,
times) of the current directory to match the root directory of the
file system from which they were backed up. Use this mode
when restoring a whole file system.
Type n (for no) to leave the mode of the current directory
unchanged. Use this mode when restoring part of a backup to a
directory other than the one from which the files were backed
up.
Option Description
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.
Here is a list of the step-by-step instructions in this chapter:
4 “How to Clone a Disk (dd)” on page 616
4 “How to Copy Directories Between File Systems (cpio)” on page 619
4 “How to Copy Files to a Tape (tar)” on page 623
4 “How to List the Files on a Tape (tar)” on page 624
4 “How to Retrieve Files From a Tape (tar)” on page 625
4 “How to Copy All Files in a Directory to a Tape (cpio)” on page 627
4 “How to List the Files on a Tape (cpio)” on page 628
4 “How to Retrieve All Files From a Tape (cpio)” on page 629
4 “How to Retrieve Specific Files From a Tape (cpio)” on page 630
4 “How to Copy Files to a Remote Tape Drive (tar and dd)” on page 631
4 “How to Extract Files From a Remote Tape Drive” on page 632
4 “How to Copy Files to a Single Formatted Diskette (tar)” on page 634
4 “How to List the Files on a Diskette (tar)” on page 635
4 “How to Retrieve Files From a Diskette (tar)” on page 636
4 “How to Archive Files to Multiple Diskettes” on page 637
4 “How to Create an Archive for Older SunOS Releases” on page 637
4 “How to Retrieve bar Files From a Diskette” on page 638
613
Commands for Copying File Systems
When you need to back up and restore complete file systems, use the ufsdump and
ufsrestore commands described in Chapter 45. When you want to copy or move
individual files, portions of file systems, or complete file systems, you can use the
procedures described in this chapter as an alternative to ufsdump and ufsrestore.
The table below describes when to use the various backup commands.
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.
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:
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
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
2. Become superuser.
3. Create the /reconfigure file on the system so the system will recognize the
clone disk to be added when it reboots.
# touch /reconfigure
# init 0
ok boot
7. Use the dd command to copy the master disk to the clone disk.
# fsck /dev/rdsk/device-name
10. Edit the clone disk’s /etc/vfstab to reference the correct device names.
For example, changing all instances of c0t3d0 with c0t1d0.
# umount /mnt
# init 0
Note - The installboot command is not needed for the clone disk because the
boot blocks are copied as part of the overlap slice.
# sys-unconfig
15. Boot from the clone disk again and provide its system information, such as
host name, time zone, and so forth.
# boot diskn
16. Log in as superuser to verify the system information after the system is booted.
# cd filesystem1
The files from the directory name you specify are copied and symbolic links are
preserved.
You might also specify the −u option. This option forces an unconditional copy.
Otherwise older files do not replace newer files. This might be useful if you want
an exact copy of a directory, and some of the files being copied might already
exist in the target directory.
4. Verify the copy was successful by displaying the destination directory contents.
# cd filesystem2
# ls
# rm -rf filesystem1
pax Copy files, special files, 4 Better portability See disadvantages for
or file systems that than the tar or tar command, except
require multiple tape cpio commands that pax can create
volumes or when you for multi-tape volumes
want to copy files to POSIX-compliant
and from systems
POSIX-compliant 4 Multi-vendor
systems support
The tape drive and device name you use depend on the hardware and configuration
for each system. See “Choosing Which Media to Use” on page 639 for more
information about tape drives and device names.
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)” on page 624 for more information on listing files on a tar tape.
$ cd /export/home/kryten
$ ls reports
reportA reportB reportC
$ tar cvf /dev/rmt/0 reports
a reports/ 0 tape blocks
a reports/reportA 59 tape blocks
a reports/reportB 61 tape blocks
a reports/reportC 63 tape blocks
$ tar tvf /dev/rmt/n
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
$ cd /var/tmp
$ tar xvf /dev/rmt/0
x reports/, 0 bytes, 0 tape blocks
x reports/reportA, 0 bytes, 0 tape blocks
x reports/reportB, 0 bytes, 0 tape blocks
x reports/reportC, 0 bytes, 0 tape blocks
x reports/reportD, 0 bytes, 0 tape blocks
$ ls -l
filename ... Indicates the files and directories you want to copy.
$ pax -f /dev/rmt/0
5. Remove the tape from the drive and write the names of the files on the tape
label.
All files in the directory are copied to the tape in the drive you specify,
overwriting any existing files on the tape. The total number of blocks copied is
shown.
3. Verify the files are copied to tape by using the following cpio command.
4. Remove the tape from the drive and write the names of the files on the tape
label.
Note - Listing the table of contents takes as long as it does to read the archive file
because the cpio command must process the entire archive.
Lists the table of contents for the files on the tape in the tape
−t
drive you specify.
Caution - Using absolute path names can be dangerous because you might
overwrite existing files on your system.
3. Copy all files from the tape to the current directory using the cpio command.
$ ls -l
$ cd /var/tmp
cpio -icvd < /dev/rmt/0
answers
sc.directives
tests
8 blocks
$ ls -l
"*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.
$ ls -l
$ cd /home/smith/Book
$ cpio -icv "*chapter" < /dev/rmt/0
Boot.chapter
Directory.chapter
Install.chapter
Intro.chapter
31 blocks
$ ls -l
2. To test whether or not you have the appropriate permission to execute a remote
command, try the following:
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.
4. Remove the tape from the drive and write the names of the files on the tape
label.
$ cd /var/tmp
2. To extract files to a remote tape drive, use the tar and dd commands.
$ ls -l /var/tmp
Use double-sided high-density 3.5-inch diskettes (diskettes are marked “DS, HD”).
$ volcheck
$ fdformat -U /vol/dev/aliases/floppy0
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)” on page 635 for more information on listing files.
$ cd /home/smith
$ ls evaluation*
evaluation.doc evaluation.doc.backup
$ tar cvf /vol/dev/rdiskette0/unlabeled evaluation*
a evaluation.doc 86 blocks
a evaluation.doc.backup 84 blocks
$ tar tvf /vol/dev/rdiskette0/unlabeled
$ volcheck
$ volcheck
All of the files on the diskette are copied to the current directory.
5. Verify the files have been retrieved by listing the contents of the current
directory.
$ ls -l
$ /home/smith/Evaluations
$ tar xvf /vol/dev/rdiskette0/unlabeled
x evaluation.doc, 44032 bytes, 86 tape blocks
x evaluation.doc.backup, 43008 bytes, 84 tape blocks
$ ls -l
The −H values have the same meaning for input as they do for output. If the archive
was created using the −H option, you must use the same option when the archive is
read back in or the cpio command will fail, as shown below.
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.
Note - You can use only the −H bar option with −i to retrieve files. You cannot
create files with the bar header option.
$ volcheck
639
TABLE 47–1 Media Storage Capacities
Media Capacity
Tape /dev/rmt/n
Diskette /vol/dev/rdiskette0/unlabeled
In general, you specify a tape drive device as shown in the figure below.
/dev/rmt/XAbn
Optional
Optional No-rewind
Density n no-rewind
l low omit for rewind
Drive m medium
0 h high
1 u ultra
2 c compressed
3
4
n
Figure 47–1 Tape Drive Device Names
If you don’t specify the density, a tape drive typicallys 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.
# mt -f /dev/rmt/n status
$ mt -f /dev/rmt/0 status
Archive QIC-150 tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
$ mt -f /dev/rmt/1 status
Exabyte EXB-8200 8mm tape drive:
sense key(0x0)= NO Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
The following example shows a quick way to poll a system and locate all of its tape
drives.
$ for drive in 0 1 2 3 4 5 6 7
> do
> mt -f /dev/rmt/$drive status
> done
Archive QIC-150 tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
/dev/rmt/1: No such file or directory
/dev/rmt/2: No such file or directory
/dev/rmt/3: No such file or directory
/dev/rmt/4: No such file or directory
/dev/rmt/5: No such file or directory
/dev/rmt/6: No such file or directory
/dev/rmt/7: No such file or directory
$
$ mt -f /dev/rmt/1 retension
$
$ mt -f /dev/rmt/n rewind
$ mt -f /dev/rmt/1 rewind
$
You should create and maintain a log that tracks which media (tape volume) stores
each job (backup) and the location of each backed-up file.
647
aliases directory 244 big-endian bit coding 193
allocated inodes 513 bin group 38
ARCH environment variable 60 block disk device interface
archives (cpio) 637 defined 313
archiving files to multiple diskettes (cpio) 637 when to use 313
autoconfiguration process 282 blocks
autofs 429 bad 514
automount /home 429 boot 539
automounting directory data 515
user home directories 43 duplicate 514
awk command 44 free 541
indirect 514
logical size 542
B
regular data 516
backing up and restoring file systems special inodes 513
commands for 554 storage 541
defined 554 boot block 539
overview of commands 558 boot types, described 103
backup boot-from PROM setting 134
choosing file systems to 556 booting
device names 640 and PC BIOS 164
full (level 0) backup to tape 574 boot process
full and incremental, defined 559 IA 170
preparing for 571 SPARC 164
reasons for 555 for recovery purposes
record of incremental 600 IA 157
types of 559 SPARC 143
backup schedules interactively
daily cumulative, weekly cumulative IA 154
backups 562 SPARC 140
daily cumulative, weekly incremental modifying file system checking 517, 519
backups 563 to force a crash dump and reboot
daily incremental, weekly cumulative IA 162
backups 564 SPARC 146
examples 562, 568 to run level 3
for a server 565 IA 151
guidelines for 560 SPARC 138
recommendations 569, 577 to run level S
using dump levels for 560 IA 152
bad block numbers 514 SPARC 139
bad inode number 515 with the kernel debugger (kadb)
bad superblock 522 SPARC 147
banner command PROM 134 booting a SPARC system over the
bar command network 142
retrieving files created with 638 booting a system (guidelines) 104
base directory (basedir) 254, 255 booting an IA based system over the
basedir keyword (administration files) 254, network 156
255
649
user ID numbers 47 information from a PCMCIA memory
user login names 47 card 229
user passwords information to a PCMCIA memory
Admintool: Users and 48 card 230
by user 40, 41 user accounts
commands for 44 commands 44
frequency of 41, 52 cp command
character special inodes 513 copying CD information 181, 182
checking copying from diskettes 208
file system size 512 copying to diskettes 209
file systems 519 cpio command 619, 627, 631
file systems interactively 520 copying all files in a directory to tape 627
format and type of inodes 512 copying directories between file
free blocks 512 systems 619
free inodes 512 copying files with different header
inode list for consistency 512 format 637
clean shutdown 124 listing files on tape 628
clients retrieving all files from tape 629
software administration 253 retrieving specific files from tape 630
displaying installed software when to use 622
information 263, 265 creating
sharing software with servers 253 a format.dat 353
cloning disks 616 a Solaris fdisk partition 379
clri command 419 compatible archives (cpio) 637
compatibility problems, disk slices and labeling a disk
version incompatibilities 249 IA 386
compatible archives 637 SPARC 367
controlling file and directory access 36, 65 file systems 434
copying loopback file system 438
all files in a directory to tape (cpio) 627 mount point 425
CD information Solaris fdisk partition 376
using command line 181, 182 swap file 503
complete file systems (dd) 615 temporary file system 437
data (ufsdump) 600 UFS file system 435
directories between file systems .cshrc file
(cpio) 619 customizing 42, 56, 58, 66
diskette information custom parameters for file systems 542
from diskettes 207, 208 cylinder group 538
to diskettes 208, 209
files to diskette 633
D
files to diskette (tar) 634
files to remote tape (tar and dd) 631 daemon group 38
files to tape (pax) 626 daily cumulative backups 561
files to tape (tar) 623 daily discrete backups 561
files with different header format damage to file systems 508
(cpio) 637 data block 516
groups of files (cpio) 619 data directory blocks 515
individual files (cpio) 619
650 System Administration Guide, Volume 1 ♦ February 2000
DD (Medium Density) diskettes file system types 431
formatting options 195, 197 tape device name 584
dd command 615, 616, 618 type of tape drive 584
cloning disks 617 who is logged in to a system 126
copying files to remote tape (tar) 631 /dev/dsk directory 313
retrieving files from remote tape drive /dev/rdsk directory 313
(tar) 632 devfsadm 280
default device driver
file system for /tmp (TMPFS) 418 adding 292
mount options 451, 454 defined 281
SunOS file system 421 device instance name 312
tape drive densities 641 device names
defaults backup 640
file permissions 65 finding disk 584
groups 43 finding tape 584
LOGNAME environment variable 61 devices
PATH environment variable 62, 63 accessing 311
printer 61 when to turn off power to 125
SHELL environment variable 62 df command 313, 419
TZ (time zone) environment variable 62 dfstab file
user account default setup configuring for shared CDs 186
commands 44 user home directory sharing and 78
user initialization files 56 direct disk controllers 314
delay (rotational) 544 direct I/O 548
deleting directories
cached file systems 474 base directory (basedir) 254, 255
groups CDs
commands 44 /cdrom mount point 242, 243
software packages under Volume Management 239,
software administration, removing 241, 242
packages 249 changing ownership for user accounts 47
user accounts controlling access to 36, 65
Admintool: Users 48 copying
commands 44 from CDs 181, 182
user home directories 48 from diskette 207
user mailboxes 48 to diskettes 208, 209
density copying between file systems (cpio) 619
diskette formats 195, 197 diskettes
DOS diskettes 202 /floppy mount point 242, 243
UFS diskettes 197, 198 under Volume Management 239
designators home 42
CDs 180 inodes 513
diskettes 194 PATH environment variable and 62, 63
DESKSET environment variable 61 path shell variable and 59, 62
detecting end of media /proc 418
cpio command 619 skeleton 42, 48
ufsdump command 600, 603 /tmp 418
determining
651
unallocated blocks 515 archiving files to multiple (cpio) 637
disabling copying files to (cpio and tar) 633
run control script 118 copying files to (tar) 634
user accounts listing files on (tar) 635
Admintool: Users 48 retrieving files from (tar) 636
commands 44 diskette directories 240
passwords and 48, 53 diskette drives
disk access points 177
adding to a directories under Volume
IA 376 Management 240
SPARC 364 diskettes
automatic configuration of SCSI access
drives 354 access points 177
connecting a secondary disk raw-character access 244
IA 378 using Volume Management 239
SPARC 365 commands 193
connecting a system disk copying information
IA 377 from diskettes 207
SPARC 365 to diskettes 208, 209
creating a file system on a new disk directories under Volume
IA 388 Management 240
SPARC 371 ejecting
creating disk slices and labeling a disk using command line 210
IA 386 examining contents
SPARC 367 using command line 207
determining if formatted 342 finding out if diskette is in use 209
examining a disk label 348 formatting 203
formatting a 331 canceling formatting 198
formatting, when to 341 caution 197, 201
identifying on a system 339 complete format 195
labeling 346 diskette names 194
recovering a corrupted disk label 349 DOS diskettes 201, 203
repairing defective sectors 357, 360 hardware considerations 195, 197
disk controllers 314 size and density options 195, 197,
disk device name 584 198, 202
disk label UFS diskettes 197, 199
creating 346 killing processes accessing 209
described 332 loading
examining with prtvtoc command 348 using Volume Management 205, 206
disk slice mount points 242, 243
defined 323 mounting
disk slices manual compared to automatic 176
determining which slices to use 327 remote diskettes 211, 212
displaying information about 344 moving information
requirements for system using command line 207, 209
configurations 327 names 194
disk-based file systems 416
diskette
652 System Administration Guide, Volume 1 ♦ February 2000
remote access E
accessing diskettes on other Edit menu
systems 211, 212 Admintool: Groups
making diskettes available to other Add option 75
systems 212 Modify option 81
UFS diskettes Admintool: Users
adding UFS file system 200, 201 Add option 76, 77
canceling formatting 198 eject command
formatting 197, 199 CDs 183
SPARC vs. IA formats 195, 245 diskettes 210
displaying ejecting
CD contents CDs
using command line 181 using command line 183
CD user 182, 183 diskettes
device information 286 using command line 210
disk slice information 344 PCMCIA memory cards
diskette contents using command line 232
using command line 207 encryption 49
environment variables 59 end-of-media detection
installed software information cpio command 619
software administration, displaying ufsdump command 600, 603
installed software env command 59
information 249 environment
PCMCIA contents 229 shell 59, 62
swap space 501 environment variables
system configuration information 283, described 59, 64
286 /etc files
user mask 65 user account information and 37, 49
dmesg command 286 /etc/dfs/dfstab file
IA example 287 user home directory sharing and 78, 186
SPARC example 287 /etc/dumpdates file 600
donor slice, described 335 /etc/init.d directory 117
DOS /etc/inittab file 111, 114
file system 416 /etc/inittab file
formatting diskettes 201, 203 entries described 111, 112
complete format 195 /etc/passwd file 49, 145, 158
platform-compatibility 195 /etc/passwd file
size and density options 195, 197 user ID number assignment and 38, 48
driver not attached message 284 to 50
/vol/dev/dsk directory 241, 242 /etc/rmmount.conf file
dump levels sharing CDs 187, 188, 214
daily, cumulative backups 561 /etc/shadow file
daily, discrete backups 561 described 49
defined 560 /etc/skel directory 56
duplicate blocks 514 /etc/vfstab file 79
DVD-ROM 411 export command 60
dynamic reconfiguration 293 /export/home file system 42
653
/export/home directory 422 ISO 9660 416
Extended Density diskettes large 444
formatting options 195, 196 making available 441
extended fundamental types (UFS file manual pages 421
system) 423 mount table 427
mounting NFS 454
NAMEFS 419
F
network-based 417
fdformat command 220 /opt 422
confirmation message 198 PC 416
convenience options 197, 202 preening 521, 522
formatting DOS diskettes 202, 203 /proc 422
formatting UFS diskettes 197 process 418
options 219 PROCFS 418
size and density options 196, 197, 202 pseudo 417
syntax 197, 198, 202, 203 reasons for inconsistencies 511
verifying correct format 197 restoring complete 584, 592
FDFS file system 419 sharing 428
ff command 419 SPECFS 419
FIFO inodes 513 SWAPFS 419
FIFOFS file system 419 terminating all processes 457
file system table TMPFS 417
virtual 427 types of 416
file systems UFS 416
/ 422 UNIX 416
4.3 Tahoe 416 unmounting 458
administrative commands 419 /usr 422
BSD Fat Fast 416 /var 422
cached 462 which to back up 556
checking 519 why you back up 555
checking interactively 519, 520 files
checking size 512 archiving to multiple diskettes (cpio) 637
copying complete (dd) 615 changing ownership for user accounts 47
creating loopback 438 controlling access to 36, 65
creating UFS 435 copying (cpio) 619
custom parameters 542 copying to diskette (cpio and tar) 633
cylinder group struct 538 copying to diskette (tar) 634
damage to 508 copying to tape (pax) 626
default SunOS 421 copying to tape (tar) 623
definition of 416 /etc/default/fs 430
disk-based 416 /etc/dfs/fstypes 430
DOS 416 in the /proc directory 418
/export/home 422 listing on diskette (tar) 635
FDFS 419 listing on tape (cpio) 628
FIFOFS 419 listing on tape (tar) 624
finding types 431 number of 545
fixing 524 restoring interactively 587
High Sierra 416
657
LOGNAME environment variable 61 mount command 313, 420
loopback file system remote CDs 184
creating 438 remote diskettes 211
mounting 448 mount point 425
lost+found directory 508 mount table 427
Low Density diskettes mountall command 420
formatting options 195, 197 mounting
LPDEST environment variable 61 all files in vfstab file 449
ls command file systems 425
examining CD contents 181 file systems automatically 429
examining diskette contents 207 LOFS file systems 449
manual compared to automatic 176
mount points
M
CDs 184, 242, 243
magnetic tape cartridge diskettes 242, 243
retensioning 643 NFS file systems 448, 454
rewinding 644 PCMCIA memory cards 233
mail aliases remote CDs 184, 185
user login names vs. 37 remote diskettes 211, 212
MAIL environment variable 60, 61 s5fs file systems 454
maintaining tape drives 644 UFS file systems 448
make command 44 user home directories 79
MANPATH environment variable 61 automounting 43
MANSECT environment variable 61 remote 77, 79
manual mounting using default options 451, 454
automatic mounting compared to 176 moving
remote CDs 184, 185 diskette information
remote diskettes 211, 212 from diskettes 207, 208
manual pages 421 to diskettes 208, 209
mask 65 mt command 643
maximums multiple versions of software packages 254,
secondary groups users can belong to 43 255
user ID number 38 multiuser state, see run level 3
user login name length 37 musical CDs 188
user password length 40
media was found message 206
Medium Density (DD) diskettes N
formatting options 195, 197 name services
memory storage (virtual) 422, 498 groups and 44
minimum free space 543 user accounts and 37, 44, 49
minimums NAMEFS file system 419
user login name length 37 names
user password length 40 group
mkfile command 503, 504 described 43
mkfs command 420, 434 software package naming
mnttab file 427 conventions 253
modifying file system checking 519 SUNW prefix 253
monitor (PROM) 163
659
described 62, 63 caution 254, 266
setting up 63 overview 251, 257
path shell variable 59, 62 s option (spooled packages) 267
pathnames 177 prerequisites for using 253
PC BIOS (and booting) 164 rm command vs. 254, 266
PC file system 416 playing musical CDs 188
PCI hot-plugging 279 preening file systems 521, 522
PCMCIA memory cards preparing
accessing on other systems 233 for backups 571
copying or moving information from 229 to restore files 583
copying or moving information to 230 primary groups 43, 249
default label 219 printers (default) 61
displaying the contents of 229 /proc directory 418, 422
ejecting 232 process file system 418
formatting for a UFS file system 219 PROCFS file system 418
formatting for DOS 224 .profile file
identifying 218 customizing 42, 56, 58, 66
loading 227 PROM
making available to other systems 235 changing boot-from setting 134
mounting 234 finding release level 134
permissions 65, 73 finding the ROM revision 134
copying files from CDs 182 monitor 163
physical device name 312 switching to the ok prompt 134
/pkg directory 262, 263 prompt shell variable 62
pkgadd command prtconf command 285
alternate base directory and 255 prtvtoc command 314, 348
bypassing user interaction 254, 255 PS1 environment variable 62
overview 251, 257 pseudo file systems 417
a option (administration file) 254, 255, pseudo user logins 38
259, 261 pseudo-ttys 38
d option (device name) 259 to 263
s option (spool directory) 261, 262
R
prerequisites for using 253
spool directories and 261, 263 raw disk device interface 313
standalone systems a 259 rdiskette directories 240
standalone systems and 261, 266 /vol/dev/rdsk directory 241, 242
pkgchk command reboot command 125
options 263, 265 reconfiguration boot 355
overview 257, 263 IA example 378
using 263, 265 SPARC example 366
pkginfo command record of
all packages installed 264 dumps 600
overview 253, 257, 263 incremental backup 600
l option (detailed information) 265 regular inodes 513
using 261, 263 release level of PROM 134
pkgparam command 257 remote access
pkgrm command 266
basic procedure 266
660 System Administration Guide, Volume 1 ♦ February 2000
CDs sharing diskettes 214
accessing CDs on other systems 183, Rock Ridge extension (HSFS file system) 416
185 root (/) file system 422
making CDs available to other root group 38
systems 185 rotational delay 544
diskettes run control scripts 115
accessing diskettes on other adding 117
systems 211, 212 disabling 118
making diskettes available to other starting and stopping services 116
systems 212 run level
remote drive (restoring from) 591 0 (power-down state) 110
remote mounting 77, 79 1 (single-user state) 110
remote package server 2 (multiuser state) 110
software installation from 260, 261 3 (multiuser with NFS) 110
software installation to spool booting to 138, 152
directory 262 processes executed at 114
removef command 254 what happens when system is
removing swap file from use 505 brought to 113
repairing the /etc/passwd file 6 (reboot state) 110
IA 158 default run level 109
SPARC 145 defined 109
reset button 160 determining 110
reset command 137 s or S (single-user state) 110
resetting a SPARC based system 137 booting to 139, 153
restore
complete file system 592
S
from remote drive 591
interactively 587 /sbin/rc0 script 119, 125
preparing to 583 /sbin/rc1 script 119, 125
specific files 589 /sbin/rc2 script 120, 125
type of tape drive 584 /sbin/rc3 script 120, 125
restoring bad superblock 522 /sbin/rc5 script 121, 125
restoring file systems /sbin/rc6 script 121, 125
complete 592, 594 /sbin/rcS script 121, 125
root and /usr 595, 597 scheduling backups 560
retensioning magnetic tape cartridge 643 SCSI disk drives 354
retrieving SCSI hot-plugging 279
files created wth bar command 638 SCSI tape drives 641
files from a tape (cpio) 629 secondary disk
files from a tape (tar) 625 connecting to the system
files from diskette (tar) 636 IA 379
files from remote tape (tar and dd) 632 SPARC 366
specific files from tape (cpio) 630 described 327
rewinding magnetic tape cartridge 644 secondary groups 43
rm command 254, 266 security
rmmount.conf file user ID number reuse and 38
playing musical CDs 188 servers
sharing CDs 187
661
description 97 slice (defined) 323
software administration software administration 249
removing packages 266 adding packages 249, 251, 255, 257
sharing software with clients 253 administration files and 254, 255, 259
set command 59 base directory and 254, 255
setenv command 59, 60 bypassing user interaction
shadow file when 254, 255
described 49 guidelines for 253
fields in 52, 53 multiple versions of a package 254,
share command 428 255
making disks available to other systems prerequisites 253
CDs 186, 187 from mounted CD 260
diskettes 213, 214 from remote package server 260, 261
shareall command 428 to a spool directory 261, 263, 265
sharing standalone systems 259, 261
files 428 Sun packages 260 to 263
software by clients and servers 253 tools for 251, 252
user home directories 77, 79 clients 253
sharing CD-ROM drives 185 sharing software with servers 253
SHELL environment variable 62 defined 251
shell variables 60, 62 displaying installed software
shells information 253, 257, 263,
basic features 58, 59 265
environment of 59, 62 naming conventions for packages 253
environment variables and 59, 60, 64 overview 249
local variables 59, 60, 62 package defined 251
user initialization files and 56, 58, 66, 73 removing packages 251, 253, 254, 266
shutdown command administration files and 255
described 124 guidelines for 254
notifying users 125 spool directories 267
shutting down a server 104, 126 standalone systems 266
shutting down tools for 251, 252
a server 126 servers
a standalone system 130 removing packages 266
a system cleanly with shutdown and init sharing software with clients 253
commands 124 Solaris upgrade option and 254
shutting down a system 103 tools for 249, 251, 252
single-user state, see run level s or S Admintool 249
site initialization files 57 commands 251, 257
size verifying installation
checking file system 512 pkgchk command 257, 263, 265
diskette formats 195, 197 pkginfo command 257, 261, 265
DOS diskettes 202 software administration, removing
UFS diskettes 197, 198 packages 249
fragment 543 Software Manager 249, 252
inode 514 software packages
/skel directory 56 software administration 249
skeleton directories 42, 48
662 System Administration Guide, Volume 1 ♦ February 2000
Solaris diskette formats 195, 197 superblock 511, 522, 539
Solaris fdisk partition 376 swap command 503
Solaris upgrade option 254 swap file
Solaris User Registration 89 adding to vfstab 500
sort command 44 creating 503
sorting user accounts 44 displaying 501
space optimization type 544 removing from use 505
spaces (in user login names) 37 swap partition 422, 498
SPARC based systems swapadd command 500
diskette formats 195, 197 SWAPFS file system 419
UFS format 181, 245 swmtool command 249, 252
SPECFS file system 419 symbolic links 513
specifying a disk slice 314, 316 file system access 244
spool directories listing CD directories using 181
installing software packages to 261, 263, listing diskette directories using 207
265 raw device access 244
removing software packages from 267 sync command 147
staff group 43 synchronize the disk using sync
standalone system 98 command 147, 148
standalone systems syntax
adding software packages to 259, 261 fsck command 524, 526
removing software packages from 266 newfs 545
starting sysdef command 285
nfsd daemon 186, 213 system accounts 38
Volume Management 190 system architecture 60
starting and stopping services 116 system disk
state flag connecting
fsck 508 IA 377
UFS file systems 423 SPARC 365
stop command 190 described 327
Stop-A keys 145, 147 installing a boot block on
stopping IA 389
all processes for a file system 457 SPARC 372
ejecting CDs system initialization files 43
using command line 183 system shutdown commands 124
killing processes accessing CDs 182, 183 system types
killing processes accessing diskettes 210 overview 96
Volume Management 190 server 97
storage (virtual memory) 422 standalone system 98
storage block 541
storage capacities (media) 555, 639
T
storage, virtual memory 498
structure of cylinder groups 538 table
stty command 64 default SunOS file system 421
Sun software packages file system administrative commands 419
installing 260 to 263 interactive commands for ufsrestore 611,
SunOS default file system 421 612
SUNW prefix 253
663
media storage capacities 555, 639 turn off power to all devices, how to 132
mount 427 type of file systems 416
options for mkfile 503 type of inodes 512
options for ufsdump command 605, 606 type of tape drive 642
options for ufsrestore command 608 TZ environment variable 62
tape capacity 603
tape 644
U
capacity 603
characteristics 603 UDF file system 410
copying all files in a directory (cpio) 627 UFS CDs
listing files using tar command 624 mixed formats 246
retrieving files from (cpio) 629 SPARC vs. IA formats 181, 245
retrieving files from (tar) 625 UFS diskettes
retrieving specific files from (cpio) 630 adding UFS file system 200, 201
sizes 555, 639 formatting 197, 199
storage capacities 555, 639 canceling 198
tape (magnetic cartridge) complete format 195
retensioning 643 size and density options 195, 197
tape devices (naming) 316 SPARC vs. IA formats 195
tape drive SPARC vs. IA formats 195, 245
default densities 641 UFS file system 416, 423
determining type for restore 584 adding to diskettes 200, 201
finding type 642 extended fundamental types 423
maintaining 644 large file systems 423
maximum SCSI 641 mounting 448
restoring from remote 591 placing on a PCMCIA memory card 222
tar command 623, 626 state flags 423
copying files to a single diskette 634 ufsdump command 573
copying files to remote tape (dd) 631 backing up file systems to tape 574
copying files to tape 623 end-of-media detection 600
listing files on diskette 635 how data is copied with 600
listing files on tape 624 how it works 599
retrieving files from diskette 636 limitations 603
retrieving files from remote tape (dd) 632 options and arguments 604
retrieving files from tape 625 ufsrestore command 583, 597, 607
temporary file system 417, 437 preparing to use 583
TERM environment variable 62 restoring complete file systems from
term shell variable 59, 62 tape 592
terminating all processes 457 UIDs 47
TERMINFO environment variable 62 assigning 38
testing definition 38
verifying 249 large 39
time (optimization type) 544 umask command 65
time zone environment variable 62 umount command 420
/tmp directory 418, 422 umountall command 420
TMPFS file system 417 unallocated directory blocks 515
ttys (pseudo) 38 unallocated inodes 513
ttytype pseudo user logins 38
664 System Administration Guide, Volume 1 ♦ February 2000
underscore (_), in user login names 37 user initialization files
UNIX file system 416 customizing 56, 66
UNIX groups 43 adding customized files 48
unmounting file systems 425, 458, 459 avoiding local system references 58
unsupported devices 283 environment variables 60, 64
upgrade option (Solaris) 254 overview 42, 56, 57
user access 36 procedure for 72
user accounts 36 shell variables 60, 62
adding site initialization files 57
Admintool: Users 76, 77 user mask setting 65
commands 44 default 56
changing described 36, 42, 43, 56
Admintool: Users 47 examples 66
commands 44 shells and 56, 58, 66
commands for 44 user login names
copying changing 47
commands 44 described 36, 37
default setup user logins (pseudo) 38
commands 44 User Manager, AdminSuite 2.3 44
deleting user mask 65
Admintool: Users 48 User Registration
commands 44 described 89
described 36 disabling 91
disabling/locking problems 90
Admintool: Users 48 solregis command 89
commands 44 user shell variable 59
passwords and 48, 53 useradd command 44
finding (commands) 44 userdel command 44
guidelines for 37, 43 usermod command 44
ID numbers 38, 47 /usr file system 422
login names 36, 37, 47 uucp group 38
name services and 37, 44, 49
setting up
V
information sheet 71
sorting (commands) 44 /var directory 422
storage of information for 37, 49 /var/run file system 409
tools for managing 44 /var/sadm/install/admin directory 254
user home directories /var/sadm/patch 275
changing ownership of 47 /var/spool/pkg directory 261 to 263
customized initialization files in 42, 48 variables
deleting 48 environment 59, 64
described 36, 42 shell (local) 59, 62
mounting 79 verifying
automounting 43 CD is in use 182, 183
remote 77, 79 diskette is in use 209
nonlocal reference to ($HOME) 42, 58
sharing 77, 79
user ID numbers 38, 47
665
nfsd daemon is running configuring 190
making CDs available to other diskettes
systems 185, 186 access locations 177, 239, 241, 242
making diskettes available to other directories 240
systems 213, 214 loading 205, 207
software package installation /floppy mount point 242, 243
pkgchk command 257, 263, 265 manual mounting compared to 176
pkginfo command 257, 261, 266 restarting 190
vfstab file 430, 500 stopping 190
adding swap to 500 symbolic links
creating entries in 448 file system access 244
default 427 raw device access 244
entry for temporary file system 439 UFS limitations 245
finding file system names in 572
modifying fsck pass 517
W
mounting all files 449
vipw command 44 when to turn off power to devices 125
virtual file system table 427 who command 110, 126
virtual memory storage 422, 498 world (permissions) 65
/vol/dev directory 239, 240 write permissions
/vol/dev directory described 182
symbolic links write-protection (PCMCIA memory
file system access 244 cards) 220
CD subdirectories 239, 241 to 243
volcopy command 420 Y
volmgt start command 190 yp* commands 44
Volume Management 239, 246
access to removable media 239
benefits 176
CDs
access locations 177, 239, 245
directories 239, 241, 242
/cdrom mount point 242, 243