Manual SA-202-S10 Rev D.1
Manual SA-202-S10 Rev D.1
Manual SA-202-S10 Rev D.1
D61738GC11
Edition 1.1
D65082 and D65083
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009, 2010, Oracle and/or its affiliates. All rights reserved.
Disclaimer
This document contains proprietary information, is provided under a license agreement containing restrictions on use and
disclosure, and is protected by copyright and other intellectual property laws. You may copy and print this document solely for
your own use in an Oracle training course. The document may not be modified or altered in any way. Except as expressly
permitted in your license agreement or allowed by law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express
authorization of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document,
please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This
document is not warranted to be error-free.
This training manual may include references to materials, offerings, or products that were previously offered by Sun
Microsystems, Inc. Certain materials, offerings, services, or products may no longer be offered or provided.Oracle and its
affiliates cannot be held responsible for any such references should they appear in the text provided.
Restricted Rights Notice
If this documentation is delivered to the U.S. Government or anyone using the documentation on behalf of the U.S.
Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these training materials are
restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
Trademark Notice
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.
AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro
Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used
under license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademark
licensed through X/Open Company, Ltd.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Table of Contents
Administration
for the
Solaris 10 Operating
System, Part
THESE2eKIT MATERIALS ARESystem
FOR YOUR
USE IN THIS
CLASSROOM
ONLY. COPYING
eKIT2MATERIALS FROM THIS
Copyright 2009
Sun Microsystems,
Inc. All Rights
Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
PROHIBITED
3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Administration
for the
Solaris 10 Operating
System, Part
THESE4eKIT MATERIALS ARESystem
FOR YOUR
USE IN THIS
CLASSROOM
ONLY. COPYING
eKIT2MATERIALS FROM THIS
Copyright 2009
Sun Microsystems,
Inc. All Rights
Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
PROHIBITED
5
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Administration
for the
Solaris 10 Operating
System, Part
THESE6eKIT MATERIALS ARESystem
FOR YOUR
USE IN THIS
CLASSROOM
ONLY. COPYING
eKIT2MATERIALS FROM THIS
Copyright 2009
Sun Microsystems,
Inc. All Rights
Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
PROHIBITED
Introduction to Zones.....................................................................10-1
Objectives ......................................................................................... 10-1
Introducing Solaris Zones............................................................... 10-2
Server Consolidation Solutions............................................. 10-2
Resource Sharing..................................................................... 10-3
Zone Features .......................................................................... 10-4
Zone Concepts .................................................................................. 10-5
Zone Types............................................................................... 10-5
Zone Daemons......................................................................... 10-8
Zone File Systems .................................................................. 10-9
Zone Networking................................................................. 10-11
Zone States ............................................................................ 10-12
Configuring Zones ......................................................................... 10-14
Identifying Zone Components ............................................ 10-14
Allocating File System Space............................................... 10-14
Using the zonecfg Command ............................................ 10-15
The zonecfg Resources Parameters................................... 10-17
Zone Configuration Walk-Through .................................. 10-19
Viewing the Zone Configuration........................................ 10-21
Using the zoneadm Command ..................................................... 10-24
Verifying a Configured Zone .............................................. 10-24
Installing a Configured Zone .............................................. 10-25
Booting a Zone....................................................................... 10-25
Halting a Zone....................................................................... 10-26
Rebooting a Zone .................................................................. 10-27
Logging Into and Working With the Zone........................ 10-27
Moving a Zone ...................................................................... 10-29
Migrating a Zone............................................................................ 10-30
Pre-Validating Zone Migration.......................................... 10-32
Deleting a Zone .................................................................... 10-33
Installing Packages in Zones ........................................................ 10-34
Packaging for Sparse and Whole Root Zones................... 10-34
Listing Parameters for Packages......................................... 10-35
Package Operations Possible in the Global Zone............. 10-36
Package Operations Possible in a Non-Global Zone ....... 10-37
Using lx Branded Zone ................................................................ 10-39
Planning for lx Branded Zone............................................ 10-39
7
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Administration
for the
Solaris 10 Operating
System, Part
THESE8eKIT MATERIALS ARESystem
FOR YOUR
USE IN THIS
CLASSROOM
ONLY. COPYING
eKIT2MATERIALS FROM THIS
Copyright 2009
Sun Microsystems,
Inc. All Rights
Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
PROHIBITED
9
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Administration
for the
Solaris 10 Operating
System, Part
THESE10
eKIT MATERIALS ARESystem
FOR YOUR
USE IN THIS
CLASSROOM
ONLY. COPYING
eKIT2MATERIALS FROM THIS
Copyright 2009
Sun Microsystems,
Inc. All Rights
Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM 11
THIS
Copyright
2009 Sun Microsystems,
Inc. All PROHIBITED
Rights Reserved. Sun Learning Services, Revision D.1
COMPUTER
IS STRICTLY
Course Goals
Describe RAID
Manage RBAC
Preface
Course Map
Course Map
Configuring NFS
Configuring AutoFS
Describing RAID
Configuring Solaris
Volume Manager
Software
Configuring Role-Based
Access Control (RBAC)
Configuring System
Messaging
Configuring Name
Service Clients
Introduction to Zones
Introduction to LDAP
Configuring JumpStart
Installation Using the
Solaris 10 OS
THESEPreface-ii
eKIT MATERIALS ARE
FOR
YOUR USE IN
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
forTHIS
the Solaris
10 Operating
ParteKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The course map enables you to see what you have accomplished and
where you are going in reference to the course goals.
This course does not cover the following topics. Many of these topics are
covered in other courses offered by Sun Educational Services:
Can you add users to the system using the Solaris Management
Console software?
THESEPreface-iv
eKIT MATERIALS ARE
FOR
YOUR USE IN
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
forTHIS
the Solaris
10 Operating
ParteKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
To be sure you are prepared to take this course, can you answer yes to the
following questions?
Introductions
Introductions
Name
Company affiliation
Now that you have been introduced to the course, introduce yourself to
the other students and the instructor, addressing the following items:
Visual aids The instructor might use several visual aids to convey a
concept, such as a process, in a visual form. Visual aids commonly
contain graphics, animation, and video.
THESEPreface-vi
eKIT MATERIALS ARE
FOR
YOUR USE IN
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
forTHIS
the Solaris
10 Operating
ParteKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Conventions
Conventions
The following conventions are used in this course to represent various
training elements and alternative learning resources.
Note Indicates additional information that can help students but is not
crucial to their understanding of the concept being described. Students
should be able to understand the concept or complete the task without
this information. Examples of notational information include keyword
shortcuts and minor system adjustments.
Caution Indicates that there is a risk of personal injury from a
nonelectrical hazard, or risk of irreversible damage to data, software, or
the operating system. A caution indicates that the possibility of a hazard
(as opposed to certainty) might happen, depending on the action of the
user.
Power user Indicates additional supportive topics, ideas, or other
optional information.
Icons
Conventions
Typographical Conventions
Courier is used for the names of commands, files, directories, user
names, host names, programming code, and on-screen computer output;
for example:
Courier bold is used for characters and numbers that you type; for
example:
To list the files in this directory, type the following:
# ls
Courier italics is used for variables and command-line placeholders
that are replaced with a real name or value; for example:
To delete a file, use the rm filename command.
Courier italic bold is used to represent variables whose values are to
be entered by the student as part of an activity; for example:
Type chmod a+rwx filename to grant read, write, and execute
rights for filename.
Palatino italics is used for book titles, new words or terms, or words that
you want to emphasize; for example:
Read Chapter 6 in the Users Guide.
These are called class options.
THESEPreface-viii
eKIT MATERIALS ARE
FOR
YOUR USE IN
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
forTHIS
the Solaris
10 Operating
ParteKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Module 1
Virtual memory combines RAM and dedicated disk storage areas known
as swap space. Virtual memory management software maps copies of files
on disk to virtual addresses. Programs use these virtual addresses rather
than real addresses to store instructions and data. Virtual memory makes
it possible for the operating system (OS) to use a large range of memory.
However, the kernel must translate the virtual memory addresses into
real address in RAM before the actual program instruction is performed
on a central processing unit (CPU).
Physical RAM
Physical memory refers to the actual RAM installed on a computer. When
working with swap space, RAM is the most critical resource in your
system. The amount of physical memory varies depending on the system
that runs the Solaris 10 OS. The code for each active process and any data
required by each process must be mapped into physical memory before
execution can take place.
THESE1-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Swap Space
Swap Slices
The primary swap space on the system is a disk slice. In the Solaris 10 OS,
the default location for the primary swap space is slice 1 of the boot disk,
which by default, starts at cylinder 0. You can change the default location
during a custom installation. Each time you reboot the system, an entry in
the /etc/vfstab file determines the configuration of the swap partition.
As additional swap space becomes necessary, you can configure
additional swap slices. Plan your swap slice location carefully. If you have
additional storage space outside of the system disk, place the swap slice
on an additional drive to reduce the load on the system disk drive.
Swap Files
It is also possible to provide additional swap space on a system by using
swap files. Swap files are files that reside on a file system, and that have
been created using the mkfile command. These files might be useful in
some cases. For example, swap files are useful when additional swap
space is required, but there are no free disk slices and reslicing a disk to
add more swap is not a practical solution. Swap files can be permanently
included in the swap configuration by creating an entry for the swap file
in the /etc/vfstab file.
Because of the virtual swap space provided by the swapfs file system in
the Solaris 10 OS, there is less need for physical swap space on systems
with a large available memory. The decreased need for physical swap
space occurs because the swapfs file system provides virtual swap space
addresses rather than real physical swap space addresses in response to
swap space allocation requests. Therefore, you need physical swap space
on disk, only in the event that the physical RAM pages containing private
data need to be paged out.
Figure 1-1 shows that the swap space resides outside the physical RAM as
a swap partition or as a swap file.
Swap Slice
Swap Space
Swap File
RAM
Figure 1-1
Swap Space
THESE1-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When the kernel runs a process, swap space for any private data or stack
space for the process must be allocated. The allocation occurs in case the
stack information or private data might need to be paged out of physical
memory, for example, if there are multiple processes contending for
limited memory space.
Paging is the transfer of selected memory pages between RAM and the
swap areas. When you page private data to swap spaces, physical RAM is
made available for other processes to use. If you need the pages that were
paged out, you can retrieve them (page them in) from swap and map
them back into physical memory. Moving these pages back into RAM
might require more paging (page outs) of other processs pages to make
room. Swapping is the movement of all modified data memory pages
associated with a process, between RAM and a disk.
Use the pagesize command to display the size of a memory page in
bytes. The default page size for SPARC-based systems running the
Solaris 10 OS is 8192 bytes.
# pagesize
8192
The default page size for Suns x86-systems is 4096 bytes.
# pagesize
4096
You can use the Multiple Page Size Support (MPSS) service to run legacy
applications with larger memory page sizes. Using larger page sizes can
significantly improve the performance of programs using large amounts
of memory. Large pages must be mapped to addresses that are multiples
of the page size. Use the pagesize command to display all supported
page sizes.
For example, on SPARC-based systems:
# pagesize -a
8192
65536
524288
4194304
On x86-based systems:
# pagesize -a
4096
2097152
Paging
THESE1-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Allocated
swap -s
Total Swap Allocation
Reserved
Available
Arrow up: swap -d subtracts the
amount of available swap space
Arrow down: swap -a adds the
amount of available swap space
Figure 1-2
# swap -s
total: 41776k bytes allocated + 5312k reserved = 47088k used, 881536k
available
# swap -l
swapfile
/dev/dsk/c0t0d0s1
Note There can be a discrepancy in available and free swap space size
between the swap -s and swap -l outputs. The swap -s output does
not take into account pre-allocated swap space that has not yet been used
by a process.
The swap -l command reports values expressed in 512-byte blocks. The
swap -s command reports values expressed in Kbytes.
The swaplo value reported by swap -l reflects the number of 512-byte
blocks that match the system page size. The swaplo value prevents
paging or swap operations in the disk blocks that might contain the disk
VTOC and boot block.
THESE1-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
# vi /etc/vfstab
#device
device
#to mount
to fsck
...
2.
/dev/dsk/c1t3d0s1
3.
mount
point
FS
type
fsck
pass
mount
at boot
mount
options
swap
no
# swap -a /dev/dsk/c1t3d0s1
Note When the system is subsequently rebooted, the new swap slice
/dev/dsk/c1t3d0s1, is automatically included as part of the swap space
as a result of adding the entry to the /etc/vfstab file.
2.
# mkdir -p /usr/local/swap
3.
# swap -a /usr/local/swap/swapfile
5.
6.
# swap -s
total: 41672k bytes allocated + 5416k reserved = 47088k used, 901200k
available
7.
# vi /etc/vfstab
#device
device
#to mount
to fsck
...
/usr/local/swap/swapfile
mount
point
-
FS
type
-
swap
fsck
pass
-
mount
at boot
no
mount
options
-
# swap -d /dev/dsk/c1t3d0s1
2.
To prevent the swap slice from being configured as part of the swap
configuration during a reboot or change of run level, edit the
/etc/vfstab file, and remove the swap slice entry from the file.
THESE1-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# swap -l
swapfile
dev swaplo blocks
free
/dev/dsk/c0t0d0s1
136,9
16 1048304 1048304
/usr/local/swap/swapfile 16 40944 40944
# swap -d /usr/local/swap/swapfile
2.
3.
To prevent the swap file from being configured as part of the swap
configuration during a reboot or change of run level, edit the
/etc/vfstab file, and remove the swap file entry.
Note The output of the df -h command shows the space used by the
swap file until it is removed.
# rm /usr/local/swap/swapfile
For user processes, the address space of the process contains various
segments that include the text, data and stack of the process. The core file
generated when the process encounters a fatal error is a snapshot of what
the memory space of the process looked like when the error occurred.
The same is true for the kernel. A fatal error in the kernel software will
result in a system crash, (typically a "panic"). The kernel core image is a
snapshot of the kernels memory space when the error occurred.
In both cases, a debugger must be used to examine the core file. For user
processes, dbx(1) or mdb(1) can be used. For the kernel, mdb(1) is
used to analyze the core file.
THESE1-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The core file is an on-disk file that represents the memory image of the
software that encountered the fatal error.
Note Within the crash dump directory, a file named bounds is created.
The bounds file holds a number that is used as a suffix for the next dump
to be saved.
kernel pages
/dev/dsk/c0t0d0s1 (swap)
/var/crash/sys-02
yes
THESE1-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
A dump device is usually disk space that is reserved to store system crash
dump information. By default, a systems dump device is configured to be
a swap slice. If possible, you should configure an alternate disk partition
as a dedicated dump device to provide increased reliability for crash
dumps and faster reboot time after a system failure.
-u
-y
-c content-type
-d dump-device
-m mink
-m minm
-m min%
-s savecore-dir
THESE1-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Core Files
# coreadm
1
global core file pattern:
2
global core file content:
3
init core file pattern:
4
init core file content:
5
global core dumps:
6
per-process core dumps:
7
global setid core dumps:
8 per-process setid core dumps:
9
global core dump logging:
default
core
default
disabled
enabled
disabled
disabled
disabled
Note The line numbers in the example are not part of the configuration.
They are part of the example only to assist with the following description
of the file.
Line 1 of the output identifies the name to use for core files placed in a
global directory.
Line 2 of the output identifies that the content of core files is the default
setting. The resultant core file contains all the process information
pertinent to debugging.
Line 3 of the output identifies the default name that per-process core files
must use. This name is set for the init process, meaning it is inherited by
all other processes on the system.
Line 4 of the output indicates that the init core file content is the default
content structure.
Line 5 indicates that global core files are disabled.
Line 6 indicates that core file generation in the current working directory
of a process is enabled.
Line 7 indicates that generation of global core files with setuid or setgid
permissions are disabled.
THESE1-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You use the coreadm command without arguments to display the current
configuration.
Caution A process that has a setuid mode presents security issues with
respect to dumping core files. The files might contain sensitive
information in its address space to which the current non-privileged
owner of the process should not have access. Therefore, by default,
setuid core files are not generated because of this security issue.
By viewing the /etc/coreadm.conf file, you can verify the same
configuration parameters that were displayed with the coreadm
command.
# cat /etc/coreadm.conf
#
# coreadm.conf
#
# Parameters for system core file configuration.
# Do NOT edit this file by hand -- use coreadm(1) instead.
#
COREADM_GLOB_PATTERN=
COREADM_GLOB_CONTENT=default
COREADM_INIT_PATTERN=core
COREADM_INIT_CONTENT=default
COREADM_GLOB_ENABLED=no
COREADM_PROC_ENABLED=yes
COREADM_GLOB_SETID_ENABLED=no
COREADM_PROC_SETID_ENABLED=no
COREADM_GLOB_LOG_ENABLED=no
THESE1-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
-i pattern
-e option
-d option
-u
-g pattern
Note A regular user can only use the -p option, the superuser can use
all options.
A core file named pattern is a file system path name with embedded
variables. The embedded variables are specified with a leading percent (%)
character. The operating system expands these variables from values in
effect when the operating system generates a core file. The possible
variables are listed in Table 1-1.
Table 1-1 Pattern Options for the coreadm Command
Option
Meaning
%p
PID
%u
%g
%f
%n
%m
%t
%d
%z
Zonename
%%
Literal%
THESE1-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
-p pattern
Option
Meaning
anon
ctf
data
dism
DISM mappings
heap
Process heap
ism
ISM mappings
rodata
shanon
shfile
shm
stack
Process stack
symtab
text
Table 1-2 Pattern Options for the Global Core File Content
Note The $$ variable is the PID of the currently running shell. The
per-process core file name pattern is inherited by all child processes.
Example 2 Dumping a Users Core Files Into a Subdirectory
The following command places all of the users core files into the
corefiles subdirectory of the users home directory, differentiated by
the system node name. This example is useful for users who use many
different systems, but share a single home directory across multiple
systems.
$ coreadm -p $HOME/corefiles/%n.%f.%p $$
Example 3 Enabling and Setting the Core File Global Name Pattern
The following is an example of setting system-wide parameters that add
the executable file name and PID to the name of any core file that is
created:
# coreadm -g /var/core/core.%f.%p -e global
For example, the core file name pattern /var/core/core.%f.%p causes
the xyz program with PID 1234 to generate the core file
/var/core/core.xyz.1234.
THESE1-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
coreadm -p core.%f.%p $$
# coreadm
global
global
init
init
/var/core/core.%f.%p
default
core
default
enabled
enabled
disabled
disabled
disabled
default
Only the owner of a process or the superuser can query a process by using
the coreadm command with a list of PIDs.
Example 5 Setting up the System to Produce Core Files in the Global
Repository Only if the Executables Were Run From /usr/bin or
/usr/sbin
# mkdir -p /var/core/usr/bin
# mkdir -p /var/core/usr/sbin
# coreadm -G all -g /var/core/%d/%f%p%n
When using the all option in the previous command, examples of the
core file content include:
anon = anonymous private maps
data = writable private file mapping
stack = process stack
symtab = symbol table sections for loaded object files
To verify that this parameter is now part of the core file configuration, run
the coreadm command again:
Figure 1-3
The left panel contains tools that allow you to access your lab systems.
The Gnome tool opens a remote desktop on the lab system The Terminal
tool opens a terminal window on the lab system. The Console tool opens a
remote console on the lab system. The Administration Console is for
shadowing your lab partner.
THESE1-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
All students use disk slice 1 of the spare disk on their systems for
this exercise.
This exercise assumes students know how to use the format utility
to create Solaris fdisk partitions, and disk slices.
Size
Use
2048 Mbytes
Swap /dump
2048 Mbytes
Swap /dump
16 Mbytes
Unassigned
16 Mbytes
Unassigned
10240 Mbytes
(or remainder
of disk)
File system
0 Mbytes
Unassigned
0 Mbytes
Unassigned
Tasks
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
____________________________________________________________
b.
____________________________________________________________
c.
____________________________________________________________
d.
____________________________________________________________
3.
____________________________________________________________
b.
____________________________________________________________
4.
5.
6.
Use the swap -l command to verify that the new swap space is
available.
7.
Use the swap -s command to verify that the new swap space is
available.
How does the output differ between the swap -l command and the
swap -s command?
THESE1-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
9.
Use the swap utility to verify that the swap space is no longer
available.
11. Verify that the new swap space has been added.
12. Add the new swap partition to the /etc/vfstab file to make the
partition permanent.
To verify this change, you must reboot the system.
13. After the reboot, verify that the additional swap space exists by
using the swap utility.
Is the newly listed swap partition the same as the one you added to
the /etc/vfstab file?
____________________________________________________________
14. Verify the additional swap space exists using the df -h command.
Why is the newly created swap space listed in the /etc/vfstab file
not listed in the output of the df -h command?
____________________________________________________________
____________________________________________________________
15. Remove the additional swap space using the swap -d command to
return the system to its initial swap configuration.
16. Remove the additional swap space entry from the /etc/vfstab file
so that the system maintains its initial swap configuration after
rebooting.
17. Verify that the additional swap space was unconfigured using the
swap -l command.
10. Add partition 1 of your second disk to your existing swap space and
use the correct device name for your system.
This exercise requires specific disk partitions on the spare disk. The
required partitions may already exist as a result of previously-run
exercises.
This exercise assumes students know how to use the format utility
to create Solaris fdisk partitions, and disk slices, if required.
On x86/x64 systems, verify that the spare disk contains one Solaris
fdisk partition that uses the entire disk. If not, use the fdisk menu
in the format utility to create one Solaris fdisk partition that uses
the entire spare disk. Be certain that the Solaris fdisk partition you
create on the spare disk is not marked as the active partition.
Verify that the spare disk has the partitions defined in Table 1-4. If it does
not, partition the spare disk, or the Solaris fdisk partition on the spare
disk, using the information in Table 1-4.
Table 1-4 Partition Information
Slice
Size
Use
2048 Mbytes
Swap /dump
2048 Mbytes
Swap /dump
16 Mbytes
Unassigned
16 Mbytes
Unassigned
10240 Mbytes
(or remainder
of disk)
File system
0 Mbytes
Unassigned
0 Mbytes
Unassigned
THESE1-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
1.
2.
3.
Use the dumpadm command to change the dump device to the second
disk drive slice 5.
4.
5.
Force the kernel to save a live snapshot of the running system and
write out a new set of crash dump files by using the savecore -L
command.
6.
Make sure the crash dump succeeded by using the file command
to identify the files in the savecore directory.
7.
Use the dumpadm command to set the dump device to its original
value.
2.
Create a directory to hold core files, and enable a global core file path
that uses the directory you created.
3.
4.
5.
6.
7.
Run the ps command to display the PID of the shell associated with
the new terminal window, and send a SIGFPE signal (Signal 8) to the
shell by using the kill command. (SIGFPE causes a core file to be
created.)
Note The kill -8 command terminates the shell and the terminal
window in which it is executed.
8.
9.
10. Observe the messages generated in the console window and the
/var/adm/messages file due to coreadm logging being enabled.
THESE1-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
!
?
Figure 1-4
The left panel contains tools that allow you to access your lab systems.
The Gnome tool opens a remote desktop on the lab system The Terminal
tool opens a terminal window on the lab system. The Console tool opens a
remote console on the lab system. The Administration Console is for
shadowing your lab partner.
THESE1-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
All students use disk slice 1 of the spare disk on their systems for
this exercise.
This exercise assumes students know how to use the format utility
to create Solaris fdisk partitions, and disk slices.
Size
Use
2048 Mbytes
Swap /dump
2048 Mbytes
Swap /dump
16 Mbytes
Unassigned
16 Mbytes
Unassigned
10240 Mbytes
(or remainder
of disk)
File system
0 Mbytes
Unassigned
0 Mbytes
Unassigned
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
# swap -s
total: 49024k bytes allocated + 4704k reserved = 53728k used, 875280k
available
a.
THESE1-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
This section describes the steps you must perform, and lists the solutions
to these steps. Complete the following steps:
5.
Use the swap -l command to verify that the new swap space is
available.
# swap -l
swapfile
dev swaplo blocks
free
/dev/dsk/c0t0d0s1
136,1
16 1049312 1049312
/usr/local/swap/swapfile 16 40944 40944
7.
Use the swap -s command to verify that the new swap space is
available.
# swap -s
total: 49104k bytes allocated + 4624k reserved = 53728k used, 895040k
available
How does the output differ between the swap -l command and the
swap -s command?
The swap -l command output is a listing of each space, whereas the
swap -s command output only produces a cumulative report.
8.
# swap -d /usr/local/swap/swapfile
# rm /usr/local/swap/swapfile
9.
Use the swap utility to verify that the swap space is no longer
available.
# swap -l
swapfile
dev swaplo blocks
free
/dev/dsk/c0t0d0s1
136,1
16 1049312 1049312
# swap -s
total: 49088k bytes allocated + 4640k reserved = 53728k used, 874568k
available
# mkdir -p /usr/local/swap
14. Verify the additional swap space exists using the df -h command.
Why is the newly created swap space listed in the /etc/vfstab file
not listed in the output of the df -h command?
# df -h
Filesystem
/dev/dsk/c0t0d0s0
/devices
ctfs
proc
mnttab
swap
objfs
/dev/dsk/c0t0d0s6
size
470M
0K
0K
0K
0K
1.3G
0K
4.8G
used
194M
0K
0K
0K
0K
968K
0K
2.9G
avail capacity
229M
46%
0K
0%
0K
0%
0K
0%
0K
0%
1.3G
1%
0K
0%
1.9G
61%
Mounted on
/
/devices
/system/contract
/proc
/etc/mnttab
/etc/svc/volatile
/system/object
/usr
THESE1-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
11. Verify that the new swap space has been added.
0K
479M
1.3G
1.3G
2.1G
0K
57M
0K
40K
2.1M
0K
375M
1.3G
1.3G
2.0G
0%
14%
0%
1%
1%
/dev/fd
/var
/tmp
/var/run
/export
15. Remove the additional swap space using the swap -d command to
return the system to its initial swap configuration.
# swap -d /dev/dsk/c0t1d0s1
16. Remove the additional swap space entry from the /etc/vfstab file
so that the system maintains its initial swap configuration after
rebooting.
# vi /etc/vfstab
17. Verify that the additional swap space was unconfigured using the
swap -l command.
# swap -l
swapfile
dev
swaplo blocks
/dev/dsk/c0t0d0s1
136,1
free
16 1049312 1049312
The df -h output does not produce an entry for the additional swap
devices. However, the added swap space is reflected in the total swap space.
This exercise requires specific disk partitions on the spare disk. The
required partitions may already exist as a result of previously-run
exercises.
This exercise assumes students know how to use the format utility
to create Solaris fdisk partitions, and disk slices, if required.
On x86/x64 systems, verify that the spare disk contains one Solaris
fdisk partition that uses the entire disk. If not, use the fdisk menu
in the format utility to create one Solaris fdisk partition that uses
the entire spare disk. Be certain that the Solaris fdisk partition you
create on the spare disk is not marked as the active partition.
Verify that the spare disk has the partitions defined in Table 1-5. If it does
not, partition the spare disk, or the Solaris fdisk partition on the spare
disk, using the information in Table 1-6.
Table 1-6 Partition Information
Slice
Size
Use
2048 Mbytes
Swap /dump
2048 Mbytes
Swap /dump
16 Mbytes
Unassigned
16 Mbytes
Unassigned
10240 Mbytes
(or remainder
of disk)
File system
0 Mbytes
Unassigned
0 Mbytes
Unassigned
THESE1-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
# dumpadm
Dump content:
Dump device:
Savecore directory:
Savecore enabled:
#
2.
kernel pages
/dev/dsk/c1d0s1 (swap)
/var/crash/sys01
yes
3.
Use the dumpadm command to change the dump device to the second
disk drive slice 5.
# dumpadm -d /dev/dsk/c2d0s5
Dump content: kernel pages
Dump device: /dev/dsk/c2d0s5 (dedicated)
Savecore directory: /var/crash/sys01
Savecore enabled: yes
#
4.
# sync
1.
# savecore -L
dumping to /dev/dsk/c2d0s5, offset 65536, content: kernel
100% done: 63380 pages dumped, compression ratio 4.28, dump succeeded
System dump time: Fri Apr 20 13:40:20 2007
Constructing namelist /var/crash/sys01/unix.0
Constructing corefile /var/crash/sys01/vmcore.0
100% done: 63380 of 63380 pages saved
#
6.
Make sure the crash dump succeeded by using the file command
to identify the files in the savecore directory.
The output shown should be similar to the following if you are using a
x86/x64-based system:
# cd /var/crash/sys01
# ls
bounds
unix.0
vmcore.0
# file vmcore.0
vmcore.0:
SunOS 5.10 Generic_118855-33 64-bit Intel crash dump from
''
#
The output shown should be similar to the following if you are using a
SPARC-based system:
vmcore.0:SunOS 5.10 Generic_137138-09 64-bit SPARC crash dump from
7.
Use the dumpadm command to set the dump device to its original
value.
# dumpadm -d /dev/dsk/c1d0s1
Dump content: kernel pages
Dump device: /dev/dsk/c1d0s1 (swap)
Savecore directory: /var/crash/sys01
Savecore enabled: yes
#
THESE1-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
5.
# coreadm
global
global
init
init
default
core
default
disabled
enabled
disabled
disabled
disabled
Create a directory to hold core files, and enable a global core file path
that uses the directory you created.
# mkdir /var/core
# coreadm -e global -g /var/core/core.%f.%p
3.
# coreadm -e log
4.
# coreadm
global
global
init
init
/var/core/core.%f.%p
default
core
default
enabled
enabled
disabled
disabled
enabled
1.
# mkdir /var/tmp/dir
# cd /var/tmp/dir
6.
7.
Run the ps command to display the PID of the shell associated with
the new terminal window, and send a SIGFPE signal (Signal 8) to the
shell by using the kill command. (SIGFPE causes a core file to be
created.)
# ps
PID TTY
1204 pts/2
1208 pts/2
# kill -8 1204
TIME CMD
0:00 ksh
0:00 ps
Note The kill -8 command terminates the shell and the terminal
window in which it is executed.
8.
# cd /var/tmp/dir
# ls
core
# file core
core:
ELF 32-bit LSB core file 80386 Version 1, from 'ksh'
A SPARC system displays a result similar to the following:
core:
# ls /var/core
core.sh.1204
10. Observe the messages generated in the console window and the
/var/adm/messages file due to coreadm logging being enabled.
# tail /var/adm/messages
...
Apr 20 13:58:46 sys01 genunix: [ID 603404 kern.notice] NOTICE: core_log:
sh[1204] core dumped: /var/core/core.sh.1204
THESE1-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# pwd
/var/tmp/dir
Objectives
Configuring NFS
Objectives
The Network File System (NFS) is a client-server service that lets users
view, store, and update files on a remote computer as though they were
on the their own local computer.
Upon completion of this module, you should be able to:
Module 2
Allows multiple computers to use the same files, because all users on
the network can access the same data
Provides data consistency and reliability, because all users can read
the same set of files
THESE2-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The NFS service lets you share a whole or partial directory tree or a file
hierarchy. Instead of placing copies of commonly used files on every
system, the NFS service enables you to place one copy of the files on one
computers hard disk. All other systems can then access the files across
the network. When using the NFS service, remote file systems are almost
indistinguishable from local file systems.
NFS server
NFS client
THESE2-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
NFS Server
/
NFS server
shares disk
storage with
NFS client.
export
opt
rdbms
rdbms
Shared
Directories and
Disk Storage
bin
lib
share
Figure 2-1
The NFS server contains file resources shared with other systems on the
network. A computer acts as a server when it makes files and directories
on its hard disk available to the other computers on the network.
NFS Client
The NFS client system mounts file resources shared over the network and
presents the file resources to users as if they were local files.
THESE2-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
/
NFS server
shares disk
storage with
NFS client.
export
opt
rdbms
rdbms
Shared
Directories and
Disk Storage
bin
lib
share
Figure 2-2
NFS Client Configuration shows how an NFS client uses the files and
directories shared by an NFS server. The /export/rdbms directory, shared
by the NFS server, is mounted on the NFS client on the /opt/rdbms
mount point. The resource mount point exists on the NFS client, and the
NFS server shares the file resources with other computers on the network,
as shown in Figure 2-2.
You need several files to support NFS server activities on any computer.
Table 2-1 lists these files and their functions.
Table 2-1 NFS Server Files
File
Description
/etc/dfs/dfstab
/etc/dfs/sharetab
/etc/dfs/fstypes
/etc/rmtab
/etc/nfs/nfslog.conf
/etc/default/nfslogd
/etc/default/nfs
THESE2-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# cat /etc/dfs/dfstab
#
Place share(1M) commands here for automatic execution
#
on entering init state 3.
#
#
Issue the command svcadm enable network/nfs/server to
#
run the NFS daemon processes and the share commands, after adding
#
the very first entry to this file.
#
#
share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
#
.e.g,
#
share -F nfs -o rw=engineering -d "home dirs" /export/home2
share -F nfs -o ro
share -F nfs -o rw,root=sys-01
/usr/local/data
/rdbms_files
ro
Shared data files
ro,root=sys01
Database files
# cat /etc/dfs/fstypes
nfs NFS Utilities
autofs AUTOFS Utilities
cachefs CACHEFS Utilities
THESE2-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Description
NFSv4
mountd
No
nfsd
Yes
statd
No
lockd
No
nfslogd
No
nfsmapid
Yes
In NFSv4, the features provided by the mountd and lockd daemons are
integrated into the NFSv4 protocol. This reduces the number of daemons
required on the server and makes the NFS server implementation and
management easier.
In NFSv2 and NFSv3, the mount protocol is implemented by the separate
mountd daemon which did not use an assigned, well-known port
number. This made it very hard to use NFS through a firewall. INFSv4
includes the mount protocol and uses the well-known port number 2049
which improves support for NFS use through a firewall.
You need several daemons to support NFS activities. These daemons can
support both NFS client and NFS server activity, NFS server activity
alone, or logging of the NFS server activity.
When an NFS client issues an NFS mount request, the mount command on
the client contacts the mountd daemon on the server. The mountd daemon
provides a file handle to the client. File handles are client references that
uniquely identify a file or directory on the server. File handles encode a
files inode number, inode generation number, and disk device number.
In NFSv4 file handle and path name mapping is implemented into the
NFSv4 protocol, removing the need for a separate mountd daemon. The
mountd daemon is only required for NFSv3 and NFSv2.
The NFS client mount process writes the file handle, along with other
information about the mounted resource, to the local /etc/mnttab file.
The mountd daemon is started by the svc:/network/nfs/server
service.
THESE2-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The mountd daemon handles NFS file system mount requests from remote
systems and provides access control. The mountd daemon checks the
/etc/dfs/sharetab file to determine whether a particular file or
directory is being shared and whether the requesting client has
permission to access the shared resource.
The statd daemon works with the lock manager lockd daemon to
provide crash recovery functions for the lock manager. The servers statd
daemon tracks the clients that are holding locks on an NFS server. When
the NFS server reboots after a crash, the statd daemon on the server
contacts the statd daemon on the client, which informs the lockd
daemon to reclaim any locks on the server. When an NFS client reboots
after a crash, the statd daemon on the client system contacts the statd
daemon on the server, which invokes the lockd daemon to clear any
previous client process locks on the server.
The statd daemon is started by the svc:/network/nfs/status
service. The statd daemon is not used by NFSv4.
THESE2-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# svcs -l nfs/server
fmri
svc:/network/nfs/server:default
name
NFS server
enabled
true
state
online
next_state
none
state_time
Mon Feb 28 15:35:30 2005
logfile
/var/svc/log/network-nfs-server:default.log
restarter
svc:/system/svc/restarter:default
contract_id 44
dependency
require_any/error svc:/milestone/network (online)
dependency
require_all/error svc:/network/nfs/nlockmgr (online)
dependency
optional_all/error svc:/network/nfs/mapid (online)
dependency
require_all/restart svc:/network/rpc/bind (online)
dependency
optional_all/none svc:/network/rpc/keyserv (disabled)
dependency
optional_all/none svc:/network/rpc/gss (online)
dependency
require_all/error svc:/system/filesystem/local (online)
Commands
Description
share
unshare
shareall
unshareall
dfshares
dfmounts
THESE2-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When the mountd and nfsd daemons are running, you can use the share
command to make file resources available:
share [ -F nfs ] [ -o options ] [ -d description ] [ pathname ]
where:
-F nfs
-o options
-d description
pathname
Note Unless you specify an option to the share command, for example,
-F nfs, the system uses the file system type from the first line of the
/etc/dfs/fstypes file.
To share a file resource from the command line, you can use the share
command. For example, to share the /usr/local/data directory as a
read-only shared resource, perform the command:
# share -o ro /usr/local/data
By default, NFS-mounted resources are available with read and write
privileges based on standard Solaris OS file permissions. Access decisions
are based on a comparison of the user ID (UID) of the client and the
owner.
Options
Definitions
ro
rw
Allows the server to accept read and write requests from the
client
root=access-list
Informs clients that the root user on the specified client system or
systems can perform superuser-privileged requests on the shared
resource
ro=access-list
rw=access-list
Allows read and write requests from the specified access list, as
shown in Table 2-5
anon=n
Description
access-list=client:client
access-list=@network
access-list=.domain
access-list=netgroup_name
THESE2-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# share
-
/usr/local/data
ro
"Shared data files"
/rdbms_files
rw,root=sys01
"Database files"
pathname
THESE2-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
unshareall [ -F nfs ]
SERVER ACCESS
sys-02 -
TRANSPORT
-
SERVER ACCESS
sys-01 -
TRANSPORT
-
SERVER PATHNAME
sys-02 /usr/local/data
CLIENTS
sys-03
Note Since the dfmounts command uses the mountd daemon to display
currently shared NFS resources, it will not display NFSv4 shares.
THESE2-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You need several files to support NFS client activities on any computer.
Table 2-6 lists the files that support NFS client activities.
Table 2-6 NFS Client Files
File
Description
/etc/vfstab
/etc/mnttab
/etc/dfs/fstypes
/etc/default/nfs
mount
point
/usr/remote_data
FS
fsck
type pass
nfs
mount
mount
at boot options
yes
soft,bg
Description
statd
lockd
nfs4cbd
THESE2-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# svcs -D milestone/network
STATE
STIME
FMRI
disabled
15:34:35 svc:/network/dns/client:default
disabled
15:34:37 svc:/network/nfs/cbd:default
disabled
15:34:38 svc:/network/rpc/bootparams:default
disabled
15:34:39 svc:/network/rarp:default
disabled
15:34:51 svc:/network/dns/server:default
disabled
15:34:52 svc:/network/slp:default
disabled
15:35:20 svc:/network/shell:kshell
online
15:35:03 svc:/milestone/single-user:default
online
15:35:04 svc:/network/initial:default
online
15:35:13 svc:/network/inetd:default
online
15:35:24 svc:/network/nfs/client:default
online
15:35:26 svc:/network/shell:default
online
15:35:30 svc:/network/nfs/server:default
online
15:35:31 svc:/network/nfs/mapid:default
online
16:31:18 svc:/network/nfs/nlockmgr:default
online
16:33:12 svc:/network/nfs/status:default
Both the statd and lockd daemons provide crash recovery and locking
services for NFS version 2 and 3. If a server crashes, clients can quickly reestablish connections with files they were using. Therefore, the server has
a record of the clients that were using its NFS resources. It contacts each
client for information about which files were in use, which helps to
provide continuous operation. You can start both of these daemons using
the svcadm command.
The lockd daemon is started by the SMF service nfs/nlockmgr.
# svcadm -v enable nfs/nlockmgr
svc:/network/nfs/nlockmgr:default enabled.
The statd daemon is started by the SMF service nfs/status.
# svcadm -v enable nfs/status
svc:/network/nfs/status:default enabled.
Neither daemon requires administrative intervention.
Two NFS daemons, the statd daemon and the lockd daemon, run on
NFS servers and the NFS clients. These daemons start automatically when
a system enters the network milestone. This can be seen by examining
the dependencies for the network milestone.
Description
dfshares
mount
umount
mountall
umountall
THESE2-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# dfshares sys-02
RESOURCE
sys-02:/usr/local/data
sys-02:/rdbms_files
SERVER ACCESS
sys-02 sys-02 -
TRANSPORT
-
-o options
server:pathname
mount_point
Use the mount command to access a remote file resource. For example:
# mount sys-02:/rdbms_files /rdbms_files
You can use the dfshares command to list resources made available by
an NFS server. To verify the resources that an NFS server is currently
making available, run the dfshares command with the server name as an
argument.
umount /rdbms_files
THESE2-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Note Use the -F FSType with the mountall and umountall commands
to specify FSType as the file system type. You do not have to specify the
-F nfs option, because NFS is listed as the default remote file system
type.
mount
point
/usr/remote_data
FS
fsck
type pass
nfs
mount
mount
at boot options
yes
soft,bg
The name of the server and the path name of the remote
file resource. The server host name and share name are
separated by a (:).
device to
fsck
mount
point
FS type
fsck pass
umountall -r [ -F nfs ]
# umountall -r
mount at
boot
mount
options
Note If the /etc/vfstab file contains the file resource, the superuser
can specify either server:pathname or mount_point on the command
line, because the mount command checks the /etc/vfstab file for more
information.
Table 2-9 The mount Command Options
Option
Description
rw|ro
bg|fg
soft|hard
THESE2-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Option
Description
intr|nointr
suid|nosuid
timeo=n
retry=n
retrans=n
Converts the raw data from the logging operation into ASCII
records, and stores the raw data in ASCII log files.
Maps the file handles to path names, and records the mappings in a
file-handle-to-path mapping table. Each tag in the
/etc/nfs/nfslog.conf file corresponds to one mapping table.
Note If the nfslogd daemon is not running, changes are not tracked to
the mappings in the file-handle-to-path table.
THESE2-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
To configure NFS server logging, identify or create the tag entries for each
of the servers shared resources. The global tag defines the default
values.
The following is an example an nfslog.conf file:
# cat /etc/nfs/nfslog.conf
#ident "@(#)nfslog.conf
1.5
99/02/21 SMI"
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
# NFS server log configuration file.
#
# <tag> [ defaultdir=<dir_path> ] \
#
[ log=<logfile_path> ] [ fhtable=<table_path> ] \
#
[ buffer=<bufferfile_path> ] [ logformat=basic|extended ]
#
global
defaultdir=/var/nfs \
log=nfslog fhtable=fhtable buffer=nfslog_workbuffer
Use the following parameters with each tag, as needed:
defaultdir=dir_path
log=logfile_path
fhtable=table_path
buffer=
bufferfile_path
logformat=
basic|extended
Specifies the format when creating userreadable log files. The basic format produces a
log file similar to the FTPdaemon. The
extended format gives a more detailed view.
The /etc/nfs/nfslog.conf file defines the path, file names, and type of
logging that the nfslogd daemon must use. There is a tag corresponding
to each definition.
# cat /etc/nfs/nfslog.conf
#ident "@(#)nfslog.conf
1.5
99/02/21 SMI"
#
.
.
# NFS server log configuration file.
#
global defaultdir=/var/nfs \
log=nfslog fhtable=fhtable buffer=nfslog_workbuffer
public defaultdir=/var/nfs/public \
log=nfslog fhtable=fhtable buffer=nfslog_workbuffer
THESE2-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
To easily identify the log files for different shared resources, place them in
separate directories. For example:
1.
Become superuser.
2.
Edit the default settings for all file systems by changing the data
corresponding to the global tag.
To share file systems using NFS server logging, you must first enable
NFS server logging. Edit the /etc/dfs/dfstab file to add an entry
for file systems for which you want to enable NFS server logging.
Either:
Specify a tag by entering the tag to use with the log=tag option
in the /etc/dfs/dfstab file.
Use the log option without specifying a tag, which causes the
option to use the global tag as a default. The following
example uses the default settings in the global tag:
Run the share command to verify that the correct options are listed.
/export/sys44_data
6.
ro,log
""
# shareall
Description
IDLE_TIME
MIN_PROCESSING_SIZE
Sets the minimum number of bytes that the buffer file must
reach before processing and writing to the log file. The default
value is 524,288 bytes. Increasing this number can improve
performance by reducing the number of times that the buffer
file is processed.
The MIN_PROCESSING_SIZE and the IDLE_TIME parameters
determine how often the buffer file is processed.
UMASK
Specifies the permissions for the log files set by the nfslogd
daemon. The default value is 0137.
CYCLE_FREQUENCY
Determines the time that must pass before the log files are
cleared. The default value is 24 hours. Use the
CYCLE_FREQUENCY parameter to prevent the log files from
becoming too large.
MAX_LOGS_PRESERVE
THESE2-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Stateful connections.
Pseudo file systems which ensure the NFS client has seamless access
to all exported objects on the server and that portions of a server file
system that are not explicitly exported are not visible to the client.
Strong security.
Extended attributes
Delegation. In the Solaris 10 NFSv4 release, the NFS server can hand
over delegation of management of a shared file to the client
requesting that file. It is the server that decides whether or not to
apply delegation. By delegating read or write management control to
the client, this can greatly reduce the amount of network traffic
otherwise caused by clients making requests for the current state of a
shared file.
Pseudo-File System
Previous versions of NFS required use of the mountd protocol, which does
not use assigned ports. This made NFS hard to use through a firewall.
Implementation of NFSv4 must support Transmission Control
Protocol/Internet Protocol (TCP/IP) to provide congestion control. NFSv4
uses the well-known port 2049, thus improving firewall support.
NFSv4 maps file handles to path names, which the mountd protocol did in
previous NFS versions. In NFSv4, the server provides a root file handle
that represents the top of the file system that the server exported. The NFS
server maintains a pseudo -file system which contains the full path of
each exported file system.
NFSv4 includes features that were not in the previous versions of NFS.
These features include the following:
export_fs
local
projects
nfs4x
Exported directories
export_fs
payroll
local
projects
nfs4
Figure 2-3
nfs4
In Figure 2-3 the client cannot see the payroll directory and the nfs4x
directory because these directories are not exported and do not lead to
exported directories. However, the client can see the local directory
because local is an exported directory. The projects directory is visible
to the client because the projects directory leads to the exported
directory, nfs4. Thus, portions of the server namespace that are not
explicitly exported are bridged with a pseudo-file system that views only
the exported directories and those directories that lead to server exports.
This pseudo-file system is a structure that contains only directories, and is
created by the server. The pseudo-file system permits a client to browse
the hierarchy of exported file systems. Thus, the client's view of the
pseudo-file system is limited to paths that lead to exported file systems.
THESE2-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Server exports:
/export_fs/local
/export_fs/projects/nfs4
NFSv4 is the default NFS version in the Solaris 10 OS. The nfs(4) file in
the /etc/default directory configures the client or server to use NFS
versions 2, 3, or 4. In addition, the mount command (mount_nfs (1M)) can
use the vers=version_number option to mount a file system using only
the version specified.
Strong Security
NFSv4 uses the remote procedure call (RPC) implementation of the
General Security Service (GSS) framework to extend the basic security of
RPC. This provides mechanisms for authentication, integrity, and privacy
between the client and server.
Traditional RPC implementations included AUTH_NONE, AUTH_SYS,
AUTH_DH, and AUTH_KRB4 as security flavors. An additional security
method of RPCSEC_GSS is introduced that uses the functionality of
Generic Security Services Application Programming Interface (GSSAPI).
This allows the RPC layer to use various security mechanisms without the
additional implementation overhead of adding new security flavors.
Note RPCSEC_GSS security mandated for NFSv4 is the same as that
released on Solaris 2.6. The main RPCSEC_GSS security model is Kerberos
V5.
For NFSv4, the RPCSEC_GSS security method must be used to enable the
mandatory security mechanism. Other flavors, such as AUTH_NONE,
AUTH_SYS, and AUTH_DH may be implemented as well.
Previous versions of NFS did not permit a client to traverse server file
systems without mounting each file system. However, in NFSv4, the
server namespace does the following:
Compound Procedures
To improve performance and Internet access, the NFSv4 client combines
multiple operations which go in to one remote procedure call. By using
compound procedures, clients can combine LOOKUP, OPEN, and READ
operations in a single request. The server breaks the request into a list of
separate requests. The server iterates through the list and performs each
operation in the list until it reaches the end of the list or fails. The server
then returns the results of the operations to the client.
The following is a simplified example of compound procedures. When
reading the /export/testdata file, NFS versions 3 and 4 generate the
following RPC calls.
NFS version 3
NFS version 4
->OPEN "export/testdata"
READ
<- OPEN OK
READ OK
(sends data)
THESE2-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can mix the security mechanisms on a single server, which allows
security to be applied on a per-share basis.
NFS version 4
(sends data)
Extended Attributes
Earlier NFS versions used a fixed set of file and file system attributes that
were modeled on the UNIX files and file systems. A non-UNIX-like
server or client had to simulate those attributes, making implementation
on a non-UNIX system difficult. NFSv4 introduces three categories of
attributes: mandatory, recommended, and named. All NFSv4 clients and
servers supported the mandatory attributes to ensure a minimum level of
interoperability.
Not all clients or servers have to support the recommended attributes.
This allows a server to support the attributes that apply to its operating
environment. The client determines how to proceed if the server does not
support a particular recommended attribute.
The named attribute is in the form of a byte stream that is associated with
a file or file system and is referred to by a string name. This allows the
client to associate data with a specific file or file system.
File Handles
File handles are created on the server and contain information that
uniquely identifies files and directories. In NFS versions 2 and 3, the
server returned persistent file handles. This meant the client could
guarantee that the server would generate a file handle that always
referred to the same file. The following is an example:
If a file was deleted and replaced with a file of the same name, the
server would generate a new file handle for the new file. If the client
used the old file handle, the server would return an error that the file
handle was stale.
If a file was renamed, the file handle would remain the same.
If you had to reboot the server, the file handles would remain the
same.
Fewer RPC calls result in faster NFS response. This allows the client to
tailor its request to appropriately match the operating environment of the
client, thus enhancing cross-platform interoperability.
Delegation
NFSv4 provides both client support and server support for delegation.
Delegation is a technique by which the server delegates the management
of a file to a client.
For example, the server could grant either a read delegation or a write
delegation to a client. You can grant read delegations to multiple clients at
the same time, because these read delegations do not conflict with each
other. A write delegation can be to only one client, because a write
delegation conflicts with any file accessed by any other client.
While holding a write delegation, the client would not send various
operations to the server because the client is guaranteed exclusive access
to a file. Similarly, the client would not send various operations to the
server while holding a read delegation because the server guarantees that
no client can open the file in write mode.
THESE2-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When the server received a request from a client that included a file
handle, the resolution was straightforward, and the file handle always
referred to the correct file.
2.
The server alone decides whether to grant a delegation. A client does not
request a delegation. The server decides based on the access patterns for
the file. If several clients recently accessed a file in write mode, the server
might not grant a delegation because this access pattern indicates the
potential for future conflicts.
4.
5.
6.
2.
THESE2-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
NFS_SERVER_DELEGATION=off
Note Enable the client service if you are putting NFS mounts in
/etc/vfstab. You do this by running the svcadm enable
network/nfs/client command. Otherwise, they will not get mounted if
the OS is Secure By Default.
See the nfs(4) man page for a complete list of possible parameters.
The hosts database file that supports the client has the correct server
node, but the server node temporarily stops due to an overload.
To solve the rpcbind failure error condition when the server node is
operational, determine if the server is out of critical resources (for
example, memory, swap, or disk space).
THESE2-46
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can detect most NFS problems from console messages or from certain
symptoms that appear on a client system. Some common errors are:
The network between the local system and the server is down. To
verify that the network is down, enter the ping command
(ping server2).
To interrupt the failed client node press Stop-A, and boot the client
into single-user mode.
2.
3.
To continue booting to the default run level (normally run level 3),
press Control-D.
4.
5.
After you resolve problems with the NFS servers, remove the
comments from the /etc/vfstab file.
2.
2.
3.
THESE2-48
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
A possible cause for the stale NFS file handle error is that the file
resource on the server moved. To solve the stale NFS file handle error
condition, unmount and mount the resource again on the client.
To solve the no such file error condition, check that the directory exists
on the server. Check the spelling of the directory on the command line or
in the /etc/vfstab file.
THESE2-50
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Tasks
Complete the following tasks.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
4.
5.
Preparation
3.
4.
5.
6.
Use the mount command to display the mount options for the
/usr/share/man directory. Record the read and write options that
the mount command displays.
7.
8.
2.
THESE2-52
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
2.
2.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE2-54
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
share -o ro /usr/share/man
3.
svc:/network/nfs/cbd:default
svc:/network/nfs/client:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/mapid:default
svc:/network/nfs/rquota:default
svc:/network/nfs/server:default
Preparation
# share
- /usr/share/man
""
# dfshares
RESOURCE SERVER ACCESS TRANSPORT
server:/usr/share/man
server
-
# dfmounts
There is no output for the dfmounts command.
# mv /usr/share/man /usr/share/man.orig
# man ls
No manual entry for ls.
#
What message does the man command report?
No manual entry for ls.
2.
# cd /usr/share
# mkdir man
3.
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/rquota:udp
svc:/network/nfs/server:default
svc:/network/nfs/cbd:default
svc:/network/nfs/mapid:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/client:default
THESE2-56
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
5.
5.
# man ls
Are the man pages available?
6.
Use the mount command to display the mount options for the
/usr/share/man directory. Record the read and write options that
the mount command displays.
# mount
The ro | rw option for the mount command is read/write (rw) by
default.
7.
# touch /usr/share/man/test
touch: /usr/share/man/test cannot create
What is the result of trying to write to the NFS-mounted file system?
You cannot write to the file system.
What conclusion can be reached by this exercise?
Even though the file system mount is read/write, by default, the actual
ro | rw permission is read-only, as defined when the directory was shared
on the NFS server.
8.
# umount /usr/share/man
2.
# unshareall
# shareall
Yes
2.
# unshareall
# cd /usr/share
# rmdir man
# mv man.orig man
2.
# man ls
THESE2-58
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Configuring AutoFS
Objectives
The AutoFS file system provides a mechanism for automatically mounting
NFS file systems on demand and for automatically unmounting these file
systems after a predetermined period of inactivity. The mount points are
specified using local or distributed automount maps.
Upon completion of this module, you should be able to:
Module 3
THESE3-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
AutoFS
automount -v
Automount Maps
automountd
Master map
Direct map
Indirect map
Special map
Figure 3-1
RAM
THESE3-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
etc
auto_master
/net
/home
/-
-hosts
auto_home
auto_direct
[options]
[options]
[options]
auto_direct
/opt/moreapps pluto: /export/opt/apps
auto_home
Ernie mars:/export/home/ernie
Mary mars:/export/home/mary
Figure 3-2
Master map Lists the other maps used for establishing the AutoFS
file system. The automount command reads this map at boot time.
Direct map Lists the mount points as absolute path names. This
map explicitly indicates the mount point on the client.
Indirect map Lists the mount points as relative path names. This
map uses a relative path to establish the mount point on the client.
tells the automount command that it should look in the /etc directory for
its configuration information. Using nis instead of files tells automount
to check the NIS maps for its configuration information.
-nosuid,nobrowse
-nobrowse
The general syntax for each entry in the auto_master map is:
mount point
map name
mount options
where:
mount point
THESE3-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
automount: files
map name
mount options
Note The plus (+) symbol at the beginning of the +auto_master line in
this file directs the automountd daemon to look at the NIS, NIS+, or
LDAP databases before it reads the rest of the map. If this line is
commented out, only the local files are searched unless the
/etc/nsswitch.conf file specifies that NIS, NIS+, or LDAP should be
searched.
The auto_home
map
-nosuid,nobrowse
-nobrowse
-ro
THESE3-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Note The /- entry is not an entry in the default master map. This entry
has been added here as an example. The other entries in this example
already exist in the auto_master file.
key
The full path name of the mount point for the direct
maps.
mount-options
location
The following direct map entry specifies that the client mounts the
/usr/share/man directory as read-only from the servers server3,
server4, or server5, as available.
/usr/share/man
-ro
server3,server4,server5:/usr/share/man
Note Selection criteria for multiple servers, such as server proximity and
administrator-defined weights, is defined in the Replicated File Systems
section of the automount man page.
THESE3-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
where:
# cat /etc/auto_master
# Master map for automounter
#
+auto_master
/net
-hosts
/home
auto_home
-nosuid,nobrowse
-nobrowse
[ mount-options ]
location
The /home entry defines a mount point for an indirect map. The map
auto_home lists relative path names only. Indirect maps obtain the initial
path of the mount point from the master map.
key
mount-options
location
NFS Server
"mars"
NFS Client
"venus"
export
home
etc
mary
auto_home
home
ernie
mary
autofs
autofs
Mount on Demand
by automountd
Figure 3-3
THESE3-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
where:
Figure 3-4
server1:/export/home/&
-v
You can modify the master map entries or add entries for new maps.
However, you must run the automount command to make these changes
effective.
Note If you change the mount point, the first field of the direct map, you
must stop and start automountd. If you change any other entry in the
direct map then you do not have to restart automountd.
Any modifications to indirect maps are automatically used by the
automountd daemon.
A modification is a change to options or resources. A change to the key
(the mount point) or a completely new line is an added entry, a deleted
entry, or both.
Use Table 3-1 to determine whether you should run (or rerun) the
automount command.
Table 3-1
Automount Map
Master map
Yes
Yes
Direct map
Yes
No
Indirect map
No
No
mount_point
fstype
options
time
where:
special
THESE3-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You do not have to stop and restart the automountd daemon after making
changes to existing entries in a direct map, because the daemon is
stateless. You can modify existing entries in the direct map at any time.
The new information is used when the automountd daemon next accesses
the map entry to perform a mount.
fstype
options
time
mount_point
THESE3-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can display the /etc/mnttab file to obtain a snapshot of the mounted
file systems, including those mounted as an AutoFS file system type.
Choose a partner for this lab, and determine which system will be
configured as the NFS server and which will serve as the NFS client.
Verify that entries for both systems exist in the /etc/hosts file of each
system. Refer to the lecture notes as necessary to perform the steps listed.
Tasks
Perform the following tasks.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
Edit the /etc/dfs/dfstab file, and add a line to share the man
pages.
3.
2.
3.
4.
THESE3-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
2.
3.
Primary group: 10
Login shell:/bin/ksh
Configure the password mechanism for usera so that this user must
assign a new password (123pass) at next login. Do this by executing
the passwd -f usera command.
Verify that the /export/home directory exists. If it does not, create it.
2.
3.
Primary group: 10
Configure the password mechanism for usera so that this user must
assign a new password (123pass) at next login. Do this by executing
the passwd -f usera command.
1.
Edit the /etc/passwd file, and change the home directory for usera
from the /export/home/usera directory to /home/usera.
2.
3.
server:/export/home/usera
2.
On the server?
________________________________________________
On the client?
________________________________________________
THESE3-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
2.
3.
4.
5.
2.
3.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE3-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Choose a partner for this lab, and determine which system will be
configured as the NFS server and which will serve as the NFS client.
Verify that entries for both systems exist in the /etc/hosts file of each
system. Refer to the lecture notes as necessary to perform the steps listed.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
Edit the /etc/dfs/dfstab file, and add a line to share the man
pages.
share -o ro /usr/share/man
3.
# shareall
Preparation
# cd /usr/share/
# mv man man.orig
Make a backup copy of the /etc/auto_master file called
/etc/_auto_master and then edit the /etc/auto_master file and
add an entry for a direct map.
# cp /etc/auto_master /etc/_auto_master
# vi /etc/auto_master
/auto_direct
3.
# vi /etc/auto_direct
/usr/share/man
server:/usr/share/man
4.
5.
# automount -v
# man ls
<-- output from man command -- >
# mount | grep man
/usr/share/man on sys44:/usr/share/man
remote/read/write/setuid/dev=42c0003 on Thu Jan 6 08:07:26 2005
What did you observe to indicate that the automount operation was
successful?
This operation should automatically mount the directory in which the
manuals are stored. In other words, the man command should work.
# ls /export/home
THESE3-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
# mkdir /export/home
Add a user account with the following characteristics:
Primary group: 10
Login shell:/bin/ksh
Configure the password mechanism for usera so that this user must
assign a new password (123pass) at next login. Do this by executing
the passwd -f usera command.
Verify that the /export/home directory exists. If it does not, create it.
# ls /export
# mkdir /export/home
2.
Primary group: 10
Configure the password mechanism for usera so that this user must
assign a new password (123pass) at next login. Do this by executing
the passwd -f usera command.
2.
Edit the /etc/passwd file, and change the home directory for usera
from the /export/home/usera directory to /home/usera.
# vi /etc/passwd
2.
# cp /etc/auto_home /etc/_auto_home
Edit the /etc/auto_home file and add the following line:
usera
server:/export/home/usera
share /export/home
2.
# shareall
THESE3-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
3.
On the server?
The /home/username directory is mounted on the
/export/home/username directory.
On the client?
2.
3.
4.
# init 6
# rmdir /usr/share/man
5.
# mv /usr/share/man.orig /usr/share/man
2.
3.
# unshareall
Notes:
THESE3-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Describing RAID
Objectives
A redundant array of independent disks (RAID) configuration enables
you to expand the characteristics of a storage volume beyond the physical
limitations of a single disk. You can use a RAID configuration to increase
storage capacity as well as to improve disk performance and fault
tolerance.
Upon completion of this module, you should be able to:
Describe RAID
Module 4
Introducing RAID
Introducing RAID
RAID 0
RAID-0 volumes, including both stripes and concatenations, are
composed of slices and let you expand disk storage capacity. You can
either use RAID-0 volumes directly or use the volumes as the building
blocks for RAID-1 volumes (mirrors). There are two types of RAID-0
volumes:
THESE4-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
Concatenated Volumes
Figure 4-1 shows that in a concatenated RAID 0 volume, data is organized
across disk slices, forming one logical storage unit.
Physical
Slice A
Solaris Volume
Manager
Physical
Slice B
Physical
Slice C
Figure 4-1
RAID-0 Concatenation
RAID 0
(Concatenation)
Logical Volume
Introducing RAID
This interlacing of data is a function of the UFS file system that is
mounted in the concatenated volume and is not a function of the
concatenated volume itself.
Striped Volumes
Figure 4-2 shows the arrangement of a striped RAID-0 volume. A RAID 0
volume configured as a stripe arranges data across two or more slices.
Striping alternates equally-sized segments of data across two or more
slices, forming one logical storage unit. These segments are interleaved
round-robin, so that the combined space is created alternately from each
slice.
Physical
Slice A
Physical
Slice B
Physical
Slice C
Interlace 1
Interlace 2
Interlace 3
Interlace 4
Interlace 5
Interlace 6
Solaris Volume
Manager
Interlace 1
Interlace 2
Interlace 3
Interlace 4
Interlace 5
Interlace 6
RAID 0
(Stripe)
Logical Volume
Figure 4-2
RAID-0 Stripe
THESE4-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can also use a concatenation to expand any active and mounted UFS
file system without having to bring down the system. The capacity of a
concatenation is the total size of all the slices in the concatenation.
Introducing RAID
Striping enables parallel data access because data can be retrieved from
multiple disks at the same time. Parallel access increases input/output
(I/O) throughput because multiple disks in the volume are busy servicing
I/O requests simultaneously.
RAID 1
RAID-1 volumes, also known as mirror volumes in the Solaris Volume
Manager software, are typically composed of RAID-0 volumes and
provide the advantage of data redundancy. The disadvantage is the
higher cost incurred by requiring two RAID-1 devices wherever a single
RAID-0 device is mirrored. Typical topics to be considered when
configuring mirrors are:
RAID 0+1
RAID 1+0
You cannot convert an existing file system directly to a stripe. You must
first back up the file system, create the stripe, and then restore the file
system to the stripe.
Introducing RAID
THESE4-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
You can attach or detach a submirror from a mirror at any time, though at
least one submirror must remain attached to the mirror at all times.
Usually, you begin the creation of a mirror with only a single submirror,
after which you can attach additional submirrors, as shown in Figure 4-3.
Interlace 1
RAID 1
(Mirror)
Logical Volume
Interlace 2
Interlace 3
Interlace 4
Submirror 1
Submirror 2
Int 1
Int 1
Int 2
Int 2
Interlace 1
Int 3
Int 3
Interlace 2
Int 4
Int 4
Submirror 2
Solaris Volume
Manager
Interlace 3
Interlace 4
Figure 4-3
RAID-1 Mirror
The Solaris Volume Manager software makes duplicate copies of the data
located on multiple physical disks. The Solaris Volume Manager software
presents one virtual disk to the application. All disk writes are duplicated,
and disk reads come from one of the underlying submirrors. If the
submirrors are not of equal size, the total capacity of the mirror is limited
by the size of the smallest submirror.
Submirror 1
Introducing RAID
RAID 0+1
Physical
Slice B
Physical
Slice C
Physical
Slice D
RAID 0
(Striped)
Volume
Submirror 1
Physical
Slice E
Physical
Slice F
RAID 0
(Striped)
Volume
Submirror 2
RAID 1
(Mirrored)
Volume
Figure 4-4
THESE4-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
RAID 1+0
Physical
Slice D
RAID 1
(Mirror)
Logical
Volume
Physical
Slice B
RAID 1
(Mirror)
Logical
Volume
Physical
Slice E
Physical
Slice C
RAID 1
(Mirror)
Logical
Volume
Physical
Slice F
RAID 0
(Striped)
Logical Volume
Figure 4-5
Introducing RAID
Mirror Options
Note The mirror options listed here are representative of the options
presented when configuring RAID-1 mirrors using the Solaris Volume
Manager software.
You can define mirror options when you initially create the mirror or after
you set up the mirror. You can distribute the load across the submirrors to
improve read performance. Table 4-1 describes the configurable mirror
read policies.
Table 4-1 Mirror Read Policies
Read Policy
Description
Geometric
First
Description
Parallel (Default)
Serial
THESE4-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
When a submirror is offline, any writes to the mirror are tracked in a dirty
region log. When the submirror is brought back online, those regions
must be updated or resynchronized.
Mount the mirror device directly. Do not try and mount a submirror
directly, unless it is offline and mounted as read-only. Do not mount
a slice that is part of a submirror, or you might destroy data and
crash the system.
Introducing RAID
Use the swap -l command to check for all swap devices. Mirror the
slices specified as swap separately.
RAID-5 volumes are striped volumes that use a distributed parity scheme
for data protection. To fully understand RAID-5 volumes, you must
understand each of the following:
THESE4-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
RAID 5
Introducing RAID
Interlace 1
Physical
Slice A
RAID 5
Logical Volume
P(4-6)
Interlace 7
Interlace 1
Interlace 10
Interlace 2
Interlace 3
Interlace 2
Physical
Slice B
Interlace 4
Interlace 4
Interlace 5
P(7-9)
Interlace 6
Interlace 11
Interlace 3
Physical
Slice C
Solaris Volume
Manager
Interlace 7
Interlace 8
Interlace 5
Interlace 9
Interlace 8
Interlace 10
P(10-12)
Interlace 11
Interlace 12
P(1-3)
Physical
Slice D
Interlace 6
Interlace 9
Interlace 12
Figure 4-6
Figure 4-6 shows that the first three data interlaces are written to slices A,
B, and C. The next item written is parity to Drive D. The pattern of
writing data and parity results in both data and parity spread across all
disks in the RAID-5 volume. You can read each drive independently. The
parity protects against a single disk failure. In RAID-5 Distributed
Parity, if each disk were 2 Gbytes, the total capacity of the RAID-5
volume would be 6 Gbytes. Parity information occupies the space
equivalent to one drive.
Introducing RAID
When you create a RAID-5 volume, you can define the interlace
value. If you do not specify a value, a default value of 16 Kbytes is
assigned.
A RAID-5 volume (with no hot spares) can only handle a single slice
failure.
THESE4-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
Storage Configurations
Storage Characteristics
When you classify storage characteristics, you provide guidelines for
working with the Solaris Volume Manager software RAID-0
(concatenation and stripe) volumes, RAID-1 (mirror) volumes, and
RAID-5 (striping with distributed parity) volumes.
While building your storage management plan, decide what types of
storage devices to use. The storage characteristics guidelines help you
compare and contrast the various storage mechanisms and also help you
choose the best storage device.
Introducing RAID
Note The storage mechanisms listed in Table 4-3 are not mutually
exclusive. You can use them in combination to meet multiple goals. For
example, you could create a RAID-1 volume for redundancy, and then
create soft partitions on it to increase the number of possible discrete file
systems.
RAID-0
Concatenation
RAID-0
Stripe
RAID-1
Mirror
RAID-5
Stripe With
Parity
Redundant
data
No
No
Yes
Yes
Improved
read
performance
No
Yes
Depends
on the
underlying
device
Yes
Improved
write
performance
No
Yes
No
No
Feature
RAID 1
(Mirror)
RAID 5
Non-Redundant
Write operations
Faster
Slower
Neutral
Random read
Slower
Faster
Neutral
Hardware cost
Highest
Higher
Lowest
Performance
during failure
Best
Poor
Data loss
THESE4-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
Striping performs well for large, sequential I/O and for random I/O
distributions.
RAID 5 writes are not as fast as mirrored writes, and mirrored writes
are not as fast as unprotected writes.
Performance Guidelines
When designing your storage configuration, consider the following
performance guidelines:
Identify the most frequently accessed data, and increase the access
bandwidth for that data with mirroring or striping.
For raw random I/O reads, the stripe and the RAID-5 volume are
comparable. Both the stripe and RAID-5 volume split the data across
multiple disks, and the RAID-5 volume parity calculations are not a
factor in reads, except after a component failure.
THESE4-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Introducing RAID
Objectives
Build a RAID-1 (mirror) volume for the root (/) file system
Module 5
In some instances, the Solaris Volume Manager software can also improve
I/O performance.
Logical Volume
The Solaris Volume Manager software uses virtual disks called logical
volumes to manage physical disks and their associated data. Historically,
a logical volume is functionally identical to a physical slice. However, a
logical volume can span multiple disk members. The Solaris Volume
Manager software converts I/O requests directed at a volume into I/O
requests to the underlying member disks.
You can create the Solaris Volume Manager software volumes from slices
(disk partitions) or from other Solaris Volume Manager software volumes.
You build and modify volumes using command-line utilities in the Solaris
Volume Manager software.
THESE5-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The Solaris Volume Manager software lets you manage large numbers of
disks and the data on those disks. Although there are many ways to use
the Solaris Volume Manager software, most tasks include:
The Solaris Volume Manager software can increase the reliability and
availability of data by using RAID-1 volumes and RAID-5 volumes.
Solaris Volume Manager software hot spares provide another level of data
availability for RAID-1 volumes and RAID-5 volumes.
Note In earlier versions of the Solaris OS, the Solaris Volume Manager
software was known as Solstice DiskSuite software, and logical
volumes were known as metadevices. Most of the associated
commandline tools begin with the prefix meta. Logical devices are located
under the /dev/md directory.
Soft Partitions
As disks become larger, and disk arrays present larger logical devices to
the Solaris OS, users must be able to subdivide disks or logical volumes
into more than eight sections, often to create manageable file systems or
partition sizes.
Soft partitions provide a mechanism for dividing large storage spaces into
smaller, more manageable, sizes. For example, large storage aggregations
provide redundant storage of many gigabytes, but many scenarios would
not require as much space. Soft partitions allow you to subdivide that
storage space into more manageable sections, each of which can have a
complete file system.
For example, you could create 1000 soft partitions on top of a RAID-1
volume or RAID-5 volume so that each of your users can have a home
directory on a separate file system. If a user needs more space at a later
date, you can grow the soft partition.
Note The Solaris Volume Manager software can support up to
8192 logical volumes per disk set, but is configured for 128 (d0d127) by
default. For instructions on increasing the number of logical volumes,
refer to the Solaris Volume Manager Administration Guide, part number
806-6111-10.
To create more storage capacity as a single volume, you can use the
Solaris Volume Manager software to make the system treat a collection of
many small slices as one large slice or device. After creating a large
volume from these slices, you can immediately begin by using it just as
any other slice or device.
When you partition a disk and build a file system on the resulting slices,
you cannot later extend a slice without modifying or destroying the disk
format. With soft partitions, you can extend portions up to the amount of
space on the underlying device without moving or destroying data on
other soft partitions.
You can build soft partitions on any slice. Creating a single slice that
occupies the entire disk and then creating soft partitions on that slice
is the most efficient way to use soft partitions at the disk level.
You can grow soft partitions to use any available space on a volume.
THESE5-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The system will stay running if at least half of the state database
replicas are available.
The system will panic if fewer than half the state database replicas
are available.
The system will not start the Solaris Volume Manager software
unless a majority (half + 1) of the total number of state database
replicas are available.
You can put replicas on unused slices, and then use them on RAID-0,
RAID-1, or RAID-5 volumes.
For a system with only a single drive: put all three replicas in
one slice.
For a system with two to four drives: put two replicas on each
drive.
For a system with five or more drives: put one replica on each
drive.
Make sure that you have at least two extra replicas per mirror.
You can add additional state database replicas to the system at any
time. The additional state database replicas help to ensure the Solaris
Volume Manager softwares availability.
THESE5-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Hot Spares
A hot spare is a slice (not a volume) that is functional and available, but
not in use. A hot spare is on reserve to substitute for a failed slice in a
submirror or RAID-5 volume. You cannot use a hot spare to hold data or
state database replicas until the hot spare is assigned as a member. A hot
spare must be ready for immediate use in the event of a slice failure in the
volume with which it is associated. To use hot spares, invest in additional
disks beyond those that the system requires to function.
THESE5-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The state database stores information on disk about the state of your
Solaris Volume Manager software configuration. Multiple copies of the
database, called replicas, provide redundancy and protect against data
loss if a copy of the database is corrupted due to the system crashing or
other failure. The state database replicas should be distributed across
multiple disks so that failure of a single disk only causes the loss of a
single state database replica.
If the system loses a state database replica, Solaris Volume Manager
software uses a majority consensus algorithm to determine which state
database replicas still contain valid data. The algorithm requires that a
majority (half +1) of the state database replicas are available before any of
them are considered valid. The majority consensus algorithm requires that
you create at least three state database replicas before you build or
commit any metadevices. To reach a consensus, at least two of the three
replicas must be available.
The majority consensus algorithm:
Makes sure that the system stays running if at least half of the state
database replicas are available.
Causes the system to panic if fewer than half of the state database
replicas are available.
If insufficient state database replicas are available, you must boot into
single-user mode and delete enough of the corrupt replicas to achieve a
majority consensus.
State database replicas are stored in their own disk slices.
-a
-f
-c n
-l nnnn
disk_slice
Note The metadb command without options reports the status of all
replicas.
The following example shows the creation of state database replicas:
# metadb -a -f c0t0d0s4 c0t0d0s5 c1t0d0s0 c1t0d0s1
# metadb
flags
first blk
block count
a
u
16
8192
a
u
16
8192
a
u
16
8192
a
u
16
8192
/dev/dsk/c0t0d0s4
/dev/dsk/c0t0d0s5
/dev/dsk/c1t0d0s0
/dev/dsk/c1t0d0s1
This example lists the four replicas that were just created. Each replica
begins at block 16 of the assigned disk slice. Each replica is 8192 blocks, or
4 Mbytes in size. The flags indicate that the replica is active and up to
date. If there are capital letters in the flags field, it is an indication that the
replica is corrupt.
Note The previous example places the state database replicas on disks
on different controllers. This is an appropriate configuration for a
production environment.
THESE5-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
where:
Configuring RAID-0
Configuring RAID-0
Physical
Slice A
Physical
Slice B
Physical
Slice C
Interlace 1
Interlace 2
Interlace 3
Interlace 4
Interlace 5
Interlace 6
Solaris Volume
Manager
Interlace 1
Interlace 2
Interlace 3
Interlace 4
Interlace 5
Interlace 6
RAID 0
(Stripe)
Logical Volume
Figure 5-1
RAID-0 Stripe
THESE5-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The following examples will show how to create a RAID-0 volume using
the command line and Sun Management Console.
size
470M
used
395M
avail capacity
28M
94%
Mounted on
/export/home
block count
8192
8192
8192
8192
/dev/dsk/c3t2d0s7
/dev/dsk/c3t2d0s7
/dev/dsk/c3t3d0s7
/dev/dsk/c3t3d0s7
-f
concat/stripe
numstripes
width
component
THESE5-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
where:
Reloc
Yes
Reloc
Yes
sys
85,
0 Oct 25 12:35 d0
sys
85,
0 Oct 25 12:35 d0
size
470M
used
395M
avail capacity
28M
94%
Mounted on
/export/home
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes Change the device files to the metadevice files:
/dev/md/dsk/d0/dev/md/rdsk/d0 /export/home
ufs
yes
Then un-mount and re-mount the file system using the new device files:
# umount /export/home
# mount /export/home
# df -h /export/home
Filesystem
/dev/md/dsk/d0
size
470M
used
395M
avail capacity
28M
94%
Mounted on
/export/home
The file system is now mounted using the metadevice device file. Notice
that the file system does not appear to be any bigger, and the capacity is
still at 94 percent. The existing file system needs to be grown into the new
space. This is done with the growfs command. Use the option -M to
specify a mount point:
# growfs -M /export/home /dev/md/rdsk/d0
/dev/md/rdsk/d0: 3118752 sectors in 3094 cylinders of 16 tracks, 63
sectors
1522.8MB in 194 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 16224, 32416, 48608, 64800, 80992, 97184, 113376, 129568, 145760,
2968096, 2984288, 3000480, 3016672, 3032864, 3049056, 3065248, 3081440,
3096608, 3112800,
The file system now occupies all the space in the d0 metadevice:
# df -h /export/home
Filesystem
/dev/md/dsk/d0
size
1.4G
used
395M
avail
988M
capacity
29%
Mounted on
/export/home
THESE5-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring RAID-1
Configuring RAID-1
RAID-1 volumes are also known as mirrors and provide data redundancy.
In a two-way mirror, the data is written to two disk slices of the same size.
If one disk fails, the other will have an up-to-date copy of the data.
Configuring RAID-1
Mirror Options
Note The mirror options listed here are representative of the options
presented when configuring RAID-1 mirrors using the Solaris Volume
Manager software.
You can define mirror options when you initially create the mirror or after
you set up the mirror. You can distribute the load across the submirrors to
improve read performance. Table 5-1 describes the configurable mirror
read policies.
Table 5-1 Mirror Read Policies
Read Policy
Description
Geometric
First
THESE5-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring RAID-1
You can improve write performance by replicating all submirrors
simultaneously. If a failure occurs during this write, the submirror that
had the failure is put into maintenance state (errored state). Table 5-2
describes the configurable mirror write policies.
Write Policy
Description
Parallel (Default)
Serial
When a submirror is offline, any writes to the mirror are tracked in a dirty
region log. When the submirror is brought back online, those regions
must be updated or resynchronized.
Create a RAID-0 volume for the file system you want to mirror.
2.
3.
Create a one-way mirror using the RAID-0 volume that contains the
file system to be mirrored.
4.
5.
6.
7.
Record the alternate boot path that is used in the event of a failure of
the primary submirror, as this is a mirror of the root (/) file system.
THESE5-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The procedure for building a mirror of the root (/) file system can be
accomplished using the command line exclusively but it is not possible to
use the Solaris Management Console (SMC) exclusively. As seen during
RAID-0 configuration, SMC is not able to force the creation of a
metadevice from a mounted file system.
The Scenario
1.
2.
3.
@
Figure 5-2
@
@
RAID 0
Volume
RAID 0
Volume
The scenario assumes the root (/) file system is on disk slice c0t0d0s0.
read_options
write_options
pass_num
THESE5-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Note If neither the -g nor -r options are specified, reads are made in a
round-robin order from all submirrors in the mirror. This process enables
load balancing across the submirrors.
When mirroring the root (/) file system, use the metaroot command to
modify the /etc/vfstab and /etc/system files, as follows:
metaroot device
where device specifies either the metadevice or the conventional disk
device (slice) used for the root (/) file system.
The following example shows that the /etc/vfstab file has been
updated by the metaroot command to point to the RAID-1 mirrored
metadevice.
# metaroot d10
# grep md /etc/vfstab
/dev/md/dsk/d10
/dev/md/rdsk/d10
ufs
no
In addition to modifying the /etc/vfstab file to update the root (/) file
system pointer, the metaroot command updates the /etc/system file to
support the logical volumes. For example:
# tail /etc/system
rootdev:/pseudo/md@0:0,10,blk
You must reboot the system before attaching the secondary submirror.
When the system boots, it mounts the root file system using the
metadevice device file. Enter the init command to reboot the system:
# init 6
After the reboot is complete, the root file system is mounted through the
d10 metadevice:
# df -h /
Filesystem
/dev/md/dsk/d10
size
141M
used
111M
avail capacity
15M
88%
Mounted on
/
THESE5-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When creating mirrors of mounted file systems, you must update the
/etc/vfstab file to change the mount point from a slice, such as
/dev/dsk/c#t#d#s#, to a volume, such as /dev/md/dsk/d##. When
mirroring any mounted file system other than root (/), you can use the vi
editor to update the /etc/vfstab file.
# metastat
d10: Mirror
Submirror 0: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 307440 blocks (150 MB)
d11: Submirror of d10
State: Okay
Size: 307440 blocks (150 MB)
Stripe 0:
Device
Start Block Dbase
c0t0d0s0
0
No
(output omitted)
The metastat command shows the state of the metadevices. Notice here
that only one submirror is in the d10 metadevice:
THESE5-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
If you do not adapt to the change when attempting to boot from the
alternate boot device, you get an error stating:
cant open boot device
To get the system to boot automatically from the alternate boot device in
the event of a primary root submirror failure, complete the following
steps:
1.
ok printenv boot-device
boot-device= disk net
ok setenv boot-device disk backup_root net
boot-device= disk backup_root net
In the event of primary root disk failure, the system automatically boots
from the secondary submirror. To test the secondary submirror, boot the
system manually, as follows:
ok boot backup_root
/pci@1f,0/pci@1/scsi@4,1/disk@2,0:b
BIOS
Before the kernel is started, the system is controlled by BIOS. You can
usually configure the BIOS to select the order of devices to probe for the
boot record. Additionally, most modern BIOS implementations allow you
to configure your devices so that the failover to the secondary submirror
is automatic. If your system's BIOS does not have this feature and the
primary submirror fails, you need to access the BIOS during system boot
to reconfigure the system to boot from the secondary root slice.
fdisk Partitioning
Suns x86-based systems use fdisk partitions on system disks. For an x86based system with the Solaris OS installed, there are two common fdisk
partitioning schemes. One approach uses two fdisk partitions.
There is a Solaris OS fdisk partition and another, small fdisk partition of
about 10 Mbyte called the x86 boot partition. This partition has an ID
value of 190. The Solaris OS system installation software creates a
configuration with these two fdisk partitions as the default. The x86 boot
partition is needed in some cases, such as when you want to use liveupgrade on a single disk configuration, but it is problematic when using
root mirroring. The Solaris OS system installation software only allows
one x86 boot partition for the entire system and it places important data
on that fdisk partition.
You can determine if your system has a separate x86 boot partition, check
the /etc/vfstab file. The x86 boot partition exists if the file contains an
entry similar to the following:
/dev/dsk/c0t0d0p0:boot - /boot pcfs - no Because this fdisk partition is outside of the Solaris OS fdisk partition, it
cannot be mirrored by SVM. Furthermore, because there is only a single
copy of this fdisk partition, it represents a single point of failure.
THESE5-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Starting with the Solaris 10 1/06 release, the open source GNU GRand
Unified Bootloader (GRUB) has been adopted in the Solaris OS for x86
based systems. GRUB is responsible for loading a boot archive into the
system's memory. A boot archive is a collection of critical files that is
needed during system start-up before the root (/) file system is mounted.
The boot archive is used to boot the Solaris OS.
The most notable change is the replacement of the Solaris Device
Configuration Assistant with the GRUB menu. The GRUB menu facilitates
booting the different operating systems that are installed on your system.
The GRUB menu is displayed when you boot an x86 based system. From
the GRUB menu, you can select an OS instance to install by using the
arrow keys. If you do not make a selection, the default OS instance is
booted.
The device naming conventions that GRUB uses are slightly different
from previous Solaris OS versions. Understanding the GRUB device
naming conventions can assist you in correctly specifying drive and
partition information when you configure GRUB on your system. Table
describes the GRUB device naming conventions.
Table 5-3 Naming Conventions for GRUB Devices
Device Name
Description
(fd0), (fd1)
(nd)
Network device
(hd0,0), (hd0,1)
(hd1,0), (hd1,1)
(hd0,0,a),
(hd0,0,b)
0
Sector 0 =
mboot + fdisk
Partition table
Sector 0 = stage1
Sector 1 + 2 =
disk label + VTOC
Sector 50 = stage2
- extends for
200 + sectors
Figure 5-3
The stage1 and stage2 programs are located in cylinder 0 (typically disk
cylinder 1) of the Solaris fdisk partition, and remain protected by the
space allocated to slice 8 within the Solaris fdisk partition. To make a
disk bootable, you use the installgrub command to install the stage1
and stage2 programs in these locations. For example:
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2d0p0
THESE5-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
Knowing the block address at which the stage2 GRUB starts on the
disk, stage1 then loads and executes stage2. The stage2 GRUB
contains code that allows it to navigate the UFS structure on the root
file system.
3.
4.
5.
6.
To make a disk bootable, you may need to install the mboot program
manually. To do this, you use the fdisk command as in this example, and
specify the appropriate disk device:
7.
The kernel then executes, finds out what the real root file system is
by looking at the bootpath property in the
/boot/solaris/bootenv.rc file in the boot archive, mounts the
device specified as root, and continues with the boot process.
8.
The memory that was taken up by GRUB and the ramdisk are
subsequently freed for future use.
Laying out all the components to make the boot process (Figure 5-3 on
page 5-30) work properly is accomplished by running a program called
installgrub. The installgrub command performs the following
operations:
1.
Copy the stage1 GRUB to the partition boot sector (the first sector
of the Solaris fdisk partition). The installgrub program modifies
this copy of stage1 to point to the physical location of
stage2 GRUB on the disk.
2.
3.
Verify that the ordering for the BIOS boot device can be configured
to allow the system to boot off of the second disk in the mirror.
2.
3.
5.
Identify the slice that contains the existing root (/) file system to be
mirrored.
6.
Create a new RAID-0 volume on the slice from the previous step.
THESE5-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
7.
8.
9.
Remount your newly mirrored file system, then reboot the system.
# metaroot volume-name
# reboot
10. Attach the second submirror.
# metattach volume-name submirror-name
11. Define the alternative boot path in the /boot/grub/menu.lst file.
To enable the system to boot off of the disk that holds the secondary
submirror, configure the system to see the disk as the alternate boot
device.
In this menu.lst example, the alternative path is on the first slice of
the first fdisk partition on the second BIOS disk.
# vi /boot/grub/menu.lst
....
title alternate boot
root (hd1,0,a)
kernel /boot/multiboot
module /boot/x86.miniroot-safe
This can be done using the Enhanced Storage tool within the Solaris
Management Console or by using the metainit command. See
Creating the RAID-0 Volumes on page 5-21.
1.
# metastat d10
d10: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d12
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 307440 blocks (150 MB)
d11: Submirror of d10
State: Okay
Size: 307440 blocks (150 MB)
Stripe 0:
Device
Start Block Dbase
c0t0d0s0
0
No
THESE5-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Follow this procedure to unmirror the root (/) file system. This procedure
assumes that the root (/) file system is mirrored on a Solaris Volume
Manager software volume named d10, and that the mirror consists of two
submirrors. The primary submirror is d11, and the secondary submirror is
d12. To unmirror the root (/) file system, complete the following steps:
# metaroot /dev/dsk/c0t0d0s0
# grep c0t0d0s0 /etc/vfstab
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no 4.
5.
# init 6
# metaclear -r d10
d10: Mirror is cleared
d11: Concat/Stripe is cleared
# metaclear d12
d12: Concat/Stripe is cleared
6.
3.
Preparation
Due to the differences in Suns SPARC and x86 architecture, this exercise
can only be performed on SPARC-based systems. If you are using an x86based system, perform the tasks in Exercise: Mirroring the root (/) File
System on x86/x64-Based Systems on page 5-49.
This exercise mirrors the root (/) file system of your systems boot disk.
This exercise requires a second disk that is not in use. Steps in this
exercise direct you to partition the second disk so that it has two
partitions equal to or greater than the size of the root (/) partition on the
boot disk, and at least two partitions to be used for state database replicas.
This exercise is performed on each individual system, so there is no need
to work with a partner. Steps in these procedures are executed using the
command line.
This exercise requires an understanding of how to use the format utility to
partition disks.
Tasks
Complete the following steps:
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
Use the df -h command to list file systems in use, and the format
utility to display the partition table for your systems boot disk.
Record the following information:
THESE5-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Disk slice used for the root (/) file system, and its size in
megabytes. This will become the primary submirror:
_______________________________________________________
Does the slice used for the root (/) file system start on cylinder
0 of the boot disk?
_______________________________________________________
Disk slice for state database replica 1:
_______________________________________________________
3.
4.
Use the format utility to partition your spare disk so that it includes
the partitions listed:
Set the size of slice 0 to be equal to or greater than the disk slice
used for the root (/) file system. This slice is a candidate to
become the secondary submirror.
Set the size of slice 1 to be equal to or greater than the disk slice
used for the root (/) file system. This slice is a candidate to
become the secondary submirror.
5.
Create a RAID-0 volume to use as the root (/) file systems primary
submirror.
7.
Create a RAID 0 volume on the secondary drive to use as the root (/)
file systems secondary submirror.
You should refer to step 2 to determine which of the following
conditions is true.
a.
If the root slice on your boot disk starts on cylinder 0, use slice 0
on the second disk as the secondary submirror.
b.
If the root slice on your boot disk does not start on cylinder 0, use
slice 1 on the second disk as the secondary submirror.
8.
Create a RAID-1 volume as a one-way mirror using the root (/) file
system primary submirror as the source of the mirrors data.
9.
THESE5-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
____________________________________________________________
b.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE5-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
Preparation
Due to the differences in Suns SPARC and x86 architecture, this exercise
can only be performed on SPARC-based systems. If you are using an x86based system, perform the tasks in Exercise: Mirroring the root (/) File
System on x86/x64-Based Systems on page 5-49.
This exercise mirrors the root (/) file system of your systems boot disk.
This exercise requires a second disk that is not in use. Steps in this
exercise direct you to partition the second disk so that it has two
partitions equal to or greater than the size of the root (/) partition on the
boot disk, and at least two partitions to be used for state database replicas.
This exercise is performed on each individual system, so there is no need
to work with a partner. Steps in these procedures are executed using the
command line.
This exercise requires an understanding of how to use the format utility to
partition disks.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
Use the df -h command to list file systems in use, and the format
utility to display the partition table for your systems boot disk.
Record the following information:
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
Disk slice used for the root (/) file system, and its size in
megabytes. This will become the primary submirror: 0
As pre-defined for your lab system. (Slice 0 and 10.00 Gbytes, in this
example.)
Does the slice used for the root (/) file system start on cylinder
0 of the boot disk?
As pre-defined for your lab system. (No, in this example - it starts on
cylinder 52319.) This information is required to determine what slice
on the second disk to use as the secondary submirror, for the purpose
of this exercise.
# df -h
Filesystem
size
used avail capacity Mounted on
/dev/dsk/c0t0d0s0
9.8G
4.5G
5.2G
47%
/
/devices
0K
0K
0K
0%
/devices
ctfs
0K
0K
0K
0%
/system/contract
proc
0K
0K
0K
0%
/proc
mnttab
0K
0K
0K
0%
/etc/mnttab
swap
2.5G
1.6M
2.5G
1%
/etc/svc/volatile
objfs
0K
0K
0K
0%
/system/object
sharefs
0K
0K
0K
0%
/etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
9.8G
4.5G
5.2G
47%
/platform/sun4uus3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
9.8G
4.5G
5.2G
47%
/platform/sun4uus3/lib/sparcv9/libc_psr.so.1
fd
0K
0K
0K
0%
/dev/fd
swap
2.5G
80K
2.5G
1%
/tmp
swap
2.5G
48K
2.5G
1%
/var/run
/dev/dsk/c0t0d0s3
3.9G
4.0M
3.9G
1%
/myzone
/dev/dsk/c0t0d0s7
9.8G
10M
9.7G
1%
/export/home
# format
Searching for disks...done
THESE5-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6 unassigned
7
home
Flag
wm
wu
wm
wm
wm
wm
wm
wm
Cylinders
52319 - 57458
0 - 1027
0 - 57458
45123 - 47178
45115 - 45122
45107 - 45114
0
47179 - 52318
Size
10.00GB
2.00GB
111.79GB
4.00GB
15.94MB
15.94MB
0
10.00GB
Blocks
(5140/0/0)
20971200
(1028/0/0)
4194240
(57459/0/0) 234432720
(2056/0/0)
8388480
(8/0/0)
32640
(8/0/0)
32640
(0/0/0)
0
(5140/0/0)
20971200
partition> q
(output omitted)
format> q
#
3.
Use the format utility to partition your spare disk so that it includes
the partitions listed:
Set the size of slice 0 to be equal to or greater than the disk slice
used for the root (/) file system. This slice is a candidate to
become the secondary submirror.
Set the size of slice 1 to be equal to or greater than the disk slice
used for the root (/) file system. This slice is a candidate to
become the secondary submirror.
# format
Searching for disks...done
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6 unassigned
7 unassigned
Flag
wm
wu
wu
wm
wm
wm
wm
wm
Cylinders
0 - 5654
5655 - 11309
0 - 38306
0
0
0
11310 - 11318
11319 - 11327
Size
11.00GB
11.00GB
74.53GB
0
0
0
17.93MB
17.93MB
Blocks
(5655/0/0)
23072400
(5655/0/0)
23072400
(38307/0/0) 156292560
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(9/0/0)
36720
(9/0/0)
36720
partition> q
(output omitted)
format> q
4.
#
#
#
#
#
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
-a
-a
-a
-a
-f c0t0d0s4
c0t0d0s5
c0t1d0s6
c0t1d0s7
THESE5-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
(output omitted)
format> partition
(output omitted)
partition> print
Current partition table (original):
Total disk cylinders available: 38307 + 2 (reserved cylinders)
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
6.
Create a RAID-0 volume to use as the root (/) file systems primary
submirror.
Create a RAID 0 volume on the secondary drive to use as the root (/)
file systems secondary submirror.
You should refer to step 2 to determine which of the following
conditions is true.
a.
If the root slice on your boot disk starts on cylinder 0, use slice 0
on the second disk as the secondary submirror.
If the root slice on your boot disk does not start on cylinder 0, use
slice 1 on the second disk as the secondary submirror.
Create a RAID-1 volume as a one-way mirror using the root (/) file
system primary submirror as the source of the mirrors data.
# cat /etc/vfstab
(output omitted)
fd
/dev/fd fd
no
/proc
/proc
proc
no
/dev/dsk/c0t0d0s1
swap
/dev/dsk/c0t0d0s0
/dev/rdsk/c0t0d0s0
/
(output omitted)
# cat /etc/system
(output omitted - the file contains only comments)
# /usr/sbin/metaroot d10
# cat /etc/vfstab
(output omitted)
no
ufs
no
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
no
no
swap
/
ufs
no
1
no
THESE5-46
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
fd
/dev/fd fd
/proc
/proc
proc
/dev/dsk/c0t0d0s1
/dev/md/dsk/d10 /dev/md/rdsk/d10
(output omitted)
# cat /etc/system
(output omitted)
* Begin MDD root info (do not edit)
rootdev:/pseudo/md@0:0,10,blk
* End MDD root info (do not edit)
#
ok show-disks
a) /ramdisk-root
b) /pci@1e,600000/ide@d/cdrom
c) /pci@1e,600000/ide@d/disk
q) NO SELECTION
Enter Selection, q to quit: c
/pci@1e,600000/ide@d/disk has been selected.
Type ^Y (Control-Y) to insert it in the command line.
e.g. ok nvalias mydev ^Y
for creating devalias mydev for /pci@1e,600000/ide@d/disk
ok
14. Define a backup root (/) device alias.
This varies by system. Use the nvalias command. For example:
ok nvalias backup_root /pci@1e,600000/ide@d/disk@1,0:b
15. Add the backup_root device alias to the boot-device variable.
You should retain the alias for the primary boot disk.
This varies by system. Use a combination of the printenv and setenv
commands.
ok printenv boot-device
boot-device = disk net
ok setenv boot-device disk backup_root
boot-device = disk backup_root
16. Test the ability to boot the secondary root (/) submirror and log in as
root when the boot process completes.
ok boot backup_root
17. Verify the status of the root (/) submirrors.
# /usr/sbin/metastat d10
d10: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d12
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 20971200 blocks (10.0 GB)
d11: Submirror of d10
State: Okay
Size: 20971200 blocks (10.0 GB)
Stripe 0:
Device
Start Block Dbase
c0t0d0s0
0
No
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
Exercise Solutions: Mirroring the root (/) File System on SPARC-Based Systems
18. Detach one submirror to make the root (/) mirror a one-way mirror.
# /usr/sbin/metadetach d10 d12
d10: submirror d12 is detached
19. Update the /etc/vfstab file to redefine the root (/) mount point
using the original disk slice, and the /etc/system file to remove the
forceload statements.
# /usr/sbin/metaroot /dev/dsk/c0t0d0s0
20. Shut down the system to the OBP level.
# init 0
21. If you changed your boot-device variable to an alternate boot path,
complete the following steps:
a.
b.
ok set-default boot-device
ok boot
22. Clear the mirror and submirrors.
# /usr/sbin/metaclear -r d10
d10: Mirror is cleared
d11: Concat/Stripe is cleared
# /usr/sbin/metaclear d12
d12: Concat/Stripe is cleared
#
23. Remove all state database replicas.
#
#
#
#
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
-d
-d
-d
-d
c0t0d0s4
c0t0d0s5
c0t1d0s6
-f c0t1d0s7
THESE5-48
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
This exercise only runs on x86-based systems. If you are using a SPARCbased system, perform the tasks in Exercise: Mirroring the root (/) File
System on SPARC-Based Systems on page 5-36.
This exercise assumes students know how to use the format utility to
create fdisk partitions, and disk slices, if required.
The spare disk must have these structures defined:
One Solaris fdisk partition that uses the entire spare disk.
One slice that is equal to or larger than the root (/) slice of the
system disk.
Table 5-4 defines sizes for using slice 0 or 1 for the root mirror, and slices 3
and 4 to hold state database replicas.
Table 5-4 Slice Information
Slice
Size
Use
10240 Mbytes
10240 Mbytes
16 Mbytes
16 Mbytes
10240 Mbytes
(or remainder
of disk)
Unassigned
Slice
Size
Use
0 Mbytes
Unassigned
0 Mbytes
Unassigned
Tasks
Complete the following steps:
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
Record the name of the spare disk that you will use to mirror
the root file system.
_______________________________________________________
What is the size in megabytes of the slice used for the root (/)
file system? This will become the primary submirror:
_______________________________________________________
Which two slices on the boot disk use less than 16 Mbytes of
space?
_______________________________________________________
4.
In the format utility, select the spare disk, and enter the fdisk
menu.
b.
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
THESE5-50
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Partition
=========
1
Status
======
Type
============
Solaris
Cylinders
Start
End
Length
=====
===
======
1 9728
9728
%
===
100
d.
If disk slices on the spare disk are not correctly defined, use the
partition menu in the format utility to create slices within
the Solaris fdisk partition. Use the information in Table 5-5 to
determine the correct slice sizes.
e.
If you have defined new slices on the spare disk, write the
partition table to disk, and quit the format utility.
5.
6.
c.
7.
8.
Create a RAID-0 volume to use as the root (/) file systems primary
submirror.
9.
Create a RAID-0 volume to use as the root (/) file systems secondary
submirror.
10. Create a RAID-1 volume as a one-way mirror using the root (/) file
system primary submirror as the source of the mirrors data.
11. Use the metaroot command to update the /etc/vfstab file to use
the RAID-1 volume as the mount point for the root (/) file system.
Observe the changes to the /etc/vfstab and the /etc/system files.
12. Reboot the system, and then log in as root.
13. Attach the RAID-0 volume used as the root (/) file systems
secondary submirror to the RAID-1 volume, and allow the mirror
synchronization to complete before continuing.
What is the primary reason for using the command line to attach a
secondary submirror to a mirror?
____________________________________________________________
Note To view the status of the resynchronization process, use the
/usr/sbin/metastat | grep Resync command.
14. Use the metastat command to display the status of the root (/)
submirrors. Verify that the state of each submirror is listed as Okay.
15. Detach the secondary submirror to make the root (/) mirror a oneway mirror.
THESE5-52
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
_______________________________________________________
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE5-54
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
Preparation
This exercise only runs on x86-based systems. If you are using a SPARCbased system, perform the tasks in Exercise: Mirroring the root (/) File
System on SPARC-Based Systems on page 5-36.
This exercise assumes students know how to use the format utility to
create fdisk partitions, and disk slices, if required.
The spare disk must have these structures defined:
One Solaris fdisk partition that uses the entire spare disk.
One slice that is equal to or larger than the root (/) slice of the
system disk.
Table 5-5 defines sizes for using slice 0 or 1 for the root mirror, and slices 3
and 4 to hold state database replicas.
Table 5-5 Slice Information
Slice
Size
Use
10240 Mbytes
10240 Mbytes
16 Mbytes
16 Mbytes
10240 Mbytes
(or remainder
of disk)
Unassigned
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
Slice
Size
Use
0 Mbytes
Unassigned
0 Mbytes
Unassigned
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
# df -h
Filesystem
size
used
/dev/dsk/c0d1s0
9.9G
4.3G
/devices
0K
0K
ctfs
0K
0K
proc
0K
0K
mnttab
0K
0K
swap
4.2G
968K
objfs
0K
0K
sharefs
0K
0K
/usr/lib/libc/libc_hwcap1.so.1
9.9G
4.3G
fd
0K
0K
swap
4.2G
80K
swap
4.2G
28K
/dev/dsk/c0d1s3
3.9G
4.0M
/dev/dsk/c0d1s7
3.9G
4.0M
3.
avail capacity
5.5G
44%
0K
0%
0K
0%
0K
0%
0K
0%
4.2G
1%
0K
0%
0K
0%
5.5G
0K
4.2G
4.2G
3.9G
3.9G
44%
0%
1%
1%
1%
1%
Mounted on
/
/devices
/system/contract
/proc
/etc/mnttab
/etc/svc/volatile
/system/object
/etc/dfs/sharetab
/lib/libc.so.1
/dev/fd
/tmp
/var/run
/myzone
/export/home
Record the name of the spare disk that you will use to mirror
the root file system.
According to the format command output, two disks exist in the
system, c0d1 and c1d0 in this example. The df -h command
output indicates the system currently has no file systems mounted
from c1d0, so c1d0 is the spare disk.
THESE5-56
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
What is the size in megabytes of the slice used for the root (/)
file system? This will become the primary submirror:
As pre-defined for your lab system. (Slice 0 and 10.00 Gbytes, in this
example.)
Slices 4 and 5. These are the slices reserved for state database replicas
on the boot disk.
# format
Searching for disks...done
Flag
wm
wu
wm
wm
wm
wm
wm
wm
wu
wu
Cylinders
8420 - 9725
3 - 263
0 - 9725
6591 - 7113
6589 - 6590
6587 - 6588
0
7114 - 8419
0 0
1 2
Size
10.00GB
2.00GB
74.50GB
4.01GB
15.69MB
15.69MB
0
10.00GB
7.84MB
15.69MB
Blocks
(1306/0/0) 20980890
(261/0/0)
4192965
(9726/0/0) 156248190
(523/0/0)
8401995
(2/0/0)
32130
(2/0/0)
32130
(0/0/0)
0
(1306/0/0) 20980890
(1/0/0)
16065
(2/0/0)
32130
partition> q
(output omitted)
format>
4.
In the format utility, select the spare disk, and enter the fdisk
menu.
format> disk
Which two slices on the boot disk use less than 16 Mbytes of
space?
b.
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> fdisk
c.
Partition
=========
1
Status
======
Type
============
Solaris
Cylinders
Start
End
Length
=====
===
======
1 9728
9728
%
===
100
THESE5-58
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
Enter Selection:
Part
Tag
0 unassigned
1 unassigned
2
backup
3 unassigned
4 unassigned
5 unassigned
6 unassigned
7 unassigned
8
boot
9 alternates
Flag
wm
wm
wu
wm
wm
wu
wu
wu
wu
wm
Cylinders
3 - 1308
1309 - 2614
0 - 9725
2615 - 2617
2618 - 2620
2621 - 3926
0
0
0 0
1 2
e.
5.
If disk slices on the spare disk are not correctly defined, use the
partition menu in the format utility to create slices within
the Solaris fdisk partition. Use the information in Table 5-5 to
determine the correct slice sizes. When complete, the correct list
of slices looks like this example from an Ultra 20:
Size
10.00GB
10.00GB
74.50GB
23.53MB
23.53MB
10.00GB
0
0
7.84MB
15.69MB
Blocks
(1306/0/0) 20980890
(1306/0/0) 20980890
(9726/0/0) 156248190
(3/0/0)
48195
(3/0/0)
48195
(1306/0/0) 20980890
(0/0/0)
0
(0/0/0)
0
(1/0/0)
16065
(2/0/0)
32130
If you have defined new slices on the spare disk, write the
partition table to disk, and quit the format utility.
7.
# /usr/sbin/metadb -a -f c0d1s4
# /usr/sbin/metadb -a c0d1s5
# /usr/sbin/metadb -a c1d0s3
d.
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
# /usr/sbin/metadb -a c1d0s4
What is the minimum number of state database replicas necessary to
support the majority consensus algorithm?
As a best practice, you should use three state database replicas as the
minimum to support the majority consensus algorithm.
Create a RAID-0 volume to use as the root (/) file systems primary
submirror.
Create a RAID-0 volume to use as the root (/) file systems secondary
submirror.
no
no
/
no
no
-
FS
fsck
mount
type
pass
at boot
no
ufs
no
FS
fsck
mount
type
pass
at boot
no
THESE5-60
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
8.
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
/
ufs
no
/dev/md/dsk/d10 /dev/md/rdsk/d10
(output omitted)
# cat /etc/system
(output omitted)
* Begin MDD root info (do not edit)
rootdev:/pseudo/md@0:0,10,blk
* End MDD root info (do not edit)
#
Exercise Solutions: Mirroring the root (/) File System on x86/x64-Based Systems
15. Detach the secondary submirror to make the root (/) mirror a oneway mirror.
# /usr/sbin/metadetach d10 d12
16. Use the metaroot command to redefine the root (/) device in the
/etc/vfstab file so it uses the original disk slice, and to remove the
forceload statements from the /etc/system file.
# /usr/sbin/metaroot /dev/dsk/c0d1s0
17. Reboot the system.
# init 6
18. Use the metaclear command to remove the mirror and submirrors,
and use metastat to verify that they no longer exist.
# /usr/sbin/metaclear -r d10
d10: Mirror is cleared
d11: Concat/Stripe is cleared
# /usr/sbin/metaclear d12
d12: Concat/Stripe is cleared
# metastat
#
19. Remove all state database replicas.
#
#
#
#
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
/usr/sbin/metadb
-d
-d
-d
-d
c0d1s4
c0d1s5
c1d0s3
-f c1d0s4
THESE5-62
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
State: Okay
Size: 20980890 blocks (10 GB)
Stripe 0:
Device
Start Block Dbase
c1d0s0
0
No
Objectives
Manage RBAC
Module 6
THESE6-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Figure 6-1
Role
Operator
right
Note You can also set up the root user as a role through a manual
process. This approach prevents users from logging in directly as the root
user. Therefore, they must log in as themselves first, and then use the su
command to assume the role.
Roles
right
Rights Profile
right
User
John
Figure 6-2
right
Rights Profile
Many examples of rights profiles are shipped with the Solaris 10 OS. The
rights profile names and descriptions are defined in the
/etc/security/prof_attr file. New rights profiles can be created by
editing this file or using the Solaris Management Console (SMC). This
example shows a few lines from that file.
# cat /etc/security/prof_attr
(output omitted)
All:::Execute any command as the user or role:help=RtAll.html
Log Management:::Manage log files:help=RtLogMngmnt.html
Media Backup:::Backup files and file systems:help=RtMediaBkup.html
Media Restore:::Restore files and file systems from
backups:help=RtMediaRestore.html
(output omitted)
Each line starts with the rights profile name. The middle fields are not
used and the last two fields are a comment and a pointer to a help file.
Help files are written in Hypertext Markup Language (HTML) and they
can be customized if required. These HTML help files exist in the
/usr/lib/help/auths/locale/C directory.
THESE6-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
right
Every account has the All rights profile. It allows any command to be
executed but with special security attributes. Other rights profiles given to
all new user accounts are defined in the /etc/security/policy.conf
file. The Basic Solaris User rights profile is listed in this file:
# grep 'PROFS' /etc/security/policy.conf
PROFS_GRANTED=Basic Solaris User
Rights profiles can be assigned to a user account with the usermod
command or the Solaris Management Console (SMC). This example
shows the Printer Management rights profile being assigned to the
chris user account:
# usermod -P "Printer Management" chris
# profiles chris
Printer Management
Basic Solaris User
All
This automatically updates the /etc/user_attr file as shown below:
# grep chris /etc/user_attr
chris::::type=normal;profiles=Printer Management
The new line for the user chris shows the new profile assignment. The
file uses colons (:) to separate the fields on each line. The first field is the
user name as it appears in the /etc/passwd and /etc/shadow files.
The middle fields are reserved for future use, and the last field is a list of
semicolon-separated (;) key-value pairs that describe the security
attributes to be applied when the user runs commands.
# profiles chris
Basic Solaris User
All
Printer Management:
/etc/init.d/lp
euid=0, uid=0
/usr/bin/cancel
euid=lp, uid=lp
/usr/bin/lpset
egid=14
/usr/bin/lpstat
euid=0
/usr/lib/lp/local/accept
uid=lp
/usr/lib/lp/local/lpadmin
uid=lp, gid=8
/usr/lib/lp/lpsched
uid=0
/usr/sbin/accept
euid=lp, uid=lp
/usr/sbin/lpadmin
egid=14, uid=lp, gid=8
/usr/sbin/lpfilter
euid=lp, uid=lp
/usr/sbin/lpforms
euid=lp
/usr/sbin/lpmove
euid=lp
/usr/sbin/lpshut
euid=lp
/usr/sbin/lpusers
euid=lp
/usr/ucb/lpq
euid=0
/usr/ucb/lprm
euid=0
All:
*
The individual commands in the rights profile can be seen, along with the
special security attributes with which they are executed.
This example shows the user chris being able to enable and disable a
printer.
THESE6-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# profiles -l chris
Figure 6-3 shows the assignment of rights profiles to a role called level1
and giving the john user account access to the role:
Rights Profile
right
right
Rights Profile
right
User
John
Figure 6-3
Role
level 1
right
Creating a Role
The roleadd command creates a role entry in the /etc/passwd,
/etc/shadow, and /etc/user_attr files. Some common options include:
-c comment
-d dir
-m
-P profile
THESE6-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
In this example, the roleadd command creates a new role called level1,
builds the home directory, and assigns the role with rights profiles of
Printer Management, Media Backup, and Media Restore. The role can
not be used until a password is applied to it.
Note The installation of the Solaris 10 OS has the Printer Management,
Media Backup, and Media Restore rights profiles already defined in the
/etc/security/exec_attr file and the /etc/security/prof_attr file.
The changes to the /etc/passwd, /etc/shadow, and
/etc/user_attr files are shown below:
# grep level1 /etc/passwd
level1:x:102:1:Level One Support:/export/home/level1:/bin/pfsh
# grep level1 /etc/shadow
level1:CUs8aQ64vTrZ.:12713::::::
# grep level1 /etc/user_attr
level1::::type=role;profiles=Printer Management,Media Backup,Media
Restore
The type of this account is role (type=role) and includes the rights
profiles Printer Management, Media Backup, and Media Restore.
Modifying a Role
-e expire
-l new_logname
-P profile
-s shell
THESE6-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
A user can have access to many roles. The useradd command or Solaris
Management Console (SMC) can be used to define which roles a new user
has access to. The example shows the useradd command being used
with the -R option to define roles:
Using Roles
As it is not possible to log in to a role account, log in as a regular user
first. The roles command shows the roles available to your account.
THESE6-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
$ id
uid=103(paul) gid=1(other)
$ roles
level1
Authorizations
Authorizations
Action
solaris.admin.usermgr.read
solaris.admin.usermgr.read
Provides read and write access to
solaris.admin.usermgr.write user configuration files. Cannot
change passwords.
solaris.admin.usermgr.read
Provides read, write, and password
solaris.admin.usermgr.write access to user configuration files.
solaris.admin.usermgr.pswd
Caution An authorization that ends with the suffix grant permits a user
to delegate any assigned authorizations that begin with the same prefix to
other users.
Authorizations
For example, a role with the authorizations:
solaris.admin.usermgr.grant
solaris.admin.usermgr.read
Can delegate the solaris.admin.usermgr.read authorization to
another user.
solaris.admin.usermgr.grant
solaris.admin.usermgr.*
Can delegate any of the authorizations with the solaris.admin.usermgr
prefix to other users.
Default Authorizations
All users have the Basic Solaris User profile by default.
# profiles chris
Printer Management
Basic Solaris User
All
The Basic Solaris User profile grants users access to all listed
authorizations. The profiles=All field grants unrestricted access to all
Solaris OS commands that have not been restricted by a definition in a
previously listed authorization.
# grep Basic Solaris User /etc/security/prof_attr
Basic Solaris User:::Automatically assigned rights:
auths=solaris.profmgr.read,solaris.jobs.users,solaris.mail.
mailq,
solaris.admin.usermgr.read,solaris.admin.logsvc.read,
solaris.admin.fsmgr.read,solaris.admin.serialmgr.read,
solaris.admin.diskmgr.read,solaris.admin.procmgr.user,
solaris.compsys.read,solaris.admin.printer.read,
solaris.admin.prodreg.read,solaris.admin.dcmgr.read,
solaris.snmp.read,solaris.project.read,solaris.admin.patchm
gr.read,
solaris.network.hosts.read,solaris.admin.volmgr.read;profil
es=All; help=RtDefault.html
THESE6-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Authorizations
Other default authorizations for every user can be defined in the
/etc/security/policy.conf file:
# grep 'AUTHS' /etc/security/policy.conf
AUTHS_GRANTED=solaris.device.cdrw
Authorizations
Assigning Authorizations
Authorizations can be assigned to user accounts. Authorizations can also
be assigned to roles or embedded in a rights profile which can be assigned
to a user or role.
Authorization
User
John
Authorization
User
John
Role
Operator
Rights Profile
Authorization
User
John
Rights Profile
Authorization
User
John
Figure 6-4
Role
Operator
THESE6-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Authorizations
# su - chris
Sun Microsystems Inc.
SunOS 5.10
s10_68 Sep. 20, 2004
$ crontab -l root
crontab: you must be super-user to access another user's crontab file
$ exit
The authorization to manage other users crontab file can be granted to
the user from the command line. This example shows the usermod
command being used with the -A option to add an authorization:
# usermod -A solaris.jobs.admin chris
The /etc/user_attr user attributes file has been automatically
modified with this new information.
# grep chris /etc/user_attr
chris::::type=normal;auths=solaris.jobs.admin;profiles=Printer Management
The chris account, is a normal user account (type=normal), he has had
the solaris.jobs.admin authorization and the Printer
Management rights profile added previously. Use the auths command to
see the authorizations assigned to a user:
# auths chris
solaris.admin.printer.read,solaris.admin.printer.modify,solaris.admin.pri
nter.delete,solaris.device.cdrw,solaris.profmgr.read,solaris.jobs.users,s
olaris.mail.mailq,solaris.admin.usermgr.read,solaris.admin.logsvc.read,so
laris.admin.fsmgr.read,solaris.admin.serialmgr.read,solaris.admin.diskmgr
.read,solaris.admin.procmgr.user,solaris.compsys.read,solaris.admin.prodr
eg.read,solaris.admin.dcmgr.read,solaris.snmp.read,solaris.project.read,s
olaris.admin.patchmgr.read,solaris.network.hosts.read,solaris.admin.volmg
r.read
The following example shows that a regular user is not permitted to look
at another users crontab file:
Authorizations
# su - chris
Sun Microsystems Inc.
SunOS 5.10
s10_68 Sep. 20, 2004
$ crontab -l root
#ident "@(#)root
1.21
04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
(output omitted)
$ exit
# profiles level2
Mail Management
Basic Solaris User
All
# auths level2
solaris.admin.usermgr.*
(output omitted)
THESE6-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
With this authorization, he can view or modify other users crontab files:
Authorizations
By changing the root user into a role, you prevent anonymous root logins. Because a user must log in and then assume the root role, the users
login ID is provided to the auditing service and is in the sulog file.
Note For safety, at least one local user should be assigned the root role.
You cannot perform this procedure when you are directly logged in as
root. You must log in as yourself, then su to root.
-u uid
-d homedir
username
Verify that root is a role. The root entry in the user_attr file should
be similar to following:
THESE6-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can change root from a login user to a role. When you complete this
procedure, you can no longer directly log in to the system as root, except
in single-user mode. You must be assigned the root role and su to root.
Caution If you do not assign the root role to a user, no one can become
superuser, except in single-user mode. You must type a root password to
enter single-user mode.
(Optional) Assign the root role to selected user accounts in the name
service.
Create a role that has the capabilities of root and assign the role to a
valid user. A role that is assigned the Primary Administrator profile
is equivalent to the root role.
Authorization
user_attr
Users
Roles
Figure 6-5
prof_attr
exec_attr
Profiles
Privileges
RBAC Files
auth_attr
Authorization
user_attr
Users
Roles
Figure 6-6
prof_attr
exec_attr
Profiles
Privileges
THESE6-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
auth_attr
Figure 6-7
auth_attr
Authorization
user_attr
Users
Roles
Figure 6-8
prof_attr
exec_attr
Profiles
Privileges
database:
!
Figure 6-9 User and Profile Association
THESE6-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
database:
From the
!
!
"
#$
Figure 6-10 Profile and Authorization Association
auth_attr
Authorization
user_attr
Users
Roles
prof_attr
exec_attr
Profiles
Privileges
From the
database:
From the
THESE6-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
auth_attr
Users
Roles
prof_attr
exec_attr
Profiles
Privileges
Authorization
user_attr
database:
Figure 6-14 User, Role, and Authorization Association
Figure 6-15 shows how the fields of the four files are related.
!
!
!
!
!
&
&
'(
(
&
(
&
(
THESE6-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
From the
Some steps in this exercise direct you to execute commands that do not
work in order to demonstrate how RBAC must be used by logged in
users.
Verify that the /export/home directory exists, and is writable by all users.
If this directory does not exist, create it, and change its permission mode
to 777.
Review how to use the auths, profiles, and roles RBAC commands to
determine user privileges.
Tasks
The following section describes the tasks you must perform.
Complete the following steps:
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
4.
5.
6.
Create a user named user9 and assign it access to the sdown role.
Give this user a user ID of 4009 and a group ID of 10.
7.
8.
Preparation
10. As user9, without assuming the new role, attempt to shut down the
system.
What is the result of this shutdown attempt, and why?
____________________________________________________________
11. Execute the profiles command to determine which RBAC profiles
are associated with user9.
12. Execute the roles command to determine which RBAC roles are
associated with user9.
13. Assume the role sdown.
14. Shut down the system by using the init command.
What is the result of this shutdown attempt, and why?
____________________________________________________________
____________________________________________________________
15. List the commands that the sdown profile can execute.
16. Shut down the system using the shutdown command.
Note Avoid shutting down the system by responding n to the prompt
that the shutdown command presents.
What is the result of this shutdown attempt, and why?
____________________________________________________________
____________________________________________________________
17. Exit the sdown role.
18. Exit the shell for user9.
THESE6-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
____________________________________________________________
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
!
?
Some steps in this exercise direct you to execute commands that do not
work in order to demonstrate how RBAC must be used by logged in
users.
Verify that the /export/home directory exists, and is writable by all users.
If this directory does not exist, create it, and change its permission mode
to 777.
Review how to use the auths, profiles, and roles RBAC commands to
determine user privileges.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
# vi /etc/security/prof_attr
(output omitted)
Shut:::Able to shutdown the system:
4.
THESE6-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
# more /etc/user_attr
(output omitted)
sdown::::type=role;profiles=Shut
Create a user named user9 and assign it access to the sdown role.
Give this user a user ID of 4009 and a group ID of 10.
# vi /etc/security/exec_attr
Shut:suser:cmd:::/usr/sbin/shutdown:uid=0
9.
# su - user9
10. As user9, without assuming the new role, attempt to shut down the
system.
$ /usr/sbin/shutdown -i 6 -g 0
/usr/sbin/shutdown: Only root can run /usr/sbin/shutdown
What is the result of this shutdown attempt, and why?
This shutdown attempt fails because user9 has not assumed the sdown
role yet, and as a regular user, does not have the rights profile to execute the
shutdown command.
11. Execute the profiles command to determine which RBAC profiles
are associated with user9.
$ profiles
Basic Solaris User
All
12. Execute the roles command to determine which RBAC roles are
associated with user9.
$ roles
sdown
13. Assume the role sdown.
6.
uid=0
THESE6-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Module 7
The syslog function sends messages generated by the kernel and system
utilities and applications to the syslogd daemon, as shown in the
Figure 7-1. With the syslog function you can control message logging,
depending on the configuration of the /etc/syslog.conf file. The
daemon can:
Destination
Daemon
Log File
kernel
User Processes
syslogd
daemon
logger Command
Console
User
Central Log Host
m4 reads /etc/syslog.conf
Figure 7-1
THESE7-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The selector field has two components, a facility and a level written
as facility.level. Facilities represent categories of system processes
that can generate messages. Levels represent the severity or importance of
the message.
The action field determines where to send the message.
For example, when you place the following entry in the
/etc/syslog.conf file, error messages for all facilities are sent to the
/var/adm/messages file:
*.err
/var/adm/messages
where:
*.err
/var/adm/messages
Selector Field
The selector field is a semicolon-separated list of priority specifications in
the following format:
facility.level;facility.level
Table 7-1
Field
Description
kern
user
daemon
auth
syslog
lpr
news
uucp
cron
local0-7
mark
THESE7-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
In the selector field syntax, facility is a system facility. Table 7-1 shows
values that the selector field (facility) can contain.
Note You can use the asterisk (*) to select all facilities (for example
*.err); however, you cannot use * to select all levels of a facility (for
example, kern.*)
Priority
Description
emerg
alert
crit
err
warning
Warning messages
notice
info
Informational messages
debug
none
Note Not all levels of severity are implemented for all facilities in the
same way. For more information, refer to the online manual pages.
Action Field
/pathname
@host
user1, user2
Note You must manually create the /pathname full path and file name if
it does not already exist.
THESE7-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The action field defines where to forward the message. This field can have
any one of the following entries:
#ident "@(#)syslog.conf
1.5
98/12/14 SMI"
/* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# The syslog configuration file.
#
# This file is processed by m4 so be careful to quote (" ") names
# that match m4 reserved words. Also, within ifdefs, arguments
# containing commas must be quoted.
#
*.err;kern.notice;auth.notice
/dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit
/var/adm/messages
*.alert;kern.err;daemon.err
*.alert
operator
root
*.emerg
ifdef(LOGHOST,/var/log/syslog, @loghost)
#
# Non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(LOGHOST,,
user.err
/dev/sysmsg
user.err
/var/adm/messages
user.alert
root, operator
user.emerg
*
)
2.
3.
syslog.conf
m4
Selector
Field
Action
Field
syslogd
Figure 7-2
THESE7-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Process
1.
2.
3.
Operation Phase 1
In the following examples, the syslogd daemon is running on the host1
system. This section contains two examples of the host1 systems
/etc/hosts file.
These /etc/hosts file examples are excerpts of the /etc/hosts/ file.
Example A /etc/hosts:
192.9.200.1 host1 loghost
192.9.200.2 host2
Example B /etc/hosts:
192.9.200.1 host1
192.9.200.2 host2 loghost
When the syslogd daemon starts at system boot, the syslogd daemon
evaluates the /etc/hosts file, and checks the Internet Protocol (IP)
address associated with the hostname as compared to the IP address
associated with loghost.
In Example A, host1 and loghost are both associated with IP address
192.9.200.1. Therefore, the syslogd daemon runs the first command
line: /usr/ccs/bin/m4 -D LOGHOST, causing the m4 LOGHOST variable to
be defined as TRUE during the parsing of the /etc/syslog.conf file.
The syslogd daemon does not read the /etc/syslog.conf file directly.
The syslogd daemon obtains its information as follows:
For example:
mail.debug
mail.debug
/var/log/syslog
If the LOGHOST variable was evaluated as FALSE in phase 1, then the m4
processor returns:
mail.debug
@loghost
In either case, the output has an entry in the selector field and an entry in
the action field. The m4 processor then passes the output to the syslogd
daemon.
THESE7-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Operation Phase 2
Operation Phase 3
For each line parsed in the /etc/syslog.conf file from phase 2, the m4
processor produces output in a two-column field: a selector field and an
action field. The output is sent to the syslogd daemon, which uses the
information to route messages to their appropriate destinations. After the
information is configured, the syslogd daemon continues to run with this
configuration.
*.err;kern.notice;auth.notice
*.err;kern.debug;daemon.notice;mail.crit
*.alert;kern.err;daemon.err
*.alert
*.emerg
/dev/sysmsg
/var/adm/messages
operator
root
*
THESE7-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Message Routing
The inetd daemon is the network listener process for many network
services. The inetd daemon listens for service requests on the TCP and
User Datagram Protocol (UDP) ports associated with each of the services
listed in the inetd configuration file. When a request arrives, the inetd
daemon executes the server program associated with the service. You can
modify the behavior of the inetd daemon to log TCP connections by
using the syslogd daemon.
# inetadm -p
NAME=VALUE
bind_addr=""
bind_fail_max=-1
bind_fail_interval=-1
max_con_rate=-1
max_copies=-1
con_rate_offline=-1
failrate_cnt=40
failrate_interval=60
inherit_env=TRUE
tcp_trace=FALSE
tcp_wrappers=FALSE
Tracing for all services is enabled using the following command:
# inetadm -M tcp_trace=TRUE
# inetadm -p
NAME=VALUE
bind_addr=""
bind_fail_max=-1
bind_fail_interval=-1
max_con_rate=-1
max_copies=-1
con_rate_offline=-1
failrate_cnt=40
failrate_interval=60
inherit_env=TRUE
THESE7-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can enable the trace option for each inetd-managed service to send
messages to the syslogd daemon. Use the inetadm command to modify
the settings of the service to enable TCP tracing. When you enable the
trace option, it uses the daemon.notice to log the clients IP address and
TCP port number, and the name of the service. To enable tracing TCP
connections automatically, each service may have its trace capability
enabled separately.
For example, to allow tracing of telnet sessions, the following command
is issued:
# inetadm -m telnet tcp_trace=TRUE
# inetadm -l telnet
SCOPE
NAME=VALUE
name="telnet"
endpoint_type="stream"
proto="tcp6"
isrpc=FALSE
wait=FALSE
exec="/usr/sbin/in.telnetd"
user="root"
default bind_addr=""
default bind_fail_max=-1
default bind_fail_interval=-1
default max_con_rate=-1
default max_copies=-1
default con_rate_offline=-1
default failrate_cnt=40
default failrate_interval=60
default inherit_env=TRUE
tcp_trace=TRUE
default tcp_wrappers=FALSEgrep inetd /etc/init.d/inetsvc
Note The Internet daemon inetd provides services for many network
protocols, including the Telnet and File Transfer Protocol (FTP) protocols.
/var/adm/messages
Note The /var/adm/messages file must exist. If it does not exist, create
it, and then stop and start the syslogd daemon, or messages will not be
written to the file.
7
Figure 7-3
8
The syslogd Daemon Logged Entry
THESE7-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Number
Field
Result
Date/time
Jun 14 13:15:39
host1
Process name/PID
number
inetd[2359]
MsgID number/
selector
facility.level
Incoming request
telnet
PPID number
[2361]
IP address
192.9.200.1
Port number
45800
-f file
-p priority
-t tag
Marks each line added to the log file with the specified
tag
message
THESE7-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
This exercise requires installed manual (man) pages and two systems that
list each other in the /etc/hosts file. Verify that the CONSOLE variable is
commented out in the /etc/default/login file on both systems. Except
as noted otherwise, perform all steps on both systems. Refer to the lecture
notes as necessary to perform the steps listed.
Tasks
Complete the following tasks.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
Display the man page for the inetd process, and verify the
facility and level used by the inetd process when you run the
process with the -tcptrace option.
Which facility and level pair is the inetd daemon using?
____________________________________________________________
THESE7-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
In this lab, you use the syslog function to log messages locally and
remotely.
5.
Open a new terminal window, and use the tail command to view
new entries as they are recorded in the /var/adm/messages file.
6.
7.
Observe the window in which you are running the tail command.
Do any new telnet-related messages appear in the
/var/adm/messages file (yes or no)?
____________________________________________________________
8.
Modify the inetd service, and change the default value of the
tcp_trace option to TRUE:
9.
Verify that the inetd daemon is running with the tracing option
enabled.
3.
4.
____________________________________________________________
7.
Run the logger command from step 5 three times. Examine the
output from the tail command in the other window. How many
new messages appear in the /var/log/local0.log file?
____________________________________________________________
____________________________________________________________
8.
Run the logger command with the crit level message instead of
the notice level message.
Which new messages appear in the /var/log/local0.log file?
____________________________________________________________
____________________________________________________________
9.
THESE7-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
6.
1.
local0.notice<TAB>@system2
2.
3.
Note If you did not already edit the /etc/syslog.conf file on the
system designated system2 from the previous task, do so now. The
/etc/syslog.conf file on system2 must direct local0.notice
messages to /var/log/local0.log. You must also refresh the
system/system-log service on system2.
4.
5.
6.
7.
Note These steps do not require you to change host names. In the
following steps, substitute the appropriate host name for system1 and
system2.
2.
3.
4.
6.
7.
8.
THESE7-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
____________________________________________________________
____________________________________________________________
____________________________________________________________
2.
3.
4.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE7-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Preparation
This exercise requires installed manual (man) pages and two systems that
list each other in the /etc/hosts file. Verify that the CONSOLE variable is
commented out in the /etc/default/login file on both systems. Except
as noted otherwise, perform all steps on both systems. Refer to the lecture
notes as necessary to perform the steps listed.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
1.
# cd /etc
# cp syslog.conf syslog.conf.bak
2.
Display the man page for the inetd process, and verify the
facility and level used by the inetd process when you run the
process with the -tcptrace option.
# man inetd
Which facility and level pair is the inetd daemon using?
daemon.notice
In this lab, you use the syslog function to log messages locally and
remotely.
4.
Open a new terminal window, and use the tail command to view
new entries as they are recorded in the /var/adm/messages file.
# tail -f /var/adm/messages
5.
# telnet host
Trying nnn.nnn.nnn.nnn...
Connected to host.
Escape character is '^]'.
login: root
Password:
(output omitted)
# exit
6.
Observe the window in which you are running the tail command.
Do any new telnet-related messages appear in the
/var/adm/messages file (yes or no)?
Before starting the inetd service with telnet tracing, no.
7.
Modify the inetd service, and change the default value of the
tcp_trace option to TRUE:
# inetadm -M tcp_trace=TRUE
THESE7-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# inetadm -p
NAME=VALUE
bind_addr=""
bind_fail_max=-1
bind_fail_interval=-1
max_con_rate=-1
max_copies=-1
con_rate_offline=-1
failrate_cnt=40
failrate_interval=60
inherit_env=TRUE
tcp_trace=TRUE
tcp_wrappers=FALSE
9.
# touch /var/log/local0.log
3.
# tail -f /var/log/local0.log
8.
Run the logger command from step 5 three times. Examine the
output from the tail command in the other window. How many
new messages appear in the /var/log/local0.log file?
One. The syslogd daemon will not report multiple instances of the same
message until a different message is logged, or the syslogd mark
interval is reached.
8.
Run the logger command with the crit level message instead of
the notice level message.
Which new messages appear in the /var/log/local0.log file?
A message indicating that the previous message was repeated a number of
times, and the new message, for example:
THESE7-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
local0.notice<TAB>@system2
2.
# touch /var/log/local0.log
Note If you did not already edit the /etc/syslog.conf file on the
system designated system2 from the previous task, do so now. The
/etc/syslog.conf file on system2 must direct local0.notice
messages to /var/log/local0.log. You must also refresh the
system/system-log service on system2.
4.
# tail -f /var/log/local0.log
5.
Note These steps do not require you to change host names. In the
following steps, substitute the appropriate host name for system1 and
system2.
3.
# tail -f /var/log/authlog
THESE7-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
auth.notice
# rlogin system2
Password: xxxxxx
...
# exit
# cd /etc/inet
# cp hosts hosts.bak
# vi hosts
8.
# rlogin system2
Password: xxxxxx
...
# exit
On system2, does a new message display in the window running
the tail command (yes or no)?
No.
On system1, which message is displayed in the window running the
tail command?
A message similar to the following displays:
Nov 06 09:34:46 system2 login: [ID 254462 auth.notice] ROOT LOGIN
/dev/pts/7 FROM system2
1.
2.
3.
4.
THESE7-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Module 8
Client
Database
5
4
/etc/nsswitch.conf
Local
File
/etc/hosts
Figure 8-1
THESE8-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The original text-file based UNIX name service was developed for
standalone UNIX systems and was then adapted for network use. While
UNIX operating systems still support and use this text-based name
service, it is not appropriate for large, complex networks. The name
service concept uses domains, which are defined as a collection of
network nodes.
1.
2.
The name service switch file instructs the client to first search the
local file for the information.
3.
When the information is not located in the local files, the clients
name service switch file redirects the search to a network name
server.
4.
The name server searches its database and locates the information.
5.
THESE8-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
edu
com
acme
aus
mil
sun
eng
uk
corp
solaris
solaris.corp.sun.com
Figure 8-2
Nameless root
hosts.byaddr
hosts.byname
Note You can obtain a list of the full set of maps from an NIS-configured
system by running the ypwhich -m command.
NIS uses domains to define who can access the host names, user
information, and other administrative data in its namespace. However,
NIS does not use a domain hierarchy to store its data; therefore, the NIS
namespace is flat.
THESE8-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Query DNS
Query DNS and then NIS, if the requests are not found by DNS
Query NIS and then DNS, if the requests are not found by NIS
You cannot look up addresses on the Internet by using just NIS. However,
organizations that want to use NIS and also want to look up addresses on
the Internet can combine NIS with DNS. You can use NIS to manage all
local information and use DNS for Internet host lookup. The Solaris OS
also allows you to set up the /etc/nsswitch.conf file so that lookup
requests for hosts do the following:
THESE8-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Directory Entries
The hierarchy of the directory tree structure is similar to that of the UNIX
file system. Entries are named according to their position in this tree
structure by a distinguished name (DN). The DN is similar to an absolute
path name in UNIX. A Relative Distinguished Name (RDN) is similar to a
relative path name in UNIX. As in the UNIX file system, sibling directory
entries must have unique RDNs.
A directory entry is composed of attributes that have a type and one or
more values. The syntax for each attribute defines the allowed values, or
the allowed data type of the attribute values, such as American Standard
Code for Information Interchange (ASCII) characters or a numerical data.
LDAP also defines how those values are interpreted during a directory
operation, for example, determining if a search or compare is case
sensitive.
Like the DNS namespace, LDAP directory entry names (or DNs) start
(from left) with the least significant component and proceed to the most
significant; in other words, those just below root. The DN is constructed
by concatenating the sequence of components up to the root of the tree.
Figure 8-3 shows an example of a Solaris LDAP Directory Information Tree.
Directory Root
dc=suned, dc=com
ou = People
ou = Hosts
ou = Services
cn = John Jones
cn = mailserver
cn = telnet
Figure 8-3
THESE8-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Feature
DNS
NIS
NIS+
LDAP
Namespace
Hierarchical
Flat
Hierarchical
Hierarchical
Data storage
Files/resource
records
Two column
maps
Multicolumn tables
Directories
(varied)
Server types
Master/
slave/
caching only/
forwarding
Master/
slave
Root master/
non-root master/
replica
Master/
replica
Transport
IP
IP
IP
IP
Scale
Wide area
network (WAN)
Local area
network (LAN)
LAN
WAN
Local files
/etc/nsswitch.files
DNS
/etc/nsswitch.dns
NIS
/etc/nsswitch.nis
NIS+
/etc/nsswitch.nisplus
LDAP
/etc/nsswitch.ldap
/etc/nsswitch.nis:
An example file that could be copied over to /etc/nsswitch.conf; it
uses NIS (YP) in conjunction with files.
"hosts:" and "services:" in this file are used only if the
/etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
THESE8-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The name service switch file determines which name services a system
uses to search for information, and in which order the name service
request is resolved. All Solaris OS systems use the /etc/nsswitch.conf
file as the name service switch file. The nsswitch.conf file is loaded with
the contents of a template file during the installation of the Solaris OS,
depending on the name service that is selected, as shown in Table 8-2.
networks:
protocols:
rpc:
ethers:
netmasks:
bootparams:
publickey:
nis
nis
nis
nis
nis
nis
nis
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
netgroup:
nis
automount:
aliases:
files nis
files nis
files
files
files
files
files
files
files
files nis
files nis
files nis
The /etc/nsswitch.conf file includes a list of databases that are sources
of information about IP addresses, users, and groups. Data for these can
come from a variety of sources. For example, host names and host
addresses, are located in the /etc/inet/hosts file, NIS, NIS+, LDAP, or
DNS. Each database has zero or more sources; the sources and their
lookup order are specified in the /etc/nsswitch.conf file.
#ipnodes:
Database Sources
ipnodes: files
The information sources are listed in the order that they are searched, and
these sources are defined in Table 8-3.
Table 8-3 Information Sources
Information
Sources
Description
files
nisplus
nis
dns
ldap
user
There might be a single information source listed, in which case the search
terminates if the information is not found. If two or more sources are
listed, the first listed source is searched before moving on to the next
listed source. The relationships between these name service keywords,
when found in the nsswitch.conf file, is further explained in Table 8-4
on page 8-15 and Table 8-5 on page 8-15.
THESE8-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Status Codes
When multiple information sources are specified, it is sometimes
necessary to define precisely the circumstances under which each source
is searched. When a name service is referenced, the attempt to search this
source can return one of the following status codes, as shown in Table 8-4.
Status
Message
Meaning of Message
SUCCESS
UNAVAIL
NOTFOUND
TRYAGAIN
Actions
For each status code, two actions are possible, as shown in Table 8-5.
Table 8-5 Status Code Actions
Action
Meaning of Action
return
continue
SUCCESS = return
UNAVAIL = continue
NOTFOUND = continue
TRYAGAIN = continue
For example:
ipnodes:
files
In this example, the /etc/inet/ipnodes file is searched for the first entry
that matches the requested host name. If no matches are found, an
appropriate error is returned, and no further information sources are
searched.
Another example:
THESE8-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When the action is not explicitly specified, the default action is to continue
the search using the next specified information source, as follows:
/var/adm/nscd.log
An example of an attribute, a cache name, and a value is:
enable-cache
hosts
no
# cat /etc/nscd.conf
#
# Copyright (c) 1994-2001 by Sun Microsystems, Inc.
To properly use the name service cache daemon (nscd), you must be able
to perform the following:
1.6
01/01/26 SMI"
#
#
#
#
#
#
logfile
enable-cache
/var/adm/nscd.log
hosts
no
debug-level
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
passwd
passwd
passwd
passwd
passwd
passwd
600
5
211
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
group
group
group
group
group
group
3600
5
211
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
hosts
hosts
hosts
hosts
hosts
hosts
3600
5
211
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
ipnodes
ipnodes
ipnodes
ipnodes
ipnodes
ipnodes
3600
5
211
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
exec_attr
exec_attr
exec_attr
3600
300
211
THESE8-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
keep-hot-count
old-data-ok
check-files
exec_attr
exec_attr
exec_attr
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
prof_attr
prof_attr
prof_attr
prof_attr
prof_attr
prof_attr
3600
5
211
20
no
yes
positive-time-to-live
negative-time-to-live
suggested-size
keep-hot-count
old-data-ok
check-files
user_attr
user_attr
user_attr
user_attr
user_attr
user_attr
3600
5
211
20
no
yes
THESE8-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
There are many tools available for acquiring information stored within the
various name service information sources. Selecting the correct tool can
reduce troubleshooting time when isolating name service malfunctions.
The getent command provides a generic retrieval interface to search
many name service databases.
where:
database
key
THESE8-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Tasks
Answer the following questions:
1.
2.
3.
4.
5.
Which file is referred to as the name service switch file, and why?
_________________________________________________________
_________________________________________________________
6.
If you decide to use the LDAP for name service resolution, which
template file would you use to create the name service switch file?
_________________________________________________________
_________________________________________________________
THESE8-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
8.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE8-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
2.
3.
4.
5.
Which file is referred to as the name service switch file, and why?
The /etc/nsswitch.conf file is referred to as the name service switch
file because the operating system uses it to determine where to go for any
information lookups. This file indicates whether DNS, NIS, NIS+, LDAP,
or local files are to be used for name service resolution. If more than one
name service is to be used, this file indicates the order in which these
services should be accessed.
6.
If you decide to use the LDAP for name service resolution, which
template file would you use to create the name service switch file?
/etc/nsswitch.ldap
7.
Preparation
THESE8-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
8.
Objectives
Module 9
/etc/resolv.conf
/etc/nsswitch.conf
THESE9-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The following configuration files affect the name resolution process using
the Internet domain name system:
In the Name Service window, select DNS as the name service, then
press Esc-2 to continue.
On this screen you must provide name service information. Select the
name service that will be used by this system, or None if your system
will either not use a name service at all, or if it will use a name
service not listed here.
> To make a selection, use the arrow keys to highlight the option
and press Return to mark it [X].
Name service
[ ]
[ ]
[X]
[ ]
[ ]
NIS+
NIS
DNS
LDAP
None
Esc-2_Continue
2.
Esc-6_Help
In the Domain Name window, enter the DNS domain name to which
the client will belong and press Esc-2 to continue.
--Domain Name---------On this screen you must specify the domain where this system resides.
Make sure you enter the name correctly including capitalization and
punctuation.
Esc-2_Continue
Esc-6_Help
--Name Service----------
On this screen you must enter the IP address of your DNS server(s). You
must enter at least one address. IP addresses must contain four sets of
numbers separated by periods (for example 129.200.9.1).
Esc-2_Continue
4.
Esc-6_Help
In the DNS Search List window, enter search suffixes that will
supplement searches for names that are not fully qualified (names
that do not include a complete domain name), then press Esc-2 to
continue.
--DNS Search List---------On this screen you can enter a list of domains that will be searched when
a DNS query is made. If you do not enter any domains, DNS will only
search the DNS domain chosen for this system. The domains entered, when
concatenated, may not be longer than 250 characters.
Search
Search
Search
Search
Search
Search
domain: suned.sun.com
domain: training.sun.com
domain: classroom.sun.com
domain:
domain:
domain:
Esc-2_Continue
Esc-6_Help
THESE9-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
--Confirm Information----------
Name service:
Domain name:
Server address(es):
Search domain(s):
Esc-2_Continue
DNS
suned.sun.com
192.168.30.61
suned.sun.com
training.sun.com
classroom.sun.com
Esc-4_Change
Esc-6_Help
domain
search
# cat /etc/resolv.conf
nameserver 192.168.10.11
nameserver 192.168.20.88
domain suned.sun.com
THESE9-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The following resolv.conf example shows two name servers for the
suned.sun.com domain.
Client Authentication
An LDAP client can use an LDAP server either in authenticated or in
anonymous modes. In the authenticated mode, an LDAP client must
establish a session with an LDAP server. This authentication process is
known as binding. After a client is authenticated, it can then perform
operations, such as search and modify, on the data. Authorization is the
granting of access to controlled system resources.
By default, Solaris OS LDAP clients have read-only access to name service
data, such as host names, email aliases, and net groups. Users have readwrite access to certain data, such as their own passwords. Privileged
administrator accounts have read-write access to other data. When
finished, the client unbinds, or closes, the session.
Details on how the client is authenticated and what data the client is
authorized to access is maintained on the LDAP server. To simplify
Solaris OS client setup and to avoid having to re-enter the same
information for each and every client, a single client profile is created on
the directory server.
Client Initialization
The client profile and proxy account can be created as part of the Sun Java
Directory Server setup procedures on the Solaris 10 OS. By default, the
client profile named default and the proxy account proxyagent are
created under a special profile directory entry.
When the Solaris LDAP client is initialized, a copy of the client profile is
retrieved from the server and stored on disk. On the LDAP client, the
ldap_cachemgr daemon is responsible for maintaining and updating the
changes to the client profile information. The ldap_cachemgr daemon
keeps a copy of the profile in memory and uses it when binding to the
server.
THESE9-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
A client profile:
In the Name Service window, select LDAP as the name service, and
press Esc-2 to continue.
On this screen you must provide name service information. Select the
name service that will be used by this system, or None if your system
will either not use a name service at all, or if it will use a name
service not listed here.
> To make a selection, use the arrow keys to highlight the option
and press Return to mark it [X].
Name service
[ ]
[ ]
[ ]
[X]
[ ]
NIS+
NIS
DNS
LDAP
None
Esc-2_Continue
Esc-6_Help
Note When you specify LDAP as the name service, the client host name
must exist in the ou=hosts container on the LDAP server.
2.
In the Domain Name window, enter the domain name where the
system is located and press Esc-2 to continue.
--Domain Name---------On this screen you must specify the domain where this system resides.
Make sure you enter the name correctly including capitalization and
punctuation.
--Name Service----------
Esc-2_Continue
4.
Esc-6_Help
--Provide LDAP Proxy Bind Information---------If the profile you are using specifies a proxy credential level and the
authentication method is NOT none, provide LDAP proxy bind information.
> Use the arrow keys to select the option and press Return to
mark it [X].
Esc-2_Continue
Esc-6_Help
THESE9-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
On this screen you must specify the name of the LDAP profile to be used
to configure this system, as well as the IP address of the server that
contains the profile.
--Confirm Information----------
Name service:
Domain name:
Profile name:
Profile server IP address:
Specify LDAP Proxy Bind Information:
Esc-2_Continue
Esc-4_Change
LDAP
suned.sun.com
sunedprofile
192.168.0.1
No
Esc-6_Help
proxyPassword
proxyDN
domainname
192.168.0.100
THESE9-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# cat /var/ldap/ldap_client_cred
#
# Do not edit this file manually; your changes will be lost.Please use
ldapclient (1M) instead.
#
NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=suned,dc=sun,dc=com
NS_LDAP_BINDPASSWD= {NS1}ecc423aad0
more nsswitch.conf
An example file that could be copied over to /etc/nsswitch.conf; it
uses LDAP in conjunction with files.
"hosts:" and "services:" in this file are used only if the
/etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
ldap
ldap
ldap
ldap
ldap
ldap
ldap
netgroup:
ldap
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
files
files
files
files
files
files
files
THESE9-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
automount:
aliases:
files ldap
files ldap
files ldap
printers:
THESE9-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
dn: nismapname=auto_master,dc=suned,dc=sun,dc=com
Preparation
Refer to the lecture notes to perform the tasks listed. The instructors
system is configured as a DNS server and as an LDAP server for the
classroom network, using a domain name of suned.sun.com.
Tasks
Complete the following steps:
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
b.
c.
Note The name server IP address and domain might be differ from
those used in this example. If you need help, check with your instructor.
4.
5.
Verify that you can access another system in the classroom by using
the ping command.
First, use only the host name, and then use the fully qualified
domain name, for example: hostname.suned.sun.com.
6.
In this exercise, you configure the Solaris 10 OS client system to use DNS
and LDAP as name services.
Verify the name service switch file has been updated with the LDAP
configuration.
hosts:
9.
Verify that you can access another system in the classroom by using
the ping command.
First, use only the host name, and then use the fully qualified
domain name, for example: hostname.suned.sun.com.
THESE9-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
b.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
!
?
Preparation
Refer to the lecture notes to perform the tasks listed. The instructors
system is configured as a DNS server and as an LDAP server for the
classroom network, typically using a domain name of suned.sun.com.
Your instructor will provide the correct domain name to use if it is not
suned.sun.com.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
# cp /etc/nsswitch.dns /etc/nsswitch.conf
cp: overwrite /etc/nsswitch.conf (yes/no)? yes
3.
b.
c.
Note The name server IP address and domain might be differ from
those used in this example. If you need help, check with your instructor.
# vi /etc/resolv.conf
nameserver 192.168.30.30
domain suned.sun.com
search suned.sun.com
THESE9-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
In this exercise, you configure the Solaris 10 OS client system to use DNS
and LDAP as name services.
4.
7.
b.
Verify the name service switch file has been updated with the LDAP
configuration.
hosts:
ldap [NOTFOUND=return] files
# grep hosts: /etc/nsswitch.conf
# "hosts:" and "services:" in this file are used only if the
hosts:
ldap [NOTFOUND=return] files
9.
Verify that you can access another system in the classroom by using
the ping command.
5.
THESE9-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Introduction to Zones
Objectives
Upon completion of this module, you should be able to:
Configure zones
Install zones
Boot zones
Move a zone
Migrate a zone
Delete a zone
Module 10
THESE10-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Zones allow the root user of the global zone to dedicate system resources
to individual zones. Each zone maintains its own root password and user
information, separate from other zones and the global zone. Each zone
exists with separate process and file system space, and can only monitor
and interact with local processes. A single processor and single disk
system can support several zones, each with separate resources, users,
and process space as shown in Figure 10-1.
Core Services
(ypbind, inetd, rpcbind)
Core Services
(netd, ldap_cachemgr)
Virtual
Platform
/opt/yt
zoneadmd
zoneadmd
ce0:2
Core Services
(ypbind, automountd)
zcons
Network Services
(BIND 9,2, sendmail)
/usr
Network Services
(BIND 8,3, sendmail)
ce0:1
Enterprise Services
(Databases)
zcons
Web Services
(Apache 2.0)
/usr
Login Services
(OpenSSH sshd 3,4)
hme0:1
Web Services
(Apache 1.3.22, J2SE)
zcons
/usr
/opt/yt
Application
Environment
/opt/yt
zoneadmd
Remote Admin/monitoring
(SNMP, SunMC, WBEM)
Network Device
(hme0)
Network Device
(ce0)
Platform Administration
(syseventd, devfsadm,...)
Storage Complex
Resource Sharing
THESE10-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Zone Features
Zone Concepts
Zone Concepts
Zone types
Zone daemons
Zone networking
Zone states
Zone Types
The Solaris Operating System supports three types of zones:
Global zone
Non-global zone
Branded zones
Global Zones
Every Solaris system contains a global zone (Figure 10-1 on page 10-3).
The global zone has two functions. The global zone is both the default
zone for the system and the zone used for system-wide administrative
control. The global zone is the only zone from which a non-global zone
can be configured, installed, managed, or uninstalled. All processes run in
the global zone if no non-global zones are created by the global
administrator.
Only the global zone is bootable from the system hardware. The global
zone contains a complete installation of the Solaris system software
packages. It can contain additional software not installed through
packages.
Note Exclusive IP stack zones allow for management of network
interfaces, including routing.
Zone Concepts
Non-Global Zone
The non-global zones contain an installed subset of the complete Solaris
Operating System software packages. They can also contain Solaris
software packages shared from the global zone and additional installed
software packages not shared from the global zone.
Non-global zones can contain additional software created on the nonglobal zone that are not installed through packages or shared from the
global zone.
The non-global zones share operation under the Solaris kernel booted
from the global zone. They are assigned a non-zero zone ID by the system
when the zone is booted and must have a user defined name.
The non-global zone is not aware of the existence of any other zones. It
cannot install, manage, or uninstall itself or any other zones.
THESE10-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The global zone is the only zone from which a non-global zone can be
configured, installed, managed, or uninstalled. Appropriately privileged
processes running in the global zone can access objects associated with
other zones.
Zone Concepts
Branded Zones
Branded zones are available beginning with the Solaris 10 8/07 release.
Zone Concepts
The zonecfg command is used to set a zones brand type when the
zone is configured.
Note You can change the brand of a zone in the configured state. Once a
branded zone has been installed, that brand cannot be changed or
removed.
Zone Daemons
The system uses two daemons to control zone operation: zoneadmd and
zsched.
The zoneadmd daemon is the primary process for managing the zones
virtual platform. There is one zoneadmd process running for each active
(ready, running, or shutting down) zone on the system.
The zoneadmd daemon is responsible for:
THESE10-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The branded zone framework extends the zones tools in the following
ways:
Zone Concepts
The sparse root model installs a minimal number of files from the global
zone when a non-global zone is installed. In this model, only certain root
packages are installed in the non-global zone. These include a subset of
the required root packages that are normally installed in the global zone,
as well as any additional root packages that the global administrator
might have selected. Any files that need to be shared between a nonglobal zone and the global zone can be mounted as read-only loopback
file systems.
By default, the directories /lib, /platform, /sbin, and /usr are
mounted in this manner. An example of shared file systems is shown in
Figure 10-2.
/
Global Zone
sbin
usr
export
etc
var
zones
sbin
usr
zonea
zoneb
zonec
etc
sbin
var
usr
sbin
usr
etc
var
etc
var
Zone Concepts
For files that are mounted using the loopback file system, the removal of a
critical file from the global zone would be the same as if it were in a
typical client-server situation. The zone's dependence on the file would
determine the effect of its removal on the zone.
Note A non-global zone cannot be an NFS server.
THESE10-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Zone Concepts
Zone Networking
There are two IP types available for non-global zones: shared-IP stack and
exclusive-IP stack.
Each non-global zone that requires network connectivity has one or more
dedicated IP addresses. These addresses are associated with logical
network interfaces. For example, if the primary network interface in the
global zone is ce0, then the non-globals logical network interface is
ce0:1.
Zone interfaces configured by zonecfg will automatically be plumbed
and placed in the zone when it is booted. Only the global zone
administrator can modify the interface configuration and the network
routes.
IPMP can be configured in the global zone, and the functionality extended
to non-global zones. The functionality is extended by placing the zones IP
address in an IPMP group when configuring the zone. Then, if one of the
interfaces in the global zone fails, the non-global zone addresses will
migrate to another network interface card.
The shared-IP zone shares a network interface and the exclusive-IP zone
must have a dedicated network interface.
Zone Concepts
Install
Configured
Uninstall
Shutting Down
Reboot
Running
Ready
Delete
Installed
Halt
Undefined
Ready
THESE10-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Zone States
Ready In this state, the virtual platform for the zone is established.
The kernel creates the zsched process, network interfaces are
plumbed, file systems are mounted, and devices are configured. A
unique zone ID is assigned by the system. At this stage, no processes
associated with the zone have been started.
Running In this state, the user processes associated with the zone
application environment are running. The zone enters the running
state as soon as the first user process associated with the application
environment (init) is created.
Shutting down and Down - These states are transitional states that
are visible while the zone is being halted. However, a zone that is
unable to shut down for any reason will stop in one of these states.
Zone Concepts
Configuring Zones
Configuring Zones
A zone name
THESE10-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring Zones
By default, any additional packages installed in the global zone also
populate the non-global zones. The amount of disk space required
must be increased accordingly. The directory location in the nonglobal zone for these additional packages is specified through the
inherit-pkg-dir resource.
You can use standard partitions to divide disk slices or soft partitions to
divide logical volumes into partitions. You can use these partitions as
zone roots, and thus limit per-zone disk consumption. The soft partition
limit is 8192 partitions.
An additional 40 megabytes of RAM per zone are suggested, but not
required on a machine with sufficient swap space.
Note There are many other operations that can be accomplished with
the zonecfg command, but they are outside of the scope of this course.
To simplify the user interface, zonecfg utilizes the concept of a scope. The
default scope is global. You can use the add and select subcommands
to select a specific resource, at which point the scope changes to that
resource. The zonecfg interactive command prompt changes to reflect the
current scope. The end and cancel subcommands are used to complete
the resource specification, at which time the scope reverts back to global.
Certain subcommands, such as add, remove and set, have different
semantics in each scope.
Configuring Zones
There are several subcommands to configure and provision zones within
the zonecfg utility, as shown in Table 10-1. Several subcommands affect
the environment, depending on the current scope. The zonecfg prompt
indicates if the scope is global or resource scope. Many of the
subcommands also allow the f, or force, flag. If this flag is given, the
subcommand does not use interactive questioning safeguards.
Command
Description
add
cancel
commit
create
delete
end
export
info
remove
select
set
verify
revert
THESE10-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring Zones
Command
Description
exit
zonename Defines the zone name and identifies the zone to the
configuration utility.
zonepath Defines the zone path resource and is the path to the
zone root.
autoboot Determines if the zone will reboot when the global zone
reboots.
dir
special
raw
type
options
THESE10-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring Zones
Configuring Zones
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
To create a zone, you must log into the global system as root or role
based access control (RBAC)-allowed user. The following shows an
example of configuring a zone named work-zone:
Configuring Zones
Line 3 The zone path resource, /export/work-zone in this example, is
the path to the zone root. Each zone has a path to its root directory that is
relative to the global zones root directory. This path must exist at
installation time. The global zone directory is required to have restricted
visibility. It must be owned by root with the mode 700. In this example
the global zone directory is /export.
Line 5 This line begins a file system configuration. The command scope
changes to file systems.
Line 6 Set the mount point for the file system, /mnt in this example.
Line 7 Specify that /dev/dsk/c0t0d0s7 block special file in the global
zone is to be mounted as /mnt in the work-zone.
Line 8 Specify that /dev/rdsk/c0t0d0s7 raw special file. The zoneadmd
daemon automatically runs the fsck command in non-interactive check
only mode on this device before it mounts the file system.
Line 9 This line specifies that the file system type is UFS.
Line 10 This line specifies the file system-specific option, enable file
system logging in this procedure.
Line 11 This line ends the file system configuration section in this
procedure.
Line 12 This line begins the configuration of a read only shared file
system that is loopback-mounted from the global zone.
Line 13 This line specifies that /usr/sfw is to be loopback mounted
from the global zone.
Line 14 This line ends the mount loopback section in this procedure.
Line 15 This line begins the network configuration section in this
procedure.
Line 16 This line specifies the physical network interface to be used by
this zone is a GigaSwift.
THESE10-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring Zones
Line 17 This line specifies the IP address for the network interface,
192.168.0.1 in this procedure.
Line 18 This line ends the network configuration section in this
procedure.
Line 20 This line gives the non-global zone visibility to devices that
match the pattern /dev/sound/* in the global zone.
Line 21 This line ends the device configuration section in this procedure.
Line 22 This line begins the attribute configuration section in this
procedure.
Line 23 This line sets the name of the name of the attribute, comment in
this procedure.
Line 24 This line sets the type of attribute as a string of characters.
Line 25 This line assigns a value to the string of characters, The work
zone. in this procedure.
Line 26 This line ends the attribute configuration section in this
procedure.
Line 27 This line verifies the current configuration for correctness. It
ensure that all resources have all of their required properties specified.
Line 28 This line commits the current configuration from memory to
stable storage. Until the in-memory configuration is committed, changes
can be removed with the revert subcommand. A configuration must be
committed to be used by the zoneadm command. This operation is
attempted automatically when you complete a zonecfg session. Because
only a correct configuration can be committed, the commit operation
automatically does a verify.
Line 29 This line exits the zonecfg session. You can use the -F (force)
option with exit.
The zone is now ready to install, boot, and use.
Configuring Zones
THESE10-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Configuring Zones
When you commit the zone configuration to stable storage, the file is
stored in the /etc/zones directory in XML format.
Caution The /etc/zones file is never to be edited. This file exists for
implementation purposes onle.
# more /etc/zones/work-zone.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE zone PUBLIC "-//Sun Microsystems Inc//DTD Zones//EN"
"file:///usr/share/lib/xml/dtd/zo
necfg.dtd.1">
<zone name="work-zone" zonepath="/export/work-zone" autoboot="true">
...
For example:
Boot a zone
Halt a zone
Reboot a zone
Move a zone
Migrate a zone
Delete a zone
THESE10-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The zoneadm command is the primary tool used to install and administer
non-global zones. Operations using the zoneadm command must be run
from the global zone. The following tasks can be performed using the
zoneadm command:
You use the zoneadm list -iv command to list the installed zones and
verify the status:
global# zoneadm list -iv
ID NAME
STATE
PATH
0
global
running
/
work-zone installed /export/work-zone
In this example, the work-zone has reached the installed state. The zone
ID will be assigned during the zone boot process.
Note By default, list only shows running zones. To show all zones on
a system you would run zoneadm list -cv.
Booting a Zone
Booting a zone places the zone in the running state. If you set the
autoboot resource property in a zones configuration to true, that zone is
automatically booted when the global zone is booted. The default setting
is false.
Note Before a zone is booted for the first time you should connect to the
zone console device using zlogin -C to enter the system configuration
information required to use the zone.
A zone can be manually booted from the installed state. You use the
zoneadm -z zone_name boot command to boot a zone:
global# zoneadm -z work-zone boot
global# zoneadm list -v
ID NAME
STATE
PATH
0
global
running /
1
work-zone running /export/work-zone
Service options determine the services that are used to boot the
system.
Halting a Zone
The zoneadm halt command is used to remove both the application
environment and the virtual platform for a zone. The zone is then brought
back to the installed state. All processes are killed, devices are
unconfigured, network interfaces are unplumbed, file systems are
unmounted, and the kernel data structures are destroyed.
global# zoneadm -z work-zone halt
global# zoneadm list -v
ID NAME
STATE
PATH
0
global
running
/
work-zone installed /export/work-zone
THESE10-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Rebooting a Zone
THESE10-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Note The zone is now up and running. If you add (or delete) resources
to the running zone using the zonecfg command, you must restart the
zone for the changes to take effect.
# zonecfg z work-zone
zonecfg:work-zone> remove net physical=ce0
zonecfg:work-zone> commit
zonecfg:work-zone> exit
Moving a Zone
The move zone feature allows you to relocate a non-global zone from one
point on a system to another point on the same system. This is
implemented so that it works both within and across file systems, subject
to the existing rules for zonepath. When crossing file system boundaries,
the data is copied and the original directory is removed. Internally, the
copy is implemented using the cpio command with the proper options to
preserve all of the data such as ACLs.
To move a non-global zone, use the zoneadm command. For example:
# zoneadm -z work-zone move /newpath
In this example, /newpath specifies the new zonepath for the zone.
Note The non-global zone must be halted while being moved.
Migrating a Zone
Migrating a Zone
The zone detach process creates the information necessary to attach the
zone on a different system. The zone attach process verifies that the new
machine has the correct configuration to host the zone. You can make the
zonepath available on the new host in several ways. Therefore, the actual
movement of the zonepath from one system to another is a manual
process that is performed by the zone administrator.
Migrating a zone from one system to another involves the following steps:
1.
Detaching the Zone This leaves the zone on the originating system
in the configured state. Behind the scenes, the system generates a
manifest of the information needed to validate that the zone can be
successfully attached to a new host machine.
To detach a zone, first halt the zone, then perform the detach
operation:
Data Migration You move the data which represents the zone to a
new host system. The following is an example of migration zone
data from host1 to host2.
On host1:
host1# cd /export/zones
host1# tar cf work-zone.tar work-zone
host1# sftp host2
Connecting to host2...
THESE10-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Using the zonecfg and zoneadm commands, you can migrate a nonglobal zone from one system to another. This procedure detaches a halted
zone from its current location, and attaches the zone at a new location.
The global zone on the target system must be running the following:
Migrating a Zone
Password:
sftp> cd /export/zones
sftp> put work-zone.tar
Uploading work-zone.tar to /export/zones/work-zone.tar
sftp> quit
host2# cd /export/zones
host2# tar xf my-zone.tar
3.
Note The -a option uses the XML description of the detached zone
(created during detach operation) to configure the new zone instance. The
path /export/zones/work-zone is the path to the zone root. Alternately,
the new zone can be configured using the traditional zonecfg operations
and then zoneadm attach can be used to attach the zone root.
On host2:
Migrating a Zone
If a remote command is not piped in, you can copy the zone manifest
to the target system and pre-validate it there as follows:
THESE10-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can perform a dry-run before the zone is moved to the new system
by using the -n option of the zoneadm detach command.
Migrating a Zone
Deleting a Zone
When deleting a zone, be sure to back up any files that you want to keep.
The first stage in deleting a zone is halting the Solaris 10 OS and freeing
the system memory.
In the following example, the zone is removed from the global system:
Package parameters listed in the pkginfo file for a package control how
the Solaris package tools can administer the package. These package
parameters determine how package content can be distributed and made
visible among zones, both global and non-global, in a system.
Currently, three package parameters control how packages are
administered. They are:
Values of these parameters can only be set to true or false. If one of these
parameters is not defined in a package, the package management tools
assume its value to be false. More information about the specific effects of
these parameters and how they interact is available in pkginfo(4).
THESE10-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The standard Solaris package management tools, for example, pkgadd and
pkgrm, are used to administer packages on a system with zones installed.
The global administrator can use these tools to manage the software on
every zone in the system.
# pkgparam -v SUNWzoneu
CLASSES='none'
BASEDIR='/'
LANG='C'
PATH='/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin'
OAMBASE='/usr/sadm/sysadm'
PKG='SUNWzoneu'
NAME='Solaris Zones (Usr)'
ARCH='sparc'
VERSION='11.10.0,REV=2005.01.21.15.53'
SUNW_PRODNAME='SunOS'
SUNW_PRODVERS='5.10/Generic'
SUNW_PKGTYPE='usr'
MAXINST='1000'
CATEGORY='system'
DESC='Solaris Zones Configuration and Administration'
VENDOR='Sun Microsystems, Inc.'
HOTLINE='Please contact your local service provider'
EMAIL=''
SUNW_PKGVERS='1.0'
SUNW_PKG_ALLZONES='true'
SUNW_PKG_HOLLOW='false'
PSTAMP='gaget20050121155950'
PKGINST='SUNWzoneu'
PKGSAV='/var/sadm/pkg/SUNWzoneu/save'
INSTDATE='Jan 26 2005 10:21'
#
The pkgadd utility can be used with the -G option in the global zone to
add the package to the global zone only. The package is not propagated to
any other zones. Note that if SUNW_PKG_THISZONE=true, you do not have
to use the -G option. If SUNW_PKG_THISZONE=false, the -G option will
override it.
You can list parameters for packages using the pkgparam command. To
display the list of parameters and their values in a package, use pkgparam
-v package. For example:
In the current zone only, which is the global zone in this case, if
SUNW_PKG_THISZONE=true
THESE10-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The package can be removed from the global zone and from all nonglobal zones.
Packages that are installed in the global zone are either installed in
the global zone only, or installed in the global zone and all nonglobal zones.
Packages that are installed in the global zone and also installed in
any non-global zone are the same across all zones.
The package can be installed in the current zone, which is the nonglobal zone in this case, if SUNW_PKG_THISZONE=true.
If the package is currently installed in the global zone only, the following
guidelines apply:
THESE10-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
AMD
Pentium Pro/II/III
Opteron
Celeron
Xeon
Duron
Sempron
Core/ Core 2
Turion 64/64 X2
You can obtain the Linux distribution using one of the following methods:
Application Support
The Solaris system imposes no limit on the number of Linux applications
you can run in an lx branded zone. Regardless of the underlying kernel,
only 32-bit Linux applications are able to run. You should ensure that
sufficient disk is made available to hold files that are unique with each lx
branded zone. The disk space requirements for an lx branded zone are
determined by the size and number of Linux packages that you plan to
install.
The lx zone supports only user-level Linux applications. You cannot use
Linux device drivers, Linux kernel modules, or Linux file systems from
inside an lx zone. Further, you cannot run Solaris applications inside an
lx zone. However, the lx zone enables you to use the Solaris system to
develop, test, and deploy Linux applications. For example, you can place
a Linux application in an lx zone and analyze it using Solaris tools run
from the global zone. You can then make improvements and deploy the
tuned application on a native Linux system.
THESE10-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The lx branded zone supports the installation of CentOS 3.x or Red Hat
Enterprise Linux 3.x distribution inside a non-global zone. Before you can
install the lx branded zone, you must first obtain the Linux archives. The
archives are distributed in the following forms:
Debugging Tools
You can apply Solaris debugging tools, such as dtrace and mdb to Linux
processes executing inside the zone, but the tools themselves must be
running in the global zone. Any core files generated are produced in the
Solaris format and can only be debugged with Solaris tools.
2.
3.
4.
Remove zones
Preparation
This exercise requires software packages and programs located in
/opt/ses/lab/sparc/zones or /opt/ses/lab/x86/zones, for SPARC
or x86/x64 architecture systems, respectively.
If you are on an x86-based machine, you use the following packages:
Remove any user-defined non-root users from the system that may exist
because of previous lab exercises.
# userdel -r user9
Remove the SUNWoptdir and SUNWusrdir packages from the system
that may exist because of previous lab exercises.
# pkgrm SUNWoptdir
# pkgrm SUNWusrdir
This exercise requires a system that has a spare disk available. During the
exercise, you will use the format utility to create three partitions on the
spare disk; two 1 Gbyte partitions and one partition representing the
remainder of the disk will be required. To complete this exercise you must
already be familiar with the format utility.
THESE10-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Use the format utility to create three partitions on the spare disk in
your system. Set partitions 0 and 1 to 1Gbyte each, and set partition
6 to use the remainder of the disk. The all free hog method
available in the partition menu of the format utility may offer the
easiest method.
2.
Use newfs to create a UFS file system on each of the partitions 0 and
1 you created. Replace the example slice names with those that are
correct for your system.
3.
Create a directory /export/zone1. The files specific to the nonglobal zone you will create will be installed in file system you will
mount below this directory.
4.
Verify that the /export directory is owned by the root user and
group.
5.
Edit the /etc/vfstab file on your system and add an entry so that
the filesystem on partition 0 on your spare disk will mount
automatically below /export/zone1. Use device names that are
correct for your system.
6.
7.
8.
9.
10. Open a terminal window. Use the window to install zone1. Zone
installation takes different amounts of time to complete, depending
on your systems capabilities.
THESE10-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Verify that the non-global zone has mounted the file system you
specified in its configuration steps, and that you can create a file
within that file system.
2.
3.
Verify that user1 exists in the /etc/passwd file in zone1, and then
log out of zone1.
4.
19. Exit the zlogin console session. If you specified an alternate escape
character in your zlogin command line, enter it instead of the tilde
character.
2.
3.
Install the SMCtop package in the global zone only. All files for this
package are installed below the /opt/local directory.
5.
Log in to zone1 and verify that the SMCtop package was not
installed in that zone. Log out from zone1 when finished.
6.
From the global zone, install the SMCsudo package in the global
zone and the non-global zone.
7.
Log in to zone1 and verify that the SMCsudo package has been
installed. Log out from zone1 when finished.
From the global zone list the current configured zones with zoneadm
command.
2.
Use the zoneadm command to halt any running non global zones.
3.
4.
Delete the configuration of zone1 and zone2 from the global system.
5.
THESE10-46
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
!
?
Remove zones
Preparation
This exercise requires software packages and programs located in
/opt/ses/lab/sparc/zones or /opt/ses/lab/x86/zones, for SPARC
or x86/x64 architecture systems, respectively.
If you are on an x86-based machine, you use the following packages:
To complete this exercise you must already be familiar with the format
utility.
Remove any user-defined non-root users from the system that may exist
because of previous lab exercises.
# userdel -r user9
Remove the SUNWoptdir and SUNWusrdir packages from the system
that may exist because of previous lab exercises.
# pkgrm SUNWoptdir
# pkgrm SUNWusrdir
This exercise requires a system that has a spare disk available. During the
exercise, you will use the format utility to create three partitions on the
spare disk; two 1 Gbyte partitions and one partition representing the
remainder of the disk will be required.
THESE10-48
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Use the format utility to create three partitions on the spare disk in
your system. Set partitions 0 and 1 to 1Gbyte each, and set partition
6 to use the remainder of the disk. The all free hog method
available in the partition menu of the format utility may offer the
easiest method.
2.
Use newfs to create a UFS file system on each of the partitions 0 and
1 you created. Replace the example slice names with those that are
correct for your system.
# newfs /dev/rdsk/c2d0s0
# newfs /dev/rdsk/c2d0s1
3.
Create a directory /export/zone1. The files specific to the nonglobal zone you will create will be installed in file system you will
mount below this directory.
# mkdir /export/zone1
4.
Verify that the /export directory is owned by the root user and
group.
Edit the /etc/vfstab file on your system and add an entry so that
the filesystem on partition 0 on your spare disk will mount
automatically below /export/zone1. Use device names that are
correct for your system. For example:
/dev/dsk/c2d0s0 /dev/rdsk/c2d0s0
6.
/export/zone1
ufs
yes
# mount /export/zone1
7.
# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/export/zone1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add fs
zonecfg:zone1:fs> set dir=/dir1
zonecfg:zone1:fs> set special=/dev/dsk/c2d0s1
zonecfg:zone1:fs> set raw=/dev/rdsk/c2d0s1
zonecfg:zone1:fs> set type=ufs
zonecfg:zone1:fs> end
zonecfg:zone1> add net
zonecfg:zone1:net> set physical=nge0
zonecfg:zone1:net> set address=10.7.10.114
zonecfg:zone1:net> end
zonecfg:zone1> add attr
zonecfg:zone1:attr> set name=comment
zonecfg:zone1:attr> set type=string
zonecfg:zone1:attr> set value="zone one"
zonecfg:zone1:attr> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> info
zonename: zone1
zonepath: /export/zone1
autoboot: true
pool:
limitpriv:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
fs:
dir: /dir1
THESE10-50
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# zoneadm list -i
global
#
10. Open a terminal window. Use the window to install zone1. Zone
installation takes different amounts of time to complete, depending
on your systems capabilities.
# zoneadm -z zone1 install
The zoneadm command checks if the zone configuration is valid, and
reports errors that it finds. Messages expected from zoneadm include
the following:
Preparing to install zone <zone1>.
Checking <ufs> file system on device </dev/rdsk/c2d0s1> to be mounted at
</export/zone1/root>
Creating list of files to copy from the global zone.
Copying <2422> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <974> packages on the zone.
Initializing package <243> of <974>: percent complete: 24%
11. After the installation processes for the non-global zone completes,
use the zoneadm command to verify the status of the zone.
# zoneadm list -iv
ID NAME
STATUS
0 global
running
- zone1
installed
#
PATH
/
/export/zone1
BRAND
native
native
IP
shared
shared
attr:
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
nge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.7.10.14 netmask ffff0000 broadcast 10.7.255.255
ether 0:e0:81:73:52:cc
#
14. Boot zone1. The initial zone boot process can take a few minutes to
complete.
# zoneadm -z zone1 boot
15. Verify that zone1 is running.
# zoneadm list -iv
ID NAME
STATUS
0 global
running
2 zone1
running
#
PATH
/
/export/zone1
BRAND
native
native
IP
shared
shared
THESE10-52
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
English
French
German
Italian
Japanese
Korean
Simplified Chinese
Spanish
Swedish
Traditional Chinese
Thai UTF-8
Turkey (ISO8859-9)
Turkey (UTF-8)
U.S.A. (UTF-8)
U.S.A. (en_US.ISO8859-1)
U.S.A. (en_US.ISO8859-15)
Go Back to Previous Screen
THESE10-54
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
...
# zlogin zone1
[Connected to zone 'zone1' pts/5]
Sun Microsystems Inc.
SunOS 5.10
Generic January 2005
# uname -a
SunOS zone1 5.10 Generic_118855-33 i86pc i386 i86pc
# df -h dir1
Filesystem
size
used avail capacity Mounted on
/dir1
996M
1.0M
935M
1%
/dir1
# cd /dir1
# touch file1
# ls
file1
lost+found
# exit
[Connection to zone 'zone1' pts/5 closed]
#
2.
# zlogin zone1
[Connected to zone 'zone1' pts/5]
Last login: Mon Apr 30 14:16:01 on pts/5
Sun Microsystems Inc.
SunOS 5.10
Generic January 2005
# mkdir /export/home
# useradd -u 1000 -g 10 -md /export/home/user1 user1
64 blocks
# passwd user1
New Password:
Re-enter new Password:
passwd: password successfully changed for user1
#
1.
Verify that user1 exists in the /etc/passwd file in zone1, and then
log out of zone1.
THESE10-56
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
4.
# pkginfo -d top-3.5.1-sol10-zones-intel-local
application SMCtop top
# pkginfo -d sudo-1.6.8p9-sol10-zones-intel-local
application SMCsudo sudo
#
Use the pkgparam command to display the value of the
SUNW_PKG_ALLZONES parameter for the SMCsudo and SMCtop
packages. If the SUNW_PKG_ALLZONES parameter is not configured,
the result is equal to the parameter being set to false.
# pkgparam -d sudo-1.6.8p9-sol10-zones-intel-local SMCsudo SUNW_PKG_ALLZONES
false
# pkgparam -d
false
#
Install the SMCtop package in the global zone only. All files for this
package are installed below the /opt/local directory.
# pkgadd -d top-3.5.1-sol10-zones-intel-local -G
3.
## Installing part 1 of 1.
/opt/local/bin/top
/opt/local/doc/top/Changes
/opt/local/doc/top/FAQ
/opt/local/doc/top/INSTALL
/opt/local/doc/top/README
/opt/local/doc/top/SYNOPSIS
/opt/local/doc/top/Y2K
/opt/local/doc/top/metatop
/opt/local/man/man1/top.1
[ verifying class <none> ]
Installation of <SMCtop> was successful.
#
5.
Log in to zone1 and verify that the SMCtop package was not
installed in that zone. Log out from zone1 when finished.
# zlogin zone1
[Connected to zone 'zone1' pts/5]
Last login: Mon Apr 30 14:18:44 on pts/5
Sun Microsystems Inc.
SunOS 5.10
Generic January 2005
# pkginfo SMCtop
ERROR: information for "SMCtop" was not found
# exit
[Connection to zone 'zone1' pts/5 closed]
#
6.
From the global zone, install the SMCsudo package in the global
zone and the non-global zone.
# pkgadd -d sudo-1.6.8p9-sol10-zones-intel-local
THESE10-58
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Log in to zone1 and verify that the SMCsudo package has been
installed. Log out from zone1 when finished.
# zlogin zone1
[Connected to zone 'zone1' pts/5]
Last login: Mon Apr 30 14:38:07 on pts/5
Sun Microsystems Inc.
SunOS 5.10
Generic January 2005
# pkginfo SMCsudo
application SMCsudo sudo
# exit
[Connection to zone 'zone1' pts/5 closed]
#
#
#
ID
0
1
From the global zone list the current configured zones with zoneadm
command.
PATH
/
/export/zone1
BRAND
native
native
IP
shared
shared
Use the zoneadm command to halt any running non global zones.
PATH
/
/export/zone1
BRAND
native
native
IP
shared
shared
THESE10-60
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Delete the configuration of zone1 and zone2 from the global system.
IP
shared
sharedI
IP
shared
# umount /export/zone1
# vi /etc/vfstab
3.
Preparation
This exercise requires the following:
Further, refer to the lecture notes and additional resources to perform the
steps listed.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
3.
4.
5.
THESE10-62
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
6.
Use the zoneadm command to boot zone2. The initial zone boot
process can take a few minutes to complete.
7.
8.
9.
2.
Use the tar command to create an archive of the zone2manifest.txt file on host system and transfer it to the target system
using the sftp command.
3.
On the target system, use the zonecfg command to create a nonglobal zone called zone2 and set the zonepath property to
/myzone/zone2.
2.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE10-64
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Preparation
This exercise requires the following:
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
2.
# zonecfg -z zone2
zone2: No such zone configured
Use create to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/myzone/zone2
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
3.
# zoneadm list -i
6.
Use the zoneadm command to boot zone2. The initial zone boot
process can take a few minutes to complete.
# zlogin -C zone2
9.
Use the tar command to create an archive of the zone2manifest.txt file on host system and transfer it to the target system
using the sftp command.
host1# cd /export/home
host1# tar cf zone2-manifest.tar zone2-manifest.txt
host1# sftp host2
Connecting to host2...
Password:
sftp> cd /export/home
sftp> put zone2-manifest.tar
THESE10-66
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
On the target system, use the zonecfg command to create a nonglobal zone called zone2 and set the zonepath property to
/myzone/zone2.
Note You can specify a different value for the zone name and a different
filesystem path for the zonepath property.
# zonecfg -z zone2
zone2: No such zone configured
Use create to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/myzone/zone2
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
2.
host2# cd /export/home
host2# tar xf zone2-manifest.tar
Preparation
This exercise requires the following:
Further, refer to the lecture notes and additional resources to perform the
steps listed.
2.
Create the new zone configuration for the lx branded zone, SUNWlx.
3.
4.
5.
6.
7.
THESE10-68
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
2.
When the installation completes, use the zoneadm command with the
-i and -v options to list the installed zones and verify the status.
Use the zoneadm command to boot the lx-zone zone. The initial
zone boot process can take a few minutes to complete.
2.
2.
3.
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
THESE10-70
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
!
?
Preparation
This exercise requires the following:
Further, refer to the lecture notes and additional resources to perform the
steps listed.
# zonecfg -z lx-zone
lx-zone: No such zone configured
Use create to begin configuring a new zone.
2.
Create the new zone configuration for the lx branded zone, SUNWlx.
zonecfg:lx-zone> verify
5.
zonecfg:lx-zone> commit
6.
7.
When the installation completes, use the zoneadm command with the
-i and -v options to list the installed zones and verify the status.
Use the zoneadm command to boot the lx-zone zone. The initial
zone boot process can take a few minutes to complete.
THESE10-72
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
zonecfg:lx-zone> exit
# zlogin lx-zone
Use the uname -a command to verify that lx-zone zone is running
Linux operating system under Solaris.
# uname -a
Linux lx-zone 2.4.21 BrandZ fake linux i686 i686 i386
GNU/Linux
3.
2.
Notes:
THESE10-74
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Objectives
Introduction to LDAP
Objectives
This module introduces the LDAP protocol for querying and modifying
directory services running over TCP/IP.
Upon completion of this module, you should be able to:
Module 11
THESE11-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
LDAP
THESE11-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
This section reviews LDAP and establishes a baseline for LDAP concepts
used in the rest of the course. The following are examples of concepts:
THESE11-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Directory Schema
The directory schema can contain the same information found in ascii files
such as /etc/passwd or /etc/hosts.
The objectclass attributes define the rules for the entry. An object class
is a special attribute type called objectclass that basically defines
which attributes are mandatory and which are optional for a specific
entry. The objectclass attribute also establishes the entry type based
on its given value. In the previous example, you can tell this entry is a
person by looking at the values given for the objectclass attributes
(objectclass: person, objectclass: organizationalPerson,
and objectclass: inetOrgPerson).
LDAP
The lightweight aspect of the protocol means that it is easy to use and
implement while still being highly functional. Older protocols, such as the
X.500 Directory Access Protocol (DAP) of which LDAP is based on, use
complex encoding methods and require the use of the Open System
Interconnection (OSI) network protocol stack.
LDAP runs on top of Transmission Control Protocol/Internet Protocol
(TCP/IP). This means it can be used by every major operating system
generally available (Microsoft Windows, DOS, UNIX, and Apple OS)
because these operating systems provide TCP/IP as standard or as an
add-on. This allows for a cross platform namespace. Native LDAP
assumes that the LDAP client is configured to use DNS for their host to IP
address resolution.
LDAP supports a set of application programming interfaces (APIs) for a
variety of languages that support the development of directory-enabled
applications. They include C application APIs, Java technology APIs,
and Perl LDAP.
THESE11-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Informational model
Naming model
Functional model
Security model
THESE11-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The root entry is conceptual rather than an actual entry into which
you can place data.
Every node contains data, and any node can be a container. This
contrasts with a file system, in which any given node is a file or a
directory, but not both.
Names are in backward order relative to file system names. That is,
the names are constructed leaf-to-root rather than root-to-leaf, as
they are constructed in file systems.
Each entry is identified by a DN. This results in a unique name for all
entries in the directory, which allows unambiguous references to any
entry in the directory.
THESE11-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Interrogation operations
Update operations
Authentication operations
Two LDAP interrogation operations let LDAP clients search the directory
and retrieve directory data. They include the following operations:
Four LDAP update operations let you manipulate the data in your
directory. They are:
The LDAP functional model describes the operations that you can
perform on the directory using the LDAP protocol. The model defines
three groups of operations as follows:
THESE11-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
There are two LDAP authentication operations and one control operation:
THESE11-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The following extract from the Directory Server access log shows a typical
message sequence between a client and Directory Server:
Options
-b Specifies the starting point (the base) for the search. The value
specified here must be a DN that currently exists in the database.
This parameter is optional if the LDAP_BASEDN environment
variable has been set to a base DN. If the LDAP_BASEDN
environment variable is not set, you must specify the -b option with
the ldapsearch utility. For example, -b dc=example,dc=com
THESE11-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
-x Specifies that the search results are sorted on the server rather
than on the client. This is useful if you want to sort according to a
matching rule, as with an international search. In general, it is faster
to sort on the server then the client.
Filter
Search filters provide a way to reduce the number of false responses of a
search by specifying unique attributes of the data for which you are
searching. You can specify search filters using one of two techniques:
You can specify a single LDAP search filter on the command line.
Note LDAP search filters and their syntax are defined in RFC 2254.
Refer to http://www.ietf.org/rfc/rfc2254.txt for more
information.
Attributes
You can specify one or more attributes after the search filter. Specifying a
list of attributes reduces the scope of the search. Only the attributes
specified with the ldapsearch utility are returned in the search results.
If you do not specify an attribute list, then the ldapsearch utility returns
values for all attributes (as allowed by the directorys access controls)
except operational attributes (attributes used by Directory Server for its own
purposes).
Utilizing LDIF
LDIF is a specification for representing directory entries in an American
Standard Code for Information Interchange (ASCII) format. It was
developed by Tim Howes, Mark C Smith, and Gordon Good while at the
University of Michigan in the early 1990s. Gordon Good authored RFC
2849 in June 2000 and it is currently the proposed standard.
The Directory Server schema is defined by a series of LDIF files found in
the subdirectory:
INSTANCE_PATH/config/schema
where INSTANCE_PATH represents the full path to an instance of
Directory Server. All information in a directory database can potentially
be represented by a single LDIF file. Individual entries can also be
displayed using LDIF syntax.
THESE11-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
By default, Solaris LDAP clients access the information assuming that the
DIT has a given structure. For each domain supported by the LDAP
server, there is a sub-tree with an assumed structure. This default
structure, however, can be overridden by specifying Service Search
Descriptors (SSDs). For a given domain, the default DIT will have a base
container that holds a number of well known containers that hold entries
for a specific information type. See the following table for the names of
these sub-trees. (This information can be found in RFC 2307 and others).
Table 11-1 DIT Default locations
Default Container
Information type
ou=Aliases
aliases(4)
ou=Ethers
bootparams(4), ethers(4)
ou=Group
group(4)
ou=Hosts
ou=Netgroup
netgroup(4)
ou=Networks
networks(4), netmasks(4)
ou=People
ou=printers
printers(4)
ou=projects
project
ou=Protocols
protocols(4)
ou=Rpc
rpc(4)
ou=Services
services(4)
ou=SolarisAuthAttr
auth_attr(4)
ou=SolarisProfAttr
prof_attr(4), exec_attr(4)
Information type
automountMap=auto_*
auto_*
ldapsearch(1)
ldapmodify(1)
ldapadd(1)
ldapdelete(1)
THESE11-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Note For more information on the LDIF specification, refer to: The
LDAP Data Interchange Format (LDIF) - Technical Specification http://tools.ietf.org/html/rfc2849
THESE11-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The Directory Server provides for both vertical and horizontal growth
without major deployment redesign. This level of scalability becomes
increasingly critical as deployment grows.
System Requirements
The system requirements (for a typical 250,000 entries configuration) are:
Directory Server
Minimum memory: 2 GB
Minimum memory: 2 GB
THESE11-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
DSEE Components
Directory Server Enterprise Edition includes virtual directory and
directory proxy services, and is designed to integrate easily into existing
technology infrastructures. For example, because Microsoft Windows
provides the desktop interface most frequently found in enterprise
environments, Directory Server Enterprise Edition includes identity,
group and password synchronization with Microsoft Active Directory.
This enables users to change passwords in either Windows or Directory
Server Enterprise Edition and keep the password synchronized between
the two. Directory Server Enterprise Edition is the only directory solution
that offers seamless, non-intrusive integration with the Microsoft
environment to enable effortless synchronization.
THESE11-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The client needs to be configured with all the given parameters that
define its behavior
ldapclient Utility
The /usr/sbin/ldapclient utility is the key to setting up an LDAP
client, as it performs all of the above steps, except for starting the server.
The ldapclient(1M)utility is used to set up LDAP clients in the Solaris
system. This utility assumes the server has already been configured with
the appropriate client profiles. You must install and configure the server
with the appropriate profiles before you can set up clients.
There are two main ways to set up a client by using ldapclient.
Profile
Manual
You configure the profile on the client itself, which means defining all
parameters from the command line. Thus, the profile information is stored
in cache files and is never refreshed by the server. For example:
# ldapclient manual \
-a domainName=dc=west.example.com \
-a credentialLevel=proxy \
-a defaultSearchBase=dc=west,dc=example,dc=com \
-a proxyDN=cn=proxyagent,ou=profile,dc=west,dc=example,dc=com \
-a proxyPassword=testtest 192.168.0.1
Use ldapclient list to verify.
# ldapclient list
NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=west,dc=example,dc=com
NS_LDAP_BINDPASSWD= {NS1}4a3788e8c053424f
NS_LDAP_SERVERS= 192.168.0.1
NS_LDAP_SEARCH_BASEDN= dc=west,dc=example,dc=com
NS_LDAP_CREDENTIAL_LEVEL= proxy
/etc/nsswitch.conf File
The /etc/nsswitch.conf file must be configured for LDAP before
enabling the LDAP client service. The template file for this is
/etc/nsswitch.ldap. You can copy the file over the default
/etc/nswitch.conf file. To view the contents of the file, execute the
following command:
#
#
#
#
#
#
cat /etc/nsswitch.ldap
Copyright 2006 Sun Microsystems, Inc.
Use is subject to license terms.
ident "@(#)nsswitch.ldap
1.10
06/05/03 SMI"
#
# /etc/nsswitch.ldap:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses LDAP in conjunction with files.
THESE11-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# the following two lines obviate the "+" entry in /etc/passwd and
/etc/group.
passwd:
files ldap
group:
files ldap
# consult /etc "files" only if ldap is down.
hosts:
ldap [NOTFOUND=return] files
# Note that IPv4 addresses are searched for in all of the ipnodes
databases
# before searching the hosts databases.
ipnodes:
ldap [NOTFOUND=return] files
networks:
protocols:
rpc:
ethers:
netmasks:
bootparams:
publickey:
ldap
ldap
ldap
ldap
ldap
ldap
ldap
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
[NOTFOUND=return]
netgroup:
ldap
automount:
aliases:
files ldap
files ldap
files
files
files
files
files
files
files
auth_attr:
prof_attr:
files ldap
files ldap
project:
files ldap
tnrhtp:
tnrhdb:
#
files ldap
files ldap
LDAP Service
The LDAP client service is managed by using the Service Management
Facility. The LDAP service requires that
svc:/network/ldap/client:default be enabled and online. To
check the state of the LDAP client service execute the following
command:
# svcs -a | grep ldap
disabled
15:26:07
svc:/network/ldap/client:default
# svcs \*ldap\*
STATE STIME FMRI
disabled Aug_24 svc:/network/ldap/client:default
or
THESE11-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# svcs -l network/ldap/client:default
fmri svc:/network/ldap/client:default
enabled true
state online
next_state none
restarter svc:/system/svc/restarter:default
contract_id 1598
dependency require_all/none file://localhost/var/ldap/ldap_client_file ()
dependency require_all/none svc:/network/initial (online)
dependency require_all/none svc:/system/filesystem/minimal (online)
If the first step works, you can try ldaplist passwd username or
ldaplist hosts hostname but if they contain lots of data you might
want to pick a less populated service, or pipe them to head or more.
THESE11-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The best way to show that your client is talking to the LDAP server is
with the ldaplist command. Using ldaplist with no arguments
dumps all the containers on the server. This works as long as the
containers exist, and do not have to be populated. See the ldaplist(1)
man page for more information.
12-1
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Module 12
Purpose of JumpStart
System administrators who need to install multiple systems with similar
configurations can use JumpStart to automate the installation process.
JumpStart eliminates the need for operator intervention during the
installation process.
The advantages of using JumpStart include the following:
It enables system administrators to avoid the lengthy question-andanswer session that is part of the interactive installation process.
Boot services
Identification services
Configuration services
Installation services
THESE12-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
JumpStart Client
JumpStart Client
Install
Services
JumpStart Client
JumpStart
Server
JumpStart Client
Boot
Services
JumpStart Client
Boot
Server
Figure 12-1 JumpStart Server Component Services
Boot Services
To boot a SPARC JumpStart client using the network, clients require
support from a server that can respond to their Reverse Address
Resolution Protocol (RARP), Trivial File Transfer Protocol (TFTP), and
BOOTPARAMS requests. A system that provides these services is called a
boot server. You can configure a boot server to provide any of the other
required JumpStart services, or to only provide boot services.
THESE12-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Identification Services
JumpStart clients require support from a server to automatically get the
answers to system identification questions that the client systems issue.
The identification service is often provided by a boot server, but the
service can be provided by any network server configured to provide
identification.
JumpStart clients can obtain identification information from different
sources, including:
The boot server provides access to a boot image (a root (/) file system)
that all JumpStart clients on the subnet use during the network boot
process. The /etc/bootparams file lists the location of this root (/) file
system and the locations of other directories that the JumpStart client
requires. The /etc/dfs/dfstab file is used to configure JumpStart
servers to share the directories that they provide through NFS.
If the JumpStart client cannot obtain a response from a server for any
identification item, the client interrupts the automatic identification
process and asks for the information.
Configurable With
the sysidcfg File?
Name service
Yes
Yes
Domain name
Yes
No
Name server
Yes
No
Network interface
Yes
No
Host name
Yes
Yes
IP address
Yes
Yes
Netmask
Yes
Yes
Yes
No
Yes
No
Default router
Yes
No
Root password
Yes
No
Security policy
Yes
No
THESE12-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Identification Item
Configurable With
the sysidcfg File?
Locale
Yes
Terminal Type
Yes
No
Time zone
Yes
Yes
Yes
Yes
No
No
NFSv4 Domain
Yes
No
Configuration Services
JumpStart clients require support from a server to obtain answers for
system configuration questions that they issue. A system that provides
this service is called a configuration server.
A configuration server provides information that specifies how the
Solaris Operating System installation proceeds on the JumpStart client.
Configuration information can include:
Installation type
System type
File
Description
The profile
(class) files
The check
script
The rules.ok
file
Optional
begin and
finish scripts
THESE12-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Installation Services
CD-ROM or DVD
An install server can provide installation services by sharing either the
Solaris 10 OS Software DVD or the Solaris 10 OS Software 1 CD-ROM.
The Solaris 10 OS Software DVD and the Solaris 10 OS Software 1 CDROM both contain a boot image and an installation image. Sharing either
of these supports both boot services and installation services.
The installation image found on the Solaris 10 OS Software 1 CD-ROM
only supports installing the Core (SUNWCreq) and Reduced Networking
(SUNWCmreq) software groups. The Solaris 10 OS Software 2, 3, and 4 CDROMs contain the remainder of the installation image, but there is no
support for changing CD-ROMs in the middle of a JumpStart installation
procedure.
The installation
image
THESE12-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
3.
4.
5.
6.
When you use the Solaris 10 DVD source media, you use the
setup_install_server script to spool the entire Solaris 10 OS boot
image and complete installation image to disk. All of the software
associated with all software groups is included on the DVD source media.
When the spooling procedure is complete, the server has the data
available to support boot and installation services for JumpStart clients.
The spooled image also contains the add_install_client script that lets
you configure boot and installation support for specific JumpStart clients.
To spool the Solaris 10 OS boot and installation images to a local disk,
complete the following steps:
1.
# mkdir /export/install
2.
3.
# cd /cdrom/cdrom0/Solaris_10/Tools
Note Solaris releases for SPARC prior to Solaris 10 5/09 will use the
path: /cdrom/cdrom0/s0/Solaris_10/Tools
Newer releases do not have the s0 slice identifier.
4.
# ./setup_install_server /export/install
THESE12-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The Solaris 10 OS Software CD-ROM provides the boot image and the
required portion of the installation image to install the Core(SUNWCreq)
and Minimal Network (SUNCmreq) software groups. The remaining CDROMs provide the rest of the installation image, containing the data
required to install the Minimal Core Metacluster (SUNWCmreq), End
User (SUNWCuser), Developer (SUNWCprog), Entire Distribution
(SUNWCall), and the Entire Distribution with OEM Support software
group (SUNWCXall).
5.
6.
# cd /
# eject cdrom
a.
# cd /cdrom/cdrom0/Solaris_10/Tools
b.
# ./add_to_install_server /export/install
c.
# cd /
# eject cdrom
7.
THESE12-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Keywords
Arguments
name_service {domain_name}
network_interface, hostname,
ip_address , netmask
THESE12-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Table 12-3 Keywords and Arguments Used to Construct the sysidcfg File
Keywords
Arguments
nfs_domain
root_password
root_password=root_password
(encrypted password from /etc/shadow)
security_policy
security_policy=kerberos, NONE
Options for kerberos:
{default_realm=FQDN
admin_server=FQDN kdc=FQDN1,FQDN2,FQDN3}
where FQDN is a fully qualified domain name.
You can list a maximum of three key distribution
centers (KDCs), but at least one is required.
system_locale
system_locale=locale
(entry from the /usr/lib/locale file)
terminal
terminal=terminal_type
(entry from the /usr/share/lib/terminfo
database) for the installation.
timezone
timezone=timezone
(entry from /usr/share/lib/zoneinfo file)
timeserver
Table 12-3 Keywords and Arguments Used to Construct the sysidcfg File (Continued)
# mkdir /export/config
Change the directory to /export/config, and create a file called
sysidcfg using a text editor.
# cd /export/config
# vi sysidcfg
3.
In the sysidcfg file, add the following lines. Substitute values that
are appropriate for your systems, location, and network.
network_interface=bge0 {
primary
protocol_ipv6=no
netmask=netmask_value
default_route=router_IP}
security_policy=none
name_service=none
timezone=timezone
system_locale=locale
timeserver=timeserver_IP
root_password=Hx23475vABDDM
nfs4_domain=dynamic
a.
b.
c.
For the timezone value, enter the correct time zone for your
location. Time zones are listed in the directory structure below
the /usr/share/lib/zoneinfo directory. For example, the
US/Mountain time zone refers to the
/usr/share/lib/zoneinfo/US/Mountain directory.
d.
For the locale value, enter the correct system locale for your
location. Locales are listed in the /usr/lib/locale directory.
e.
THESE12-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
f.
g.
The rules.ok file enables groups of clients with the same characteristics
to be grouped together as a class. Sometimes profile files are also referred
to as class files. A profile file must be named to match the profile file name
you declare in the rules.ok file. The terms profile file or class file are used
to generically identify these files in this description.
The profile file must contain all the information normally provided during
interactive installation about the disk partitioning and software selections
for the JumpStart client. If the JumpStart client cannot obtain a response
from a server for any configuration item, the client interrupts the
automatic configuration process and asks for the information.
Each entry in the rules.ok file lists one or more identifying
characteristics that JumpStart clients can match. When a client finds an
entry in rules.ok that it matches, it uses the profile file associated with
that entry. Clients use only the first entry in the rules.ok file that they
match.
If a JumpStart client checks all the entries in rules.ok but does not find a
match, the client begins an interactive configuration session.
THESE12-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
match_value
begin
profile
finish
The example:
hostname client1 - profile1 causes a JumpStart client called client1 to use a profile file called
profile1. The dash (-) characters before and after the profile1 file
name indicate that the client1 system does not run a begin or a finish
script, respectively.
To configure a simple rules and profile file on a JumpStart server,
complete the following steps:
1.
Create a directory to hold the rules file if this directory does not
already exist. Usually, the /export/config directory holds the
rules file.
# mkdir /export/config
2.
# cd /export/config
# vi rules
3.
# vi profile1
install_type
system_type
partitioning
filesys
filesys
cluster
initial_install
standalone
explicit
cxtxdxs1 512
cxtxdxs0 free
SUNWCXall
6.
swap
/
a.
b.
For example, a simple profile file can contain the following information:
install_type
system_type
partitioning
filesys
filesys
cluster
package
initial_install
standalone
explicit
c0t0d0s0
free
c0t0d0s1
512
SUNWCXall
SUNWman delete
/
swap
This profile file declares that the JumpStart client performs an initial
installation as a standalone system, uses partitioning that allocates
512 Mbytes to the swap area, allocates the remainder of the disk space to
the root (/) file system, the client installs the Entire Distribution with
OEM support software group, and then removes the man pages.
THESE12-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# cd /export/install/Solaris_10/Misc/jumpstart_sample
Copy the check script to the /export/config directory.
# cp check /export/config
3.
# cd /export/config
# ./check
Validating rules...
Validating profile profile2...
The custom JumpStart configuration is ok.
#
4.
If the check script reports an error, edit the rules or profile file to
correct the problem indicated. In the following example, the
profile2 file contains a spelling error. For the example, the
misspelling of the keyword, filesys, causes the check script to
report the following output:
Validating rules...
Validating profile profile2...
Error in file "profile2", line 4
fileys c0t0d0s0 free /
ERROR: Invalid keyword
5.
Once the rules or profile file have been edited to correct any errors,
run the check script again.
# cd /export/config
# ./check
Validating rules...
Validating profile profile1...
The custom JumpStart configuration is ok.
#
2.
client1
An entry for client1 in /etc/ethers could appear as follows:
8:0:20:1c:88:5b client1
The server and path where the rules and profile files are located
(the -c option)
THESE12-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
Edit the /etc/inet/hosts file, and add an entry for the JumpStart
client.
2.
Edit the /etc/ethers file, and add an entry for the JumpStart client.
3.
# cd /export/install/Solaris_10/Tools
The following example supplies the required information for a SPARC
client called client1:
# ./add_install_client -c server1:/export/config -p
server1:/export/config client1 sun4u
saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /export/install" to /etc/dfs/dfstab
making /tftpboot
enabling tftp in /etc/inetd.conf
starting rarpd
starting bootparamd
starting nfsd's
starting nfs mountd
updating /etc/bootparams
copying inetboot to /tftpboot
#
The add_install_client script automatically makes the changes
required to support RARP, TFTP, the bootparams file, and NFS requests
from the client, but it only causes the server to share the installation
directory. Sharing the installation directory allows the JumpStart client to
mount a root (/) file system during the network boot process, and to gain
access to the installation image.
Note The following example shows that for the client to mount the
configuration directory from the server, you must manually edit the
/etc/dfs/dfstab file and add an entry to share the configuration
directory: share -o ro /export/config
FMRI
svc:/network/nfs/mapid:default
svc:/network/nfs/cbd:default
svc:/network/nfs/server:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/client:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/rquota:udp
FMRI
svc:/network/nfs/cbd:default
svc:/network/nfs/client:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/mapid:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/server:default
svc:/network/nfs/rquota:udp
ro,anon=0
ro
""
""
THESE12-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
4.
1.
2.
# init 0
Time
7
Server looks up the host name,
and responds to client
8
9
10
THESE12-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Client
1.
2.
b.
c.
3.
4.
The in.tftpd daemon on the boot server processes the clients TFTP
request. The daemon searches the /tftpboot directory for a file with
a hexadecimal representation of the clients IP address. The
hexadecimal representation is the name of the file. This file is a
symbolic link that points to a network bootstrap program.
5.
6.
7.
8.
9.
10. The server responds with the location of the root (/) file system,
obtained from the appropriate source:
11. After the client obtains its boot parameters, the network bootstrap
program mounts the root (/) file system from the boot server.
12. The client loads its kernel and starts the init program. When the
JumpStart client finishes booting, it attempts to find configuration
information.
Figure 12-2 on page 12-28 shows the JumpStart client boot process. The
following steps describe how a SPARC JumpStart client boots from a boot
server, and starts the installation process:
For boot operations to continue, the following files and directories must
be properly configured on the boot server:
THESE12-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
15. The client runs the suninstall program and installs the Solaris
Operating System.
In the following example, the symbolic link called C00A0A04 points to the
network bootstrap program called inetboot.SUN4U.Solaris_10-1.
# cd /tftpboot
# ls -l
total 280
lrwxrwxrwx
1 root
other
inetboot.SUN4U.Solaris_10-1
and returns the information to the client. The client system uses this
information to mount the directories that it requires using the NFS
service.
The add_install_client script updates the /etc/bootparams file when
you run it to configure boot support for a JumpStart client. The
/etc/bootparams file contains one entry for each JumpStart client that
the boot server supports. Each entry lists the servers and directories that
provide boot, identification, configuration, and installation services.
The options and arguments that you specify when you run the
add_install_client script determine the content of the
/etc/bootparams file. The following example describes an example entry
in the /etc/bootparams file for a JumpStart client named client1:
client1
root=server1:/export/install/Solaris_10/Tools/Boot
install=server1:/export/install
boottype=:in
sysid_config=server1:/export/config
install_config=server1:/export/config
rootopts=:rsize=32768
The add_install_client command that creates the /etc/bootparams
entry in the following example is:
# cd /export/install/Solaris_10/Tools
# ./add_install_client -c server1:/export/config -p
server1:/export/config client1 sun4u
THESE12-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Entry
Definition
client1
root=server1:/export/
install/
Solaris_10/Tools/Boot
install=server1:/
export/install
boottype=:in
sysid_config=server1:/
export/config
THESE12-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Preparation
This exercise requires that you work with a lab partner. You must deside
which lab system is to be configured as the JumpStart server and which
lab system is to be configured as the JumpStart client.
After you deside which lab system has the JumpStart server role, you
must attach and mount a Solaris 10 operating system DVD ISO image on
that system. The ISO images are located in the /opt/ses/dvd directory.
Choose an ISO image approciate for your lab system architecture. For
example:
# uname -a
SunOS host41 5.10 Generic_141444-09 sun4u sparc SUNW,UltraAX-i2
# ls /opt/ses/dvd
sol-10-u8-ga-sparc-dvd.iso sol-10-u8-ga-x86-dvd.iso
# lofiadm -a /opt/ses/dvd/sol-10-u8-ga-sparc-dvd.iso /dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /mnt
# ls /mnt
boot/ License/ Copyright platform/ installer* Solaris_10/
JDS-THIRDPARTYLICENSEREADME
To unmount and detach the ISO image, perform theses steps:
# umount /mnt
# lofiadm -d /dev/lofi/1
This procedure assumes that the SPARC JumpStart client will use
ARP/RARP services to obtain its initial IP address and host name
information.
Task Summary
In this exercise, you perform the following tasks:
Spool the SPARC Solaris boot and installation images from and ISO
image file to disk.
Configure the rules, and profile files, and create a finish script in the
/export/config directory.
Tasks
Creating A Directory For the Install Image
Complete the following steps:
1.
On the Sun Secure Global Desktop, click the icon for opening a
console session on the JumpStart server system.
2.
# cd /mnt/Solaris_10/Tools
3.
# mkdir /export/install/S10_sparc
4.
THESE12-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
5.
On the Sun Secure Global Desktop, click the icon for opening a
console session on the JumpStart client system.
6.
On your client system determine the system MAC address. This can
be done on SPARC based systems at the ok prompt [run level 0] by
running the banner command and looking at the ethernet address
entry.
7.
Edit the /etc/ethers file, and add the MAC address entry using the
information from the previous step for the JumpStart client, for
example:
ok banner
0:3:ba:f2:e5:5
client1
8.
192.10.200.1
192.10.200.100
Edit the /etc/hosts file, and add an entry for the JumpStart client,
if one does not already exist. Add the timehost alias to the
JumpStart server's entry, for example:
server1
client1
9.
loghost
timehost
192.10.200.0 255.255.255.0
10.
# mkdir /export/config
11. If your JumpStart server is a ISO image, change directory to
/ISO/Solaris_10/Misc/jumpstart_sample
# cd /ISO/Solaris_10/Misc/jumpstart_sample
12. If your JumpStart server using the installation DVD and is a SPARCbased system, change directory to
/cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample
# cd /cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample
13. If your JumpStart server using the installation DVD and is an
x86/x64-based system, change directory to
/cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample.
# cd /cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample
/export/config
# cd /export/config
# mv rules rules.orig
16. Create a new file called rules that contains the following entry.
Enter the name of your JumpStart client instead of client1:
hostname
client1
host_class
finish_script
initial_install
standalone
explicit
SUNWCall
c0t0d0s0 10000 /
c0t0d0s1 512 swap
c0t0d0s6 free /usr
18. In the /export/config directory, create a file called finish_script
that contains the following lines.
#!/bin/sh
/usr/bin/touch /a/noautoshutdown
These commands configure the JumpStart client to avoid using the
autoshutdown power-saving feature.
19. Change the permissions on finish_script to 755.
# chmod 755 finish_script
20. Run the /export/config/check program, and correct any problems
in the rules or host_class files that it reports. Verify that the
rules.ok file exists after the check program completes successfully.
# ./check
21. In the /export/config directory, create a file called sysidcfg that
contains the following lines. The string pVKN72yW0kCMs is a
13-character encrypted string for the password cangetin. You could
replace this string with a different encrypted password string by
THESE12-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
FMRI
svc:/network/nfs/mapid:default
svc:/network/nfs/cbd:default
svc:/network/nfs/server:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/client:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/rquota:udp
24. If the NFS server service is disabled, enable it using the svcadm
command.
# svcadm enable network/nfs/server:default
25. Check that the NFS server service is now online.
# svcs -a |grep nfs
STATE
STIME
disabled
14:56:34
online
14:57:13
online
16:01:13
online
16:01:13
online
16:01:14
online
16:01:14
online
16:01:15
FMRI
svc:/network/nfs/cbd:default
svc:/network/nfs/client:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/mapid:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/server:default
copying one from your own /etc/shadow file. Use the netmask
appropriate to your network, and specify the correct Ethernet
interface, timezone, and locale for your system.
16:01:15 svc:/network/nfs/rquota:udp
26. With NFS server service running, run the shareall command, then
check if the /export/config directory is now shared.
/export/config
ro
""
THESE12-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# shareall
# share
#
31. After the JumpStart has successfully completed, login as root using
the password cangetin and verify that the OS is the release you
installed and that the disk partitioning is as you configured:
Solaris 10 10/09 s10s_u8wos_08a SPARC
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 16 September 2009
# df -h
Filesystem
/dev/dsk/c0t0d0s0
/devices
ctfs
proc
mnttab
swap
objfs
sharefs
/dev/dsk/c0t0d0s6
fd
swap
swap
#
size
6.7G
0K
0K
0K
0K
722M
0K
0K
6.8G
0K
721M
721M
used
910M
0K
0K
0K
0K
1.5M
0K
0K
3.2G
0K
312K
48K
avail capacity
5.8G
14%
0K
0%
0K
0%
0K
0%
0K
0%
721M
1%
0K
0%
0K
0%
3.6G
47%
0K
0%
721M
1%
721M
1%
Mounted on
/
/devices
/system/contract
/proc
/etc/mnttab
/etc/svc/volatile
/system/object
/etc/dfs/sharetab
/usr
/dev/fd
/tmp
/var/run
32. Let your instructor know you have completed this exercise.
# cat /etc/release
Booting and Installing x86/x64 Systems Over the Network With PXE
What is PXE?
PXE network boot is a direct network boot. No boot media is required
on the client system. With PXE, you can install an x86/x64-based client
over the network by using DHCP.
PXE network boot is available only for devices that implement the Intel
Preboot Execution Environment specification. To determine if your system
supports PXE network boot, see your hardware manufacturers
documentation.
An install server
A DHCP server
When you are preparing to use PXE to install a client over the network,
consider the following issues.
Set up only one DHCP server on the subnet that includes the client
system that you want to install. The PXE network boot does not
work properly over subnets that include multiple DHCP servers.
THESE12-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You can use DHCP in conjunction with JumpStart to install the Solaris OS
on client systems on your network. All SPARC-based systems that are
supported by the Solaris OS and x86-based systems that meet the
hardware requirements for running the Solaris OS can use this feature.
SPARC-based clients may make use of RARP or DHCP to supply the
identity information they require to boot and begin the system
identification and installation process, but x86/x64 clients that use the
Pre-boot Execution Environment (PXE) only use DHCP for their
configuration.
For this reason, you must configure a DHCP server to support boot and
identification operations of x86/x64-based JumpStart clients. The same
boot server may provide ARP/RARP services for SPARC clients and
DHCP services for x86/x64 clients, or, both SPARC and x86/x64 clients
could use DHCP.
This section focuses on configuring DHCP services to support x86/x64
JumpStart clients. More information about configuring DHCP to support
both x86/x64 and SPARC JumpStart clients is found in the Solaris 10
05/09 Installation Guide: Network-Based Installations, available through
this URL:
http://docs.sun.com/app/docs/doc/819-6395?q=819-6395
THESE12-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When you use the add_install_client script with the -d option on the
JumpStart server, the script creates files in the /tftpboot directory
required to support client boot operations. The add_install_client
script reports DHCP macro configuration information to standard output.
You use this macro configuration information to configure a macro on the
DHCP server, so the JumpStart client can find its files in the /tftpboot
directory.
When you register x86/x64 (PXE) clients with a JumpStart server, always
use the add_install_client script with the -d option.
This add_install_client example configures files in /tftpboot for one
x86/x64 client, and reports the DHCP macro name and the boot options
you must use to properly configure DHCP services for this client.
# ./add_install_client -d -e 0:e0:81:5b:a6:e -s sys06:/export/install/S10_x86 -c sys-06:/export/config -p sys06:/export/config/client2 i86pc
Adding "share -F nfs -o ro,anon=0 /export/install/S10_x86" to
/etc/dfs/dfstab
copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1
If not already configured, enable PXE boot by creating
a macro named 0100E0815BA60E with:
Boot server IP (BootSrvA) : 10.1.1.6
Boot file
(BootFile) : 0100E0815BA60E
#
In this example, the DHCP macro name 0100E0815BA60E and two
options, BootSrvA and BootFile are identified by the
add_install_client script. The BootSrvA and BootFile options
specify the IP address of the boot server, and the file that the PXE client
will use to boot through the network.
Both BootSrvA and BootFile are standard DHCP macro options.
In the /tftpboot directory on the JumpStart server, the
add_install_client script creates this list of files to support this client:
THESE12-46
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The string 0100E0815BA60E in these file names matches the MAC address
of the x86/x64 client, with the 01 prefix added, and was generated in
these names because of the -e 0:e0:81:5b:a6:e option used with the
add_install_client script.
The symbolic link named 0100E0815BA60E matches the BootFile option
you specify in the DHCP macro called 0100E0815BA60E. This symbolic
link points to the pxegrub.I86PC.Solaris_10-1 file, which is the
network boot program that this x86/x64 client will use.
The file named menu.lst.0100E0815BA60E contains the GRUB menu
information that the client uses to continue the boot process once it loads
the pxegrub.I86PC.Solaris_10-1 boot program. As constructed by
add_install_client, the menu.lst.0100E0815BA60E file contains this
information:
# more menu.lst.0100E0815BA60E
default=0
timeout=30
title Solaris_10 Jumpstart
kernel /I86PC.Solaris_10-1/multiboot kernel/unix -B
install_config=10.1.1.6:/export/config,sysid_c
onfig=10.1.1.6:/export/config/client2,install_media=10.1.1.6:/export/inst
all/S10_x86,install_boot=10.1.1.6
:/export/install/S10_x86/boot
module /I86PC.Solaris_10-1/x86.miniroot
Note that the kernel command in this file lists the locations of the NFS
shared resources that the client requires for the JumpStart installation to
proceed. These NFS resources were specified as arguments to the
add_install_client script.
total 268
lrwxrwxrwx
1 root
root
pxegrub.I86PC.Solaris_10-1
dr-xr-xr-x
3 root
root
-rw-r--r-1 root
root
lrwxrwxrwx
1 root
root
pxegrub.I86PC.Solaris_10-1
-rwxr-xr-x
1 root
root
-rw-r--r-1 root
root
#
# vi menu.lst.0100E0815BA60E
default=0
timeout=30
title Solaris_10 Jumpstart
kernel /I86PC.Solaris_10-1/multiboot kernel/unix - install dhcp
-B install_config=10.1.1.6:/export/config
,sysid_config=10.1.1.6:/export/config/client2,install_media=10.1.1.6:/exp
ort/install/S10_x86,install_boot=10.1.1.
6:/export/install/S10_x86/boot
module /I86PC.Solaris_10-1/x86.miniroot
#
Using the macro information provided by the add_install_client
script, you can configure the required DHCP macro using the dhcpmgr
utility. The example procedure provided in the exercise for this section
combines the general DHCP configuration steps with the specific steps
required to create an example macro, using the following information
from add_install_client:
If not already configured, enable PXE boot by creating
a macro named 0100E0815BA60E with:
Boot server IP (BootSrvA) : 10.1.1.6
Boot file
(BootFile) : 0100E0815BA60E
To configure a macro using the dhcpmgr utility, perform the following
steps. These steps assume an appropriate DHCP configuration already
exists on the server used, and that an IP address entry has been assigned
to the JumpStart client.
1.
# /usr/sadm/admin/bin/dhcpmgr&
THESE12-48
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
Select the Macros tab on the DHCP Manager main panel. Select Edit
> Create to create the macro that your JumpStart client requires. The
Create Macro panel displays.
3.
b.
c.
Click Add.
d.
e.
Click Add.
4.
You can use the dhtadm -P command to view the DHCP macros that are
currently defined, and verify the macro information you supplied to
dhcpmgr. For example:
# dhtadm -P
Name
Type
Value
==================================================
0100E0815BA60E
Macro
:BootFile="0100E0815BA60E":BootSrvA=10.1.1.6:
10.0.0.0
Macro
:Subnet=255.255.255.0:RDiscvyF=1:Broadcst=10.0.0.255:
sys-06
Macro
:Include=Locale:Timeserv=10.1.1.6:LeaseTim=86400:LeaseNeg:
Locale
Macro
:UTCoffst=-25200:
#
THESE12-50
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
f.
Preparation
This exercise provides instructions that are compatible with a JumpStart
server that has already been set up to support SPARC JumpStart clients,
as described in the previous exercise, or a system that has not yet been
configured to provide JumpStart services.
This procedure requires Solaris OS installation DVD media for x86/x64based systems.
Task Summary
Follow along as your instructor performs these tasks:
Spool the x86/x64 Solaris boot and installation images from DVD
media to disk.
Configure the rules, and profile files, and create a finish script in the
/export/config directory.
Use the dhcpmgr utility to set up DHCP services and establish DHCP
macros that the x86/x64 client requires.
Tasks
1.
2.
Insert the x64/x86 Solaris 10 OS Software DVD into the DVD drive.
3.
# cd /cdrom/cdrom0/s0/Solaris_10/Tools
4.
# cd /cdrom/cdrom0/s0/Solaris_10/Tools
Note Solaris releases for SPARC prior to Solaris 10 5/09 will use the
path: /cdrom/cdrom0/s0/Solaris_10/Tools
Newer releases do not have the s0 slice identifier.
5.
# mkdir /export/install/S10_x86
6.
Note This process takes between 1.5 and 2 hours typically, depending
on the speed of the DVD drive.
# ./setup_install_server /export/install/S10_x86
Verifying target directory...
Calculating the required disk space for the Solaris_10 product
Calculating space required for the installation boot image
Copying the CD image to disk...
Copying Install Boot Image hierarchy...
Install Server setup complete
#
THESE12-52
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
192.10.200.0 255.255.255.0
8.
# mkdir /export/config
If your server is a SPARC-based system, change directory to
/cdrom/cdrom0/Solaris_10/Misc/jumpstart_sample.
# cd /cdrom/cdrom0/s0/Solaris_10/Misc/jumpstart_sample
10. Copy the content of the jumpstart_sample directory to the
/export/config directory. This step places sample configuration
files, used by JumpStart, in the /export/config directory, which
you use to set up the JumpStart server.
Skip this step if your server already has the sample JumpStart files in
/export/config.
# cp -r
/export/config
11. Change the directory to /export/config. If you copied the
JumpStart sample files to /export/config in the previous step,
move the rules file to rules.orig.
# cd /export/config
# mv rules rules.orig
12. Add the following entry to an existing rules file, or create a new
rules file that contains the following entry. Enter the name of your
JumpStart client instead of client2:
hostname
client2
host_class2
finish_script
9.
install_type
system_type
fdisk
partitioning
cluster
filesys
filesys
filesys
initial_install
standalone
all solaris all
explicit
SUNWCall
rootdisk.s0 10000 /
rootdisk.s1 512 swap
rootdisk.s6 free /usr
THESE12-54
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
For example:
ro
""
share -o ro /export/config
b.
FMRI
svc:/network/nfs/mapid:default
svc:/network/nfs/cbd:default
svc:/network/nfs/server:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/client:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/rquota:udp
FMRI
svc:/network/nfs/cbd:default
svc:/network/nfs/client:default
svc:/network/nfs/status:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/mapid:default
svc:/network/nfs/rquota:ticlts
svc:/network/nfs/server:default
svc:/network/nfs/rquota:udp
/export/config
ro
""
For the argument for the -p option, specify the correct directory
used to hold the clients sysidcfg file.
THESE12-56
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
d.
26. Accept the default storage location of /var/dhcp, and click Next.
The hosts name service panel displays.
THESE12-58
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
25. Select the Text files item, and click Next. The path dialog box
displays.
28.
Use the default lease length value of 1 day, and allow clients to
renew their leases. Click Next. The DNS domain panel displays.
27. Select the /etc/hosts item, and click Next. The lease information
panel displays.
30. Verify that the network address and subnet mask match the values
that are correct for your network. Click Next. The network type and
routing panel displays
THESE12-60
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
32. For this example, no NIS configuration is required. Click Next. The
NIS+ configuration panel displays.
31. In this example, select the Local-Area network type, and choose to
use the router discovery protocol. Click Next. The NIS configuration
panel displays.
34. Verify the settings you have chosen, and use the Back button to go
back and correct any setting you want to change. When your
configuration is correct, click Finish.
THESE12-62
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
33. For this example, no NIS+ configuration is required. Click Next. The
DHCP review panel displays.
36. Set the number of IP addresses to 1 to support one client. Click Next.
The server identification and starting IP address panel displays.
35. The configuration wizard terminates, and a dialog asks if you want
to run the Address Wizard. Click Yes to configure DHCP addresses.
The Add Addresses panel displays.
38. Verify that the list of IP addresses is correct. Use the Back button to
make changes. When the address list is correct, click Next. The
configuration macro panel displays.
THESE12-64
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
37. Verify that the name of your JumpStart server is listed in the
Managed by Server field, and enter the starting IP address you wish
to use. Do not choose to generate client names. Click Next. The
confirm address list panel displays.
40. Select the Dynamic lease type, and click Next. The Review panel
displays.
42. Select the new address entry, and then select Edit > Properties. The
Address properties dialog box displays.
THESE12-66
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
41. Verify that the settings match the configuration you want to use, and
click Finish. The DHCP manager main panel now lists an entry for
the network address you specified. No client name is listed.
44. Select the Macros tab on the DHCP Manager main panel.Select Edit
> Create to create the macro that your JumpStart client requires. The
Create Macro panel displays.
43. Enter the name of your JumpStart client in the Client Name field
(client2 in this example), and click OK.
a.
b.
c.
Click Add.
d.
e.
Click Add.
f.
THESE12-68
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
45. Perform the following steps in the Create Macro dialog box:
47. Select File > Exit to exit from the dhcpmgr utility.
48. Change directory to /tftpboot, and list the menu.lst.xxx file for
your JumpStart Client. The last segment of the menu.lst.xxx file
name reflects the MAC address of your JumpStart client.
# cd /tftpboot
# ls -l *menu.lst*
-rw-r--r-1 root
root
menu.lst.0100E0815BA60E
#
46. When you are finished with these steps, dhcpmgr displays an entry
for the address you specified similar to this:
THESE12-70
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
so it reads:
The flexibility in server and client configuration lets you build JumpStart
services to meet your specific software installation needs.
THESE12-72
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Subnet Restrictions
JumpStart Client
JumpStart Client
JumpStart
Server
JumpStart Client
Boot Server
JumpStart Client
Router
Boot Services
JumpStart Client
2.
3.
# cd /cdrom/cdrom0/s0/Solaris_10/Tools
Note Solaris releases for SPARC prior to Solaris 10 5/09 will use the
path: /cdrom/cdrom0/s0/Solaris_10/Tools
Newer releases do not have the s0 slice identifier.
4.
# ./setup_install_server -b /export/install
5.
# cd /
# eject cdrom
THESE12-74
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# mkdir /export/install
client1
An entry for client1 in the /etc/ethers file could appear as follows:
2.
3.
# cd /export/install/Solaris_10/Tools
8:0:20:1c:88:5b client1
# ./add_install_client -c 192.168.1.201:/export/config -p
192.168.1.200:/export/config -s 192.168.1.200:/export/install
clientA sun4u
saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /export/install/Solaris_10/Tools/Boot"
to /etc/dfs/dfstab
making /tftpboot
enabling tftp in /etc/inetd.conf
starting rarpd
starting bootparamd
starting nfsd's
starting nfs mountd
updating /etc/bootparams
copying inetboot to /tftpboot
#
When you complete this procedure, and meet conditions on the other
servers, you can initiate the installation process on a JumpStart client.
THESE12-76
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
IPv6
Kerberos configuration
Naming service
The sysidcfg file allows you to specify nearly all of the identification
information that a JumpStart client requires. The sysidcfg file can
contain:
SPARC JumpStart clients learn of the location of the sysidcfg file from
BOOTPARAMS information that they obtain from the boot server. When
you run the add_install_client script on the boot server, use the -p
option, and specify the server and path where the sysidcfg file is stored.
The following command indicates that the sysidcfg file that client1
will use is found on the server, server1, in the /export/config
directory.
# ./add_install_client -c server1:/export/config -p
server1:/export/config client1 sun4u
The server, server1, must share the /export/config directory by using
the NFS service before the client can mount it.
THESE12-78
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
network_interface=bge0 {
primary hostname=sys01
ip_address=192.168.2.10
protocol_ipv6=no
netmask=255.255.255.0
default_route=192.168.2.1}
network_interface=qfe0 {
hostname=sys01
ip_address=192.168.2.101
protocol_ipv6=no netmask=255.255.255.0
default_route=192.168.2.1}
network_interface=qfe1 {
hostname=sys02
ip_address=192.168.2.111
protocol_ipv6=no netmask=255.255.255.0
default_route=192.168.2.1}
THESE12-80
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The second rule matches a machine with host name client2. The
class file is class_basic_user.
The fifth rule matches a machine using SPARC architecture and with
a memory size between 64 and 106 Mbytes. The class file is
class_prog_user.
Begin Scripts
The following example begin script causes the JumpStart client to copy its
existing /etc/passwd and /etc/shadow files to a directory on an NFS
server:
#!/bin/sh
HOSTNAME=`/bin/uname -n`
mount 192.10.10.100:/backup /mnt
if [ ! -d /mnt/${HOSTNAME} ]; then
mkdir /mnt/${HOSTNAME}
fi
if [ -d /mnt/${HOSTNAME} ]; then
mount /dev/dsk/c0t0d0s0 /a
cp /a/etc/passwd /a/etc/shadow /mnt/${HOSTNAME}
umount /a
fi
umount /mnt
This example script works only if the following conditions exist:
The JumpStart client has a previously installed root (/) file system
available as /dev/dsk/c0t0d0s0
This example script shows that a begin script can mount disk resources
from other systems, mount resources from the client itself, and copy files
between those mounted directories. File systems that exist on the client
are available using their standard logical device names. NFS provides
access to shared directories on the network. The mount points /a and
/mnt are available in the root (/)file system when the JumpStart client
mounts from the boot server.
THESE12-82
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Begin scripts are Bourne scripts that JumpStart clients run before installing
the Solaris OS. Begin scripts allow you to perform a variety of tasks on the
JumpStart client. Typically, you would use a begin script to back up data
from the client before proceeding with the Solaris OS installation.
would cause a JumpStart client called client1 to use the begin script
called begin1.
Keywords
Arguments
install_type
initial_install | upgrade |
flash_install | flash_upgrade
system_type
standalone | server
partitioning
cluster cluster_name
add | delete
package package_name
add | delete
timeout
minutes
retry
number
usedisk
disk_name
dontuse
disk_name
locale
locale_name
num_clients
number
client_swap
size
client_arch
kernel_architecture
filesys
metadb
patch
patch_id_list | patch_file
patch_location
archive_location
retrieval_type location
pool
ZFS_root_pool_name
bootenv
installbe
bename
Live_Upgrade_boot_environment_name
THESE12-84
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Reduced Network
SUNWCrnet
Core
SUNWCreq
End User
SUNWCuser
Developer
SUNWCprog
Entire Distribution
SUNWCall
SUNWCXall
Note See the Solaris 10 System Release and Installation Collection for a
description of the clusters and packages available on the Solaris 10
Software Distribution CD-ROMs.
In the following example, the profile indicates that the custom JumpStart
program creates an empty boot environment. An empty boot environment
contains no file systems and no copy from the current boot environment
occurs. The boot environment can be populated later with a Solaris Flash
archive and then activated.
# profile keywords
profile values
# ---------------------------------install_type
initial_install
system_type
standalone
partitioning
explicit
filesys
c0t0d0s0 auto /
filesys
c0t3d0s1 auto swap
filesys
any auto usr
cluster
SUNWCall
bootenv createbe bename second_BE \
filesystem /:/dev/dsk/c0t1d0s0:ufs \
filesystem -:/dev/dsk/c0t1d0s0:swap \
filesystem /export:shared:ufs
4096 /
4096 /usr
4096 /usr
free /export/home
THESE12-86
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Finish Scripts
The following example finish script causes the JumpStart client to turn off
automatic shutdown for power management, retrieve its backed-up
/etc/passwd and /etc/shadow files from a directory on an NFS server,
and copy a file from the configuration server to the JumpStart client.
#!/bin/sh
touch /a/noautoshutdown
HOSTNAME=`/bin/uname -n`
mount 192.10.10.100:/backup /mnt
if [ -d /mnt/${HOSTNAME} ]; then
echo "Copying passwd and shadow..."
cp /mnt/${HOSTNAME}/passwd /a/etc/passwd
cp /mnt/${HOSTNAME}/shadow /a/etc/shadow
fi
umount /mnt
mkdir /a/labfiles
cp ${SI_CONFIG_DIR}/files/setup.tar /a/labfiles
This example script works if the following conditions exist:
Finish scripts are Bourne scripts that JumpStart clients run after installing
the Solaris Operating System but before they reboot. Finish scripts allow
you to perform a variety of post-installation tasks on the JumpStart client,
including:
THESE12-88
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Flash Archive
2.
# cd /cdrom/cdrom0/Solaris_10/Tools
The boot and installation services can be loaded from the following:
a.
b.
c.
d.
THESE12-90
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
There are certain advantages to using a Flash archive for the installation.
These include:
THESE12-92
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Starting with the first release of Solaris 10, new keywords have been
added to enhance the JumpStart process. These keywords can greatly
reduce the installation time and eliminate in some cases the need for
finish scripts.
initial_install
SUNWCXall
mirror
c0t0d0s0
mirror:d10 c0t0d0s3
c0t0d0s1
c1t3d0s1
c0t0d0s7
c1t3d0s7
mirror
c0t0d0s6
c0t0d0s7
c1t3d0s7
c1t3d0s0
c1t3d0s3
count 4
count 4
c1t3d0s6
850
1000
512
512
/
/var
swap
5000 /usr
free /export/home
free
2.
3.
The root (/) file system is created and mirrored on the slices
c0t0d0s0 c1t3d0s0 and is 850 Mbytes in size. The resulting RAID
volumes are automatically assigned names as none is specified.
4.
5.
6.
7.
Four state database replicas are created on slice c0t0d0s4 and slice
c1t3d0s4.
8.
9.
THESE12-94
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
NFS server
HTTP server
Local device
Local file
The syntax for the entry in the profile varies depending on the location
selected, as shown in Table 12-7.
Table 12-7 Package Syntax
Package Source
Syntax example
NFS
HTTP
local_device
local_file
You can install a package from a local device such as a diskette or a CDROM. You must specify the full device pathname. If the full pathname is
not specified, /dev/dsk is added to the pathname. If you do not specify
the filesystem type, ufs is tried first and hsfs is tried second.
The path is relative to the / (root) of the device specified. The following
example shows the proper syntax:
package SUNWname add local_device device path file_system_type
For example, a package installation from the local CD-ROM with an HSFS
file system uses the following entry in the JumpStart profile file:
package SUNWnewpkg add local_device c0t6d0s0 /solaris10/pkg
A package can be installed if it is part of the miniroot. The miniroot is a
DVD, CD, or NFS mounted directory from which the system is booted.
You can access any file that is part of the miniroot during the JumpStart
installation. The following example shows the proper syntax for adding
packages from a local file:
package SUNWname add local_file path
For example:
package SUNWnewpkg add local_file /solaris10/pkg
THESE12-96
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
package
package
package
package
package
package
If you specify a location for a package in the profile file and do not specify
a specific location for those packages following the package listed with
the location, the subsequent packages are assumed to be in the same
location as the first package. For example:
NFS server
HTTP server
Local device
Local file
Syntax Example
NFS
HTTP
patch 112233-01,223344-04
http://sys01/solaris10/patches
patch list_file http://sys01/solaris10/patches
local_device
local_file
THESE12-98
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
or
You can provide the name of the boot environment and you can create a
separate /var dataset with existing bootenv and installbe
keywords and the new bename and dataset options.
Some keywords that are allowed in a UFS-specific profile are not allowed
in a ZFS specific profile, such as those specifying the creation of UFS
mount points.
Note For overall ZFS planning information, see Chapter 6, ZFS Root
File System Installation (Planning), in Solaris 10 05/09 Installation Guide:
Planning for Installation and Upgrade.
The following is an example entry in a JumpStart profile file to install a
ZFS root file system:
pool pool1 auto auto auto mirror c0t0d0s0 c0t1d0s0
The keyword pool defines the name of the root pool. auto specifies the size
of the disks automatically. The size is determined by the size of the
specified disks.
The second auto configures the swap area to be automatically sized. The
default size is 1/2 the size of physical memory, but no less than 512
Mbytes and no greater than 2 Gbytes. You can set the size outside this
range by using the size option.
The third auto configures the dump device to be automatically sized. The
mirrored configuration of disks has the mirror keyword and disk slices
specified as c0t0d0s0 and c0t1d0s0.
The following is another example specifying the size of the disk slice to be
80 Gbytes and the swap area and dump volumes to be 2 Gbytes in size:
pool newpool 80g 2g 2g mirror any any
THESE12-100
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Beginning with the Solaris 10 10/08 release, you can use JumpStart to
install a ZFS root file system. The profile must contain the pool keyword.
The pool keyword installs a new root pool, and a new boot environment
is created by default.
2.
The ZFS Flash archive (flar) contains the entire pool hierarchy, except for
the swap and dump volumes and any excluded datasets. The swap and
dump volumes are created when the Flash archive is installed.
For example, to create a flar of the ZFS root pool
# flarcreate -n zfs10u8BE zfs10u8flar
Full Flash
Checking integrity...
Integrity OK.
Running precreation scripts...
Precreation scripts done.
Determining the size of the archive...
The archive will be approximately 4.94GB
Creating the archive...
Archive creation complete.
Running postcreation scripts...
Postcreation scripts done.
Running pre-exit scripts...
Pre-exit scripts done.
Note See the JumpStart Keywords for a ZFS Root (/) File System
(Reference) section in the Solaris 10 05/09 Installation Guide: Custom
JumpStart and Advanced Installations.
Note For a complete installation method, refer to the new section in the
ZFS Administration Guide: Installing a ZFS Root File System (Flash Archive
Installation).
Some dependencies and requirements for a ZFS root flash install include:
ZFS flar installs are only supported on systems with the same
architecture. For example, a flar created on a sun4u system will not
work on a sun4v system.
The ZFS flar can only be used to install a ZFS root file system, not
UFS.
The flar info command is not supported for a ZFS Flash archive
and returns the following error:
# flar info -l zfs10u8flar
ERROR: archive content listing not supported for zfs
archives.
THESE12-102
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
install_type flash_install
archive_location nfs system:/export/jump/zfs10u8flar
partitioning explicit
pool rpool auto auto auto mirror c0t1d0s0 c0t0d0s0
Starting with the Solaris 10 1/06 release, when non-global zones are
installed, you can use the custom JumpStart program to upgrade. For an
automated JumpStart installation, you can upgrade or patch with any
keyword that applies to an upgrade or patching. In releases prior to
Solaris 10 08/07, only a limited number of keywords could be used. The
time to upgrade or patch might be extensive, depending on the number of
non-global zones that are installed.
THESE12-104
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# df -h /
Filesystem
/dev/dsk/c0t0d0s0
2.
size
5.8G
used
4.1G
avail capacity
1.7G
72%
Mounted on
/
# format -e
Searching for disks...done
While still in the format -e utility, determine that the second drive
does not have an EFI label on it. If the "Specify Label type" lists a
"1" then the disk has an EFI label and it must be removed and
labeled with an SMI label as shown:
(output ommitted)
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]:
Warning: This disk has
current partitions.
Continue? yes
Auto configuration via
Auto configuration via
0
an EFI label. Changing to SMI label will erase all
format.dat[no]? no
generic SCSI-2[no]? no
1.
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6
usr
7 unassigned
Flag
wm
wu
wu
wm
wm
wm
wm
wm
Cylinders
0 25
26 51
0 - 14086
0
0
0
52 - 14086
0
Size
129.19MB
129.19MB
68.35GB
0
0
0
68.10GB
0
Blocks
(26/0/0)
264576
(26/0/0)
264576
(14087/0/0) 143349312
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(14035/0/0) 142820160
(0/0/0)
0
partition> modify
Select partitioning base:
0. Current partition table (default)
1. All Free Hog
Choose base (enter number) [0]? 1
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6
usr
7 unassigned
Flag
wm
wu
wu
wm
wm
wm
wm
wm
Cylinders
0
0
0 - 14086
0
0
0
0
0
Size
0
0
68.35GB
0
0
0
0
0
Blocks
(0/0/0)
0
(0/0/0)
0
(14087/0/0) 143349312
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
a new partition
yes
0c,
0c,
0c,
0c,
0c,
0c,
0.00mb,
0.00mb,
0.00mb,
0.00mb,
0.00mb,
0.00mb,
0.00gb]:
0.00gb]:
0.00gb]:
0.00gb]:
0.00gb]:
0.00gb]:
0
0
0
0
0
0
THESE12-106
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
format> partition
(output ommitted)
partition> print
Current partition table (default):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Cylinders
0 - 14086
0
0 - 14086
0
0
0
0
0
Size
68.35GB
0
68.35GB
0
0
0
0
0
Blocks
(14087/0/0) 143349312
(0/0/0)
0
(14087/0/0) 143349312
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
(0/0/0)
0
Edit the profile file for the client on the JumpStart server to include
the required JumpStart keywords to configure the ZFS root pool with
both disks mirrored and to create a Live Upgrade boot environment:
# vi /export/config/host_class
install_type
initial_install
system_type
standalone
pool zpool1 auto auto auto mirror c0t0d0s0 c0t1d0s0
bootenv installbe bename sol-10u8
The previous profile configuration performs an initial installation
specified with install_type initial_install in a new ZFS root pool,
identified with pool zpool1, whose size is automatically sized with
the auto keyword to the size of the specified disks.
The swap area and dump device are automatically sized with other
auto keywords, in a mirrored configuration of disks (with the mirror
keyword and disks specified as c0t0d0s0 and c0t1d0s0).
Boot environment characteristics are set with the bootenv keyword
to install a new BE [Boot Environment] with the keyword
installbe and a bename named sol-10u8 is created.
Note More information about Live Upgrade is covered in the next
module.
Part
Tag
0
root
1
swap
2
backup
3 unassigned
4 unassigned
5 unassigned
6
usr
7 unassigned
Processing profile
- Saving Boot Environment Configuration
- Selecting cluster (SUNWCall)
- Selecting all disks
- Configuring boot device
- Configuring / (c0t0d0s0)
- Configuring (c0t1d0s0)
- Automatically configuring disks for Solaris operating system
Verifying disk configuration
Verifying space allocation
- Total software size:
4157.69 Mbytes
THESE12-108
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# init 0
# zpool list
NAME
SIZE
zpool1 14.1G
# zpool
pool:
state:
scrub:
config:
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
Mbytes
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
remaining.
When the system has finished the JumpStart, login and examine the
ZFS root pool configuration. The zpool list command shows that
the creation of the root ZFS pool has been created:
USED
5.15G
8.
4157.35
4157.27
4141.81
4137.45
4122.53
4122.46
4121.81
4120.56
4096.19
4093.83
4081.43
AVAIL
8.97G
CAP
36%
HEALTH
ONLINE
ALTROOT
-
status -v
zpool1
ONLINE
none requested
NAME
zpool1
mirror
c0t0d0s0
c0t1d0s0
STATE
ONLINE
ONLINE
ONLINE
ONLINE
# zfs list
NAME
zpool1
zpool1/ROOT
zpool1/ROOT/sol-10u8
zpool1/dump
zpool1/export
zpool1/export/home
zpool1/swap
USED
5.59G
4.22G
4.22G
896M
38K
18K
512M
AVAIL
8.31G
8.31G
8.31G
8.31G
8.31G
8.31G
8.75G
REFER
96.5K
18K
4.22G
896M
20K
18K
59.0M
MOUNTPOINT
/zpool1
legacy
/
/export
/export/home
-
10. Execute the df -h command to see all of the other file systems that
were created during the JumpStart process:
# df -h
Filesystem
zpool1/ROOT/sol-10u8
/devices
ctfs
proc
mnttab
swap
objfs
sharefs
fd
swap
swap
zpool1/export
zpool1/export/home
zpool1
size
14G
0K
0K
0K
0K
345M
0K
0K
0K
345M
344M
14G
14G
14G
used
4.2G
0K
0K
0K
0K
464K
0K
0K
0K
160K
40K
20K
18K
96K
avail capacity
8.3G
34%
0K
0%
0K
0%
0K
0%
0K
0%
344M
1%
0K
0%
0K
0%
0K
0%
344M
1%
344M
1%
8.3G
1%
8.3G
1%
8.3G
1%
Mounted on
/
/devices
/system/contract
/proc
/etc/mnttab
/etc/svc/volatile
/system/object
/etc/dfs/sharetab
/dev/fd
/tmp
/var/run
/export
/export/home
/zpool1
Is
Complete
-------yes
Active
Now
-----yes
Active
On Reboot
--------yes
Can
Delete
-----no
Copy
Status
----------
13. Let your instructor know you have completed this exercise.
THESE12-110
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
9.
Troubleshooting JumpStart
Troubleshooting JumpStart
Fail to boot
Fail to partition disks or create file systems, and fail to load the
Operating System
If any of the four main JumpStart services are improperly configured, the
JumpStart clients can:
Troubleshooting JumpStart
then the JumpStart client cannot obtain RARP services from a boot server.
Check to make sure in.rarpd is running on the server. This message
probably indicates that the /etc/ethers or /etc/inet/hosts file on the
boot server is not correctly configured. To correct this problem, edit these
files, and ensure that the MAC address and host name for the client in the
/etc/ethers file, and that the IP address and host name for the client in
the /etc/inet/hosts file are correct.
Other problems to check for that can cause this error message:
Enter the commands required to update the name service in use. Usually,
the messages these commands issue will indicate whether an update for
the /etc/ethers or /etc/inet/hosts files was successful.
Check all of the physical network connections between the client and the
boot server to eliminate a potential source of the updating problem.
THESE12-112
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Troubleshooting JumpStart
# ./add_install_client -c server1:/export/config -p
server1:/export/config client1 sun4u
If you specify the incorrect platform group for the client when you run the
add_install_client script, the client might hang, or issue additional
error messages and panic early in the boot process. To solve this problem,
run the rm_install_client script and then the add_install_client
script, and specify the correct platform group.
If the boot server is not configured to allow the in.tftpd daemon to run
on demand, the client hangs. Usually, the add_install_client script
automatically modifies the boot server to provide this service. To correct
this problem, run the following commands to enable the TFTP service.
Check to see if the TFTP service is available:
# inetadm | grep tftp
If the command does produce any output, edit the
/etc/inet/inetd.conf file and ensure the following line is present:
# vi /etc/inet/inetd.conf
# TFTPD - tftp server (primarily used for booting)
tftp dgram
udp6
wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
svc:/network/ftp:default
svc:/network/tftp/udp6:default
Other problems to check for that can cause this message to appear:
Troubleshooting JumpStart
THESE12-114
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
23e00
Troubleshooting JumpStart
The previous items can only be provided using the sysidcfg file.
You can use the sysidcfg file to provide information that a name service
could otherwise provide. You must verify the content of the sysidcfg file or
any information that it provides. Information provided in the sysidcfg file
overrides information in name services.
Troubleshooting JumpStart
The information that the client requests usually indicates what is missing
or improperly configured. Incompatible configuration information causes
the client to display a panel that describes the problem.
THESE12-116
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Troubleshooting JumpStart
To correct this error, edit the profile file that the client uses, and correct the
problem indicated.
Troubleshooting JumpStart
Any directory listed in the /etc/bootparams file on the boot server must
be shared by the server providing the directory.
Begin and finish script problems can be the most troublesome of all issues
related to JumpStart. Any error possible in a shell script is possible in one
of these scripts. Debugging begin and finish scripts might involve
multiple attempts at booting the JumpStart client, or otherwise
performing trial runs of the scripts.
After writing begin or finish scripts, you must verify that these scripts are
referenced in the appropriate rule in the rules file. You must also
remember to run the check script to regenerate the rules.ok file.
THESE12-118
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Troubleshooting JumpStart
These logs contain standard output and error messages from begin
scripts, finish scripts, the Solaris OS software installation process, and the
system identification process that the client performs.
JumpStart clients retain a corresponding set of log files after the
installation process completes and the system reboots:
/var/sadm/system/logs/begin.log
/var/sadm/system/logs/finish.log
/var/sadm/system/logs/install_log
/var/sadm/system/logs/sysidtool.log
/tmp/begin.log
/tmp/finish.log
/tmp/install_log
/var/sadm/system/logs/sysidtool.log
Troubleshooting JumpStart
Notes:
THESE12-120
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
13-1
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Module 13
Upgrade a system.
THESE13-2
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Changing the state of the system in the ABE for reasons including
the following:
The patches listed in infodoc 206844 are subject to change at any time.
These patches potentially fix defects in Solaris Live Upgrade, as well as fix
defects in components that Solaris Live Upgrade depends on. If you
experience any difficulties with Solaris Live Upgrade, please check and
make sure that you have the latest Solaris Live Upgrade patches installed.
THESE13-4
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Solaris 8 OS
Solaris 9 OS
Solaris 10 OS
Identify file systems that contain directories that you want to share
between boot environments rather than copy. If you want a directory
to be shared, you need to create a new boot environment with the
directory put on its own slice. The directory is then a file system and
can be shared with future boot environments.
Do not overlap slices when re-slicing disks. If this condition exists, the
new boot environment appears to have been created, but when activated,
the boot environment does not boot. The overlapping file systems might
be corrupted.
For Solaris Live Upgrade to work properly, the vfstab file on the active
boot environment must have valid contents and must have an entry for
the root (/) file system at the minimum.
Can be on different physical disks or the same disk as the active root
(/) file system.
THESE13-6
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When you create file systems for a boot environment, the rules are
identical to the rules for creating file systems for the Solaris OS. Solaris
Live Upgrade cannot prevent you from creating invalid configurations for
critical file systems. For example, you could type a lucreate command
that would create separate file systems for root (/) and /kernel which is
an invalid division of the root (/) file system.
You can configure a swap slice in three ways by using the lucreate
command with the -m option:
If you do not specify a swap slice, the swap slices belonging to the
current boot environment are configured for the new boot
environment.
If you specify one or more swap slices, these slices are the only swap
slices that are used by the new boot environment. The two boot
environments do not share any swap slices.
You can specify to both share a swap slice and add a new slice for
swap.
The following examples show the three ways of configuring swap. The
current boot environment is configured with the root (/) file system on
c0t0d0s0. The swap file system is on c0t0d0s1.
THESE13-8
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
A boot environment creation fails if the swap slice is being used by any
boot environment except for the current boot environment. If the boot
environment was created using the -s option, the alternate-source boot
environment can use the swap slice, but not any other boot environment.
After the slice is defined, you can reconfigure the file systems on the new
boot environment before the file systems are copied into the directories.
You reconfigure file systems by splitting and merging them, which
provides a simple way of editing the /etc/vfstab file to connect and
disconnect file system directories. You can merge file systems into their
parent directories by specifying the same mount point. You can also split
file systems from their parent directories by specifying different mount
points.
After file systems are configured on the inactive boot environment, you
begin the automatic copy. Critical file systems are copied to the
designated directories. Shareable file systems are not copied, but are
shared. The exception is that you can designate some shareable file
systems to be copied. When the file systems are copied from the current to
the inactive boot environment, the files are directed to the new directories.
The current boot environment is not changed in any way.
THESE13-10
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
LU Command
Description
lu
luactivate
lucancel
lucompare
lucreate
lucurr
ludelete
lufslist
lumake
lumount/
luumount
lurename
lustatus
luupgrade
1.
Make a full flash archive of the currently running system for use as
the base master flash archive.
THESE13-12
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# prtvtoc /dev/rdsk/c1t0d0s2
* /dev/rdsk/c1t0d0s2 partition map
...
*
First
Sector
Last
* Partition Tag Flags
Sector
Count
Sector
0
2
00
2097414 67963725 70061138
1
3
01
0
2097414
2097413
2
5
00
0 71127180 71127179
4
0
00
70061139
8667 70069805
Mount Directory
/
00
00
70069806
70078473
8667
1048707
70078472
71127179
/export/home
# mount
...
/ on /dev/dsk/c1t0d0s0 ...
/export/home on /dev/dsk/c1t0d0s7 ...
...
3.
Check that the partitioning on the second disk matches that of the
first disk.
# prtvtoc /dev/rdsk/c1t1d0s2
* /dev/rdsk/c1t1d0s2 partition map
*
...
*
* Partition
0
1
2
4
5
7
Tag
2
3
5
0
0
8
5.
First
Sector
Flags
Sector
Count
00
2097414 67963725
01
0
2097414
00
0 71127180
00
70061139
8667
00
70069806
8667
00
70078473
1048707
Last
Sector
70061138
2097413
71127179
70069805
70078472
71127179
Mount Directory
THESE13-14
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
5
7
# lucreate -c "sys_env_1"
-m /:/dev/dsk/c1t1d0s0:ufs -n "sys_env_2"
# lufslist sys_env_2
boot environment name: sys_env_2
Filesystem
fstype
device size Mounted on
Mount
Options
------------------------------------------------------------------------/dev/dsk/c1t0d0s1
swap
1073875968 /dev/dsk/c1t1d0s0
ufs
34797427200 /
/dev/dsk/c1t0d0s7
ufs
536937984 /export/home
Note that in the sys_env_2 environment listing, /export/home still
shows on the first disk, c1t0d0. This is also true for swap. This is because
both swap and /export/home are being shared between the two
environments; they were not cloned to the new BE. Only the root file
system shows on the second disk, c1t1d0s0. (When the source of the
cloning contains separate file systems for /, /usr, /var, or /opt, these
critical file systems are required for the new boot environment and
therefore will be copied.)
THESE13-16
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# lufslist sys_env_1
Boot Environment
Name
-------------------------sys_env_1
sys_env_2
Is
Complete
-------yes
yes
Active
Now
-----yes
no
Active
On Reboot
--------yes
no
Can
Delete
-----no
yes
Copy
Status
----------
# cd /etc/lu/compare
# ls
sys_env_1:sys_env_2
# more sys_env_1:sys_env_2
/:root:root:22:40755:DIR:
/lost+found:root:root:2:40700:DIR:
/export:root:sys:3:40755:DIR:
/var:28385:100:44:40775:DIR:
/var/sadm:root:other:13:40755:DIR:
/var/sadm/install:root:bin:4:40555:DIR:
/var/sadm/install/admin:root:bin:2:40555:DIR:
...
9.
When you are ready to switch and make the new boot environment
active, you use the luactivate command to activate the new boot
environment and reboot. Files are synchronized between boot
environments the first time that you boot a newly created boot
environment. Activate the sys_env_2 environment with the
luactivate command.
# luactivate sys_env_2
**********************************************************************
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
**********************************************************************
# lufsstatus
Is
Complete
-------yes
yes
Active
Now
-----yes
no
Active
On Reboot
--------no
yes
Can
Delete
-----no
no
Copy
Status
----------
Is
Complete
-------yes
yes
Active
Now
-----no
yes
Active
On Reboot
--------no
yes
Can
Delete
-----yes
no
Copy Name
Status
----------
THESE13-18
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
You fall back to the previous boot environment the following ways:
Table 13-3 Solaris Live Upgrade Fallback Problems and Actions
Problem
Action
If a failure occurs, you can quickly fall back to the original boot
environment with an activation and reboot. The use of fallback takes only
the time to reboot the system, which is much quicker than backing up and
restoring the original. The new boot environment that failed to boot is
preserved. The failure can then be analyzed. You can only fall back to the
boot environment that was used by luactivate to activate the new boot
environment.
# cd /var/spool/pkgs
# pkgadd -d .
The following packages are available:
1 SMCtop
top
(sparc) 3.5.1
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1
THESE13-20
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# pkginfo -l SMCtop
PKGINST: SMCtop
...
Use the lucompare command to compare the two boot
environments.
Examine the first few lines of the compare file to see the type of
information it contains.
# more environ_compare_2_to_1
< sys_env_2
> sys_env_1
Sizes differ
01 < /var/sadm/install/contents:root:root:1:100644:REGFIL:22638869:
02 > /var/sadm/install/contents:root:root:1:100644:REGFIL:22637090:
Checksums differ
01 <
/var/sadm/install/.lockfile:root:root:1:100600:REGFIL:128:1845941275:
02 >
/var/sadm/install/.lockfile:root:root:1:100600:REGFIL:128:582217747:
Sizes differ
01 < /var/sadm/pkg/SUNWcsu/pkginfo:root:root:1:100644:REGFIL:7214:
02 > /var/sadm/pkg/SUNWcsu/pkginfo:root:root:1:100644:REGFIL:5897:
...
3.
# mkdir /a
# lumount sys_env_1 /a
/a
2.
# mount
...
/a on /dev/dsk/c1t0d0s0 ...
...
THESE13-22
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
3.
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
THESE13-24
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
2.
3.
Use c2t0d0
When prompted for the / and swap devices via the menu, select
those devices appropriate for the new boot environment that is being
created.
# lucreate -n "sys_env_3" -s ...
Updating system configuration files.
...
Since lucreate cannot determine the new / device on its own, the
menu appears and you need to specify, with the F2, ENTER and F3
keys, the / and swap devices:
Active boot environment - None
Mount Point
Device
FS Type
Size (MB)
% Used
Device
FS Type
Size (MB)
ufs
swap
F4
SLICE
F5
PRINT
F6
F7
F8
CANCEL SCHEDULE SPLIT
Min
0
0
F9
MERGE
^D ^X
CLR OTHR
# luumount /a
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
Note The menu appeared because the root file system location was not
specified on the lucreate command line. The menu would not have
appeared if this command were used instead:
# lucreate -n "sys_env_3" -s - -m /:/dev/dsk/c2t0d0s0:ufs
4.
Use the lustatus command to see all statuses for the boot
environments.
# lustatus
Boot Environment
Name
-------------------------sys_env_1
sys_env_2
sys_env_3
Is
Complete
-------yes
yes
no
Active
Now
-----no
yes
no
Active
On Reboot
--------no
yes
no
Can
Delete
-----yes
no
yes
Copy
Status
----------
#
#
#
#
mount /dev/dsk/c1t0d0s0 /a
cd /a/xxx
cp master* diff* /
umount /a
6.
# mkdir /net2
# mount 192.168.201.1:/export/install /net2
# mount
...
/net2 on 192.168.201.1:/export/install...
...
7.
THESE13-26
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
8.
Run the luupgrade command again but this time without the dry
run option.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS
COMPUTER IS STRICTLY PROHIBITED
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
9.
10. Use the luupgrade command to apply the differential flash archive
to the new sys_env_3 BE. Reference the profile just created.
# luupgrade -f -n sys_env_3 -s /net2/SunOS5.10_0509_sun4 -j /profile \
-l /errorlog
Validating the contents of the media </net2/SunOS5.10_0509_sun4>.
The media is a standard Solaris media.
Validating the contents of the miniroot
</net2/SunOS5.10_0509_sun4/Solaris_10/Tools/Boot>.
Locating the flash install program.
Checking for existence of previously scheduled Live Upgrade requests.
Constructing flash profile to use.
Performing the operating system flash update of the BE <sys_env_3>.
CAUTION: Interrupting this process may leave the boot environment
unstable or unbootable.
Extracting Flash Archive: 100% completed (of 162.01 megabytes)
The operating system flash update completed.
The Live Flash Update of the boot environment <sys_env_3> is complete.
11. Check the status of the BE.
# lustatus
Boot Environment
Is
Active Active
Can
Copy
Name
Complete Now
On Reboot Delete Status ------------------------- -------- ------ --------- ------ ---------sys_env_1
yes
no
no
yes
sys_env_2
yes
yes
yes
no
sys_env_3
yes
no
no
yes
12. Make sys_env_3 active.
# luactivate sys_env_3
**********************************************************************
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
THESE13-28
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# cat /profile
install_type flash_update
archive_location local_file /differ_flar_on_sys_env_1_new_pkg.flar
no_content_check
no_master_check
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
Is
Complete
-------yes
yes
yes
Active
Now
-----no
yes
no
Active
On Reboot
--------no
no
yes
Can
Delete
-----yes
no
no
Copy
Status
----------
14. Since the lustatus command reports that the next system reboot
will activate the sys_env_3 BE, note the procedure to fall back to the
current boot environment. Then, at the system console, reboot the
system with the init 6 command.
# init 6
15. When the system comes back up, use the lustatus command to
verify that the sys_env_3 BE is now active.
# lustatus
Boot Environment
Name
Is
Active Active
Can
Copy
Complete Now
On Reboot Delete Status
**********************************************************************
Example Procedure: Applying a Differential Flash Archive Using Live Upgrade BEs
-------------------------sys_env_1
sys_env_2
sys_env_3
-------yes
yes
yes
-----no
no
yes
--------no
no
yes
-----yes
yes
no
----------
# pkginfo -l SMCtop
PKGINST: SMCtop
...
Reverting to a previous BE
17. Make sys_env_1 the active and currently running environment
again.
# luactivate sys_env_1
# init 6
18. Use the lustatus command to verify that sys_env_1 is again active
and currently running.
# lustatus
Boot Environment
Name
-------------------------sys_env_1
sys_env_2
sys_env_3
Is
Complete
-------yes
yes
yes
Active
Now
-----yes
no
no
Active
On Reboot
--------yes
no
no
Can
Delete
-----no
yes
yes
Copy
Status
----------
THESE13-30
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
16. Verify that the differential archive has been applied by verifying that
the SMCtop package is included in the system.
Use the following steps when you need to upgrade or patch a ZFS root
file system with zone roots on ZFS. These updates can either be a system
upgrade or the application of patches.
In the steps that follow, newBE, is the example name of the boot
environment that is upgraded or patched.
Note This example uses the system that was JumpStarted in Exercise 3:
(Optional) Creating a ZFS Mirrored Root Pool from Module 13.
1.
# lustatus
Boot Environment
Name
-------------------------sol-10u7
2.
Is
Complete
-------yes
Active
Now
-----yes
Active
On Reboot
--------yes
Can
Delete
-----no
Copy
Status
----------
# lucreate -n newBE
Analyzing system configuration.
Comparing source boot environment <sol-10u7> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment <newBE>.
Source boot environment is <sol-10u7>.
Creating boot environment <newBE>.
Cloning file systems from boot environment <sol-10u7> to create boot
environment <newBE>.
3.
# lustatus
Boot Environment
Name
-------------------------sol-10u7
newBE
4.
Is
Complete
-------yes
yes
Active
Now
-----yes
no
Active
On Reboot
--------yes
no
Can
Delete
-----no
yes
Copy
Status
----------
Examine the state of the ZFS file systems using the zfs list command:
# zfs list
NAME
zpool1
zpool1/ROOT
zpool1/ROOT/newBE
zpool1/ROOT/sol-10u7
zpool1/ROOT/sol-10u7@newBE
zpool1/dump
zpool1/export
zpool1/export/home
zpool1/swap
USED
5.59G
4.22G
91K
4.22G
76.5K
896M
38K
18K
512M
AVAIL
8.31G
8.31G
8.31G
8.31G
8.31G
8.31G
8.31G
8.75G
REFER
97.5K
18K
4.22G
4.22G
4.22G
896M
20K
18K
59.0M
MOUNTPOINT
/zpool1
legacy
/
/
/export
/export/home
-
Notice that a new ZFS file system was created for the Alternate Boot
Environment (ABE). In this example it is zpool1/ROOT/newBE.
5.
THESE13-32
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
The following requested patches have packages not installed on the system
Package SUNWgtarS from directory SUNWgtarS in patch 139099-02 is not
installed on the system. Changes for package SUNWgtarS will not be
applied to the system.
Package SUNWj5jmp from directory SUNWj5jmp in patch 118666-19 is not
installed on the system. Changes for package SUNWj5jmp will not be
applied to the system.
Checking patches that you specified for installation.
Done!
Done!
6.
# luactivate newBE
7.
8.
Verify that the boot environment that was patched is now active:
# init 6
# lustatus
Boot Environment
Name
-------------------------sol-10u7
newBE
Is
Complete
-------yes
yes
Active
Now
-----no
yes
Active
Can
Copy
On Reboot Delete Status
--------- ------ ---------no
yes
yes
no
-
THESE13-34
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
When you install the Solaris OS with a Solaris Flash archive, the archive
and the installation media must contain identical OS versions. For
example, if the archive is the Solaris 10 operating system and you are
using DVD media, then you must use Solaris 10 DVD media to install the
archive. If the OS versions do not match, the installation on the target
system fails. Identical operating systems are necessary when you use the
following keyword or command:
Note When you use Live Upgrade to install the Solaris OS using a
Solaris Flash archive, a separate OS image is still required for the
installation process to complete. The Solaris OS image provides a miniroot
that Live Upgrade requires, however, the boot environment is loaded
using data from the Flash archive. The versions of the Solaris OS image
and the Solaris Flash archive must match.
Use a text editor to create a the profile file. Name the file descriptively.
Ensure that the name of the profile reflects how you intend to use the
profile to install the Solaris software on a system. For example, you might
name this profile upgrade_Solaris_10. Ensure that root owns the profile
and that the permissions are set to 644.
archive_location
Retrieves a Solaris Flash archive from a designated location.
JumpStart profiles used with Solaris Live Upgrade may include the
following keywords. Depending on the type of installation declared by
the install_type keyword, different groups of these keywords are valid
within the profile.
archive_location
cluster
geo
local_customization
locale
package
forced_deployment
local_customization
no_content_check
no_master_check
For more information keywords that are used in Solaris Live Upgrade
profiles, refer to the Solaris 10 05/09 Installation Guide: Solaris Live
Upgrade and Upgrade Planning, available at this URL:
http://docs.sun.com/app/docs/doc/819-6396?l=en&q=819-6396
THESE13-36
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# profile keywords
# ---------------install_type
package
cluster
geo
locale
locale
locale
locale
locale
locale
locale
locale
locale
profile values
------------------upgrade
SUNWxwman add
SUNWCacc add
C_Europe
zh_TW
zh_TW.BIG5
zh_TW.UTF-8
zh_HK.UTF-8
zh_HK.BIG5HK
zh
zh_CN.GB18030
zh_CN.GBK
zh_CN.UTF-8
profile values
------------------flash_install
nfs installserver:/export/solaris/archive/full_archive
profile values
------------------flash_update
nfs installserver:/export/solaris/archive/diff_archive
THESE13-38
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
3.
Type:
-f
Indicates to install an operating system from a Solaris Flash
archive.
-n BE_name
Specifies the name of the boot environment that is to be
installed with an archive.
-s os_image_path
Specifies the path name of a directory that contains an
operating system image. This directory can be on an installation
medium, such as a DVD-ROM, CD-ROM, or it can be an NFS or
UFS directory. The OS image is required to provide a miniroot
to Solaris Live Upgrade.
-a archive
THESE13-40
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
1.
2.
# profile keywords
# ---------------install_type
archive_location
profile values
------------------flash_install
nfs installserver:/export/solaris/flasharchive/solarisarchive
3.
After creating the profile, you can run the luupgrade command and
install the archive. The -j option is used to access the profile. The
pkgadd command adds the Solaris Live Upgrade packages from the
release you are upgrading to. For example:
Note The -s option specifies the spooled Solaris OS image that the
luupgrade command uses to find miniroot. The boot environment installs
using data from the Flash archive.
Preparation
Before starting with the lab exercise, install the packages, SUNWoptdir
and SUNWusrdir, found in the /opt/ses/lab/packages directory, on
the student system.
# pkgadd -d /opt/ses/lab/packages SUNWoptdir
# pkgadd -d /opt/ses/lab/packages SUNWusrdir
This exercise uses a dummy patch, 123456-01.zip or 654321-01.zip,
found in the /opt/ses/lab/patches directory. It also requires the
Solaris 10 OS Software DVD appropriate for your system architecture.
Note The packages and patches used in this exercise are for
demonstration only.
Further, refer to the lecture notes and additional resources to perform the
steps listed in this exercise.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
THESE13-42
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
Use the format utility to create three partitions on the spare disk in
your system. Set slice 4 to use 10gb, slice 5 to use 20 gb, and set
partition 6 to use the remainder of the disk. The all free hog
method available in the partition menu of the format utility may
offer the easiest method.
3.
Use the newfs command to create a UFS file system on slice 4 that
you created. Replace the example slice name with the one that is
correct for your system.
4.
5.
-c: BE1
6.
-n: BE2
7.
-m: /:/dev/dsk/c0t1d0s4:ufs
8.
9.
Use the lufslist command to list the configuration of the new boot
environment, BE2.
Use the newfs command to create a UFS file system on slice 5 that
you created. Replace the example slice name with the one that is
correct for your system.
2.
3.
4.
-n: BE3
5.
-p: rpool
6.
7.
Use the lufslist command to list the configuration of the new ZFS
boot environment, BE3.
1.
2.
Use the unzip command to extract the patch from the .zip archive.
3.
4.
Insert the Solaris 10 Software SPARC or x64/x86 DVD into the drive
and ensure that the media is mounted.
2.
3.
2.
Use the init 6 command to reboot the system to the new ZFS boot
environment.
3.
After reboot, use the df command to display information for the root
(/) file system. In the output, notice that the root (/) file system is
now ZFS-enabled.
THESE13-44
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
Exercise Summary
Exercise Summary
Experiences
Interpretations
Conclusions
Applications
!
?
Preparation
Before starting with the lab exercise, install the packages, SUNWoptdir
and SUNWusrdir, found in the /opt/ses/lab/packages directory, on
the student system.
# pkgadd -d /opt/ses/lab/packages SUNWoptdir
# pkgadd -d /opt/ses/lab/packages SUNWusrdir
This exercise uses a dummy patch, 123456-01.zip or 654321-01.zip,
found in the /opt/ses/lab/patches directory. It also requires the
Solaris 10 OS Software DVD appropriate for your system architecture.
Note The packages and patches used in this exercise are for
demonstration only.
Further, refer to the lecture notes and additional resources to perform the
steps listed in this exercise.
On the Sun Secure Global Desktop, click the icon for opening a
console session on your assigned lab system.
THESE13-46
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
2.
Use the format utility to create three partitions on the spare disk in
your system. Set slice 4 to use 10gb, slice 5 to use 20 gb, and set
partition 6 to use the remainder of the disk. The all free hog
method available in the partition menu of the format utility may
offer the easiest method.
3.
Use the newfs command to create a UFS file system on slice 4 that
you created. Replace the example slice name with the one that is
correct for your system.
# newfs /dev/rdsk/c0t1d0s4
4.
-c: BE1
-n: BE2
-m: /:/dev/dsk/c0t1d0s4:ufs
6.
Use the lufslist command to list the configuration of the new boot
environment, BE2.
# lufslist BE2
Use the newfs command to create a UFS file system on slice 5 that
you created. Replace the example slice name with the one that is
correct for your system.
# newfs /dev/rdsk/c0t1d0s5
2.
3.
-n: BE3
-p: rpool
5.
Use the lufslist command to list the configuration of the new ZFS
boot environment, BE3.
2.
Use the tar command to extract the patch from the .tar archive.
# cd /var/tmp
# unzip 123456-01.zip
3.
Insert the Solaris 10 Software SPARC or x64/x86 DVD into the drive
and ensure that the media is mounted to /cdrom/cdrom0.
2.
3.
THESE13-48
eKIT MATERIALS ARE
FOR
YOUR USE for
IN THIS
CLASSROOM
ONLY.System,
COPYING
MATERIALS FROM THIS
System
Administration
the Solaris
10 Operating
Part eKIT
2
COMPUTER IS STRICTLY PROHIBITED
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision D.1
# lufslist BE3
2.
Use the init 6 command to reboot the system to the new ZFS boot
environment.
3.
After reboot, use the df command to display information for the root
(/) file system. In the output, notice that the root (/) file system is
now ZFS-enabled.
# df -h
# init 6