0% found this document useful (0 votes)
204 views598 pages

SM101 - Solaris 2.x Essentials For System Maintainers - LG - 1193

Uploaded by

Mok Jackie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
204 views598 pages

SM101 - Solaris 2.x Essentials For System Maintainers - LG - 1193

Uploaded by

Mok Jackie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 598

SM-101

Solaris 2.x Essentials for System


Maintainers

Learning Guide

Technical Education Services


MS UMIL07-14
2550 Garcia Avenue
Mountain View, CA 94043
U.S.A.

SM-101
Revision B, November 1993
 1993 Sun Microsystems, Inc.—Printed in the United States of America.
2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A.

All rights reserved. This product and related documentation are protected by copyright and distributed
under licenses restricting its use, copying, distribution, and decompilation. No part of this product or related
documentation may be reproduced in any form by any means without prior written authorization of Sun and
its licensors, if any.

Portions of this product may be derived from the UNIX® and Berkeley 4.3 BSD systems, licensed from UNIX
System Laboratories, Inc. and the University of California, respectively. Third-party font software in this
product is protected by copyright and licensed from Sun’s Font Suppliers.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the United States Government is subject to the restrictions set forth in
DFARS 252.227-7013 (c)(1)(ii) and FAR 52.227-19.

The product described in this manual may be protected by one or more U.S. patents, foreign patents, or
pending applications.

TRADEMARKS

Sun, Sun Microsystems, the Sun logo, SunService, SunOS, Solaris, SPARC, SPARCstation, Sun Workstation,
NFS, OpenWindows, Ethernet, Sun-4, IPC, SLC, IPX, and SunInstall are trademarks or registered trademarks
of Sun Microsystems, Inc. UNIX and OPEN LOOK are registered trademarks of UNIX System Laboratories,
Inc. AT&T is a trademark of AT&T. Intel is a registered trademark of Intel Corporation. Lance is a trademark
of Micro Technology, Inc. Prestoserve is a trademark of Legato Systems, Inc. Xylogics is a registered
trademark of Xylogics, Inc. Amdahl (AMD) is a registered trademark of Amdahl Corporation. All other
product names mentioned herein are the trademarks of their respective owners.
All SPARC trademarks, including the SCD Compliant Logo, are trademarks or registered trademarks of
SPARC International, Inc. SPARCstation, SPARCserver, SPARCengine, SPARCworks, and SPARCompiler are
licensed exclusively to Sun Microsystems, Inc. Products bearing SPARC trademarks are based upon an
architecture developed by Sun Microsystems, Inc.

The OPEN LOOK® and Sun™ Graphical User Interfaces were developed by Sun Microsystems, Inc. for its
users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the
concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license
from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement
OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements.

X Window System is a trademark and product of the Massachusetts Institute of Technology.


THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES
ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN
NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR
CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.
Contents

Introduction1-1
Maintenance Learning Path Overview 1-2
SM-100 Course Description 1-4
SM-101 Course Description 1-6
SM-210 Course Description 1-8
SM-225 Course Description 1-12
SM-230 Course Description 1-14
Expanded Maintenance Path 1-16
Sun Product Line2-1
RISC and SPARC 2-2
System Bus Definitions 2-4
Desktop Systems Enclosure 2-6
Deskside and Datacenter System Enclosures 2-8
Tabletop and Dataserver System Enclosures 2-10
SCSI Peripheral Overview 2-12
SCSI Desktop Peripheral Packaging 2-14
ESMD and IPI Disk Drives 2-16
SCSI Device Interconnection 2-18
Deskside and Datacenter/Server Expansion 2-20
Monitors, Keyboards, and the Mouse (FRUs) 2-22
External System Connections 2-24
Lab—Sun Product Line 2-26
Introduction to Solaris3-1
What Is a Workstation? 3-2
Operating System Overview 3-4
Kernel Overview 3-6
Shell Overview 3-8
File System Overview 3-10
Solaris Client-Server Environment 3-12
Characteristics of the UNIX Operating System 3-14
Hosts and Users 3-16
Standalone and File-Server Systems 3-18

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Client Types ..................................................................................... 3-20
Network Definitions ....................................................................... 3-22
Lab—Solaris Introduction.............................................................. 3-24
System Boot Sequence .............................................................................. 4-1
System Boot Sequence Overview ................................................... 4-2
Boot PROM Functions ...................................................................... 4-4
Boot PROM Resources...................................................................... 4-6
Boot PROM User Interface............................................................... 4-8
Resetting the System....................................................................... 4-10
Power-On Self-Test Overview ...................................................... 4-12
The Keyboard Banner..................................................................... 4-14
Booting the System ......................................................................... 4-16
Aborting the Boot Sequence .......................................................... 4-18
Loading the Boot Program and the Kernel ................................. 4-20
Kernel Device Probing ................................................................... 4-22
RC Script File Startup ..................................................................... 4-24
Logging In and Logging Out......................................................... 4-26
System Prompts............................................................................... 4-28
Stopping the Processor................................................................... 4-30
Lab—Initial System Preparation................................................... 4-32
Lab—System Reset and Banner .................................................... 4-33
Lab—Default Boot and Boot Messages........................................ 4-35
Lab—Logging In ............................................................................. 4-38
Lab—Logging Out and Halting .................................................... 4-39
Lab—Setting Passwords ................................................................ 4-41
File System Hierarchy ............................................................................... 5-1
File System Directories and Subdirectories................................... 5-2
Solaris Software Hierarchical File System Structure ................... 5-4
Important Solaris Software Subdirectories ................................... 5-6
Lab—File System Hierarchy............................................................ 5-8
Directory Commands ................................................................................ 6-1
File Naming Conventions ................................................................ 6-2
Solaris Command Line Format ....................................................... 6-4
Displaying Manual Pages ................................................................ 6-6
Changing and Displaying Directories (cd and pwd) .................... 6-8
Changing to the Parent Directory................................................. 6-10
Absolute Path Names ..................................................................... 6-12
Relative Path Names....................................................................... 6-14
Listing Directories (ls)................................................................... 6-16
Creating Directories (mkdir) ......................................................... 6-18
Other Ways to Use the mkdir Command.................................... 6-20
Removing Directories (rmdir) ...................................................... 6-22
Lab—Directory Commands .......................................................... 6-24
File Commands........................................................................................... 7-1

ii Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
What Is a File?.................................................................................... 7-2
Displaying Detailed Information About Files .............................. 7-4
Displaying Files by Type ................................................................. 7-6
Identifying File Types With the file Command......................... 7-8
Displaying Files With the more Command................................. 7-10
Keyboard Interrupts ....................................................................... 7-12
Lab—File Commands..................................................................... 7-14
Package Commands................................................................................... 8-1
Displaying Package Information Using pkginfo ........................ 8-2
Displaying Installed Packages Using pkginfo -1...................... 8-4
Displaying Available CD-ROM Packages Using pkginfo -1 .. 8-6
Adding a Software Package Using pkgadd................................... 8-8
Lab—Package Commands............................................................. 8-10
The OpenWindows Environment........................................................... 9-1
Starting the OpenWindows Environment..................................... 9-2
Using the Mouse ............................................................................... 9-4
Window Control ............................................................................... 9-6
File Manager ...................................................................................... 9-8
Console Window............................................................................. 9-10
Workspace Menu ............................................................................ 9-12
Command Tool................................................................................ 9-14
Repositioning a Command Tool ................................................... 9-16
Exiting the OpenWindows Environment .................................... 9-18
Lab—OpenWindows...................................................................... 9-20
Disk Drive Partitioning .......................................................................... 10-1
Logical Disk Device Names........................................................... 10-2
Disk Partitioning ............................................................................. 10-4
How Partitions Are Described ...................................................... 10-6
VTOC—What Is It? ........................................................................ 10-8
Displaying a Disk’s VTOC........................................................... 10-10
Partitioning Disks With the format Utility .............................. 10-12
The Partition Menu ....................................................................... 10-14
The partition> modify Submenu .......................................... 10-16
Understanding a Partition Table ................................................ 10-18
How to Repartition a Disk ........................................................... 10-20
Changing Partition Sizes.............................................................. 10-22
Checking Your Work and Saving the New Table .................... 10-24
Reading the Label From the Drive ............................................. 10-26
Lab—Disk Partitioning and Labeling ........................................ 10-28
Lab—Starting Up the format Utility Program......................... 10-30
Lab—Selecting the Partition Menu............................................. 10-31
Lab—Partitioning Your Disk....................................................... 10-32
Lab—Display the New VTOC With the prtvtoc Command 10-36
File System Initialization ....................................................................... 11-1

Contents iii

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Disk Partitioning ............................................................................. 11-2
What Is a File System?.................................................................... 11-4
What Makes a Partition Into a File System ................................. 11-6
Creating a New File System .......................................................... 11-8
Mounting a File System................................................................ 11-10
/usr/etc/mount........................................................................... 11-12
Background Structures................................................................. 11-14
VTOC and Boot Blocks................................................................. 11-16
Displaying a Disk’s VTOC........................................................... 11-18
Superblock and Cylinder Group Block...................................... 11-20
SunOS Operating System Data Blocks....................................... 11-22
Data Blocks and Fragments ......................................................... 11-24
File inodes..................................................................................... 11-26
inode Table.................................................................................... 11-28
fsck Inconsistency Problems ...................................................... 11-30
fsck Usage..................................................................................... 11-32
Lab—File System Initialization ................................................... 11-34
Lab—Finding Your Practice Disk ................................................ 11-36
Lab—Partitioning Your New Disk ............................................. 11-37
Lab—Initializing the Partitions on Your New Disk................. 11-38
Lab—File System Cleanup........................................................... 11-41
Lab—Data Blocks, Disk Blocks, and Fragments....................... 11-42
Lab—Displaying the Disk Label with prtvtoc ....................... 11-43
Lab—fsck, the Superblock, and inodes................................... 11-45
vfstab and vi......................................................................................... 12-1
How File Systems Are Mounted at Boot Time ........................... 12-2
Boot Messages ................................................................................. 12-4
The vi Text Editor........................................................................... 12-6
Editing and Writing Files............................................................... 12-8
Modes of Operation and Cursor Movement............................. 12-10
Entering Text ................................................................................. 12-12
Exiting Input Mode....................................................................... 12-14
Deleting Text.................................................................................. 12-16
Undoing a Change ........................................................................ 12-18
Exiting vi ....................................................................................... 12-20
Saving Text..................................................................................... 12-22
Removing Files .............................................................................. 12-24
Lab—vfstab and vi .................................................................... 12-26
Lab—Finding Your Practice Disk ............................................... 12-27
Lab—Partitioning Your Practice Disk into Three Partitions .. 12-28
Lab—Using newfs to Initialize the File Systems...................... 12-29
Lab—Editing the vfstab File With vi ...................................... 12-30
Lab—Testing the vfstab Entries................................................ 12-32
Lab—Finishing Up........................................................................ 12-34
Lab—Creating a New File With vi (Optional)......................... 12-35

iv Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Kernel Configuration .............................................................................. 13-1
Kernel Connections......................................................................... 13-2
Autoconfiguration Process ............................................................ 13-4
The /kernel Directory................................................................... 13-6
Reconfiguring Devices ................................................................... 13-8
Displaying System Configuration With dmesg ........................ 13-10
Displaying System Configuration With prtconfig................ 13-12
Lab—Kernel Configuration ......................................................... 13-14
Lab—Using dmesg to Verify the Kernel .................................... 13-15
Lab—Using prtconf to Verify the Kernel ................................ 13-18
Lab—Un-configuring Devices..................................................... 13-20
Lab—Reconfiguring Devices....................................................... 13-21
Device Nodes ............................................................................................ 14-1
System Boot Sequence Overview ................................................. 14-2
POST, Banner, and Boot Device Selection ................................... 14-4
Loading the Boot Block and /ufsboot Program ....................... 14-6
/kernel/unix Loading and Kernel Device Probing ................ 14-8
Starting Up the Run Control (rc) Script File............................. 14-10
Device Nodes and Kernel Connections ..................................... 14-12
Identifying Devices Names ......................................................... 14-14
Logical Disk Device Names......................................................... 14-16
Device Information Tree .............................................................. 14-18
Physical Device Names ................................................................ 14-20
Instance Device Names ................................................................ 14-22
Displaying System Configuration—prtconf........................... 14-24
Putting It All Together ................................................................. 14-26
Device Nodes—System Names................................................... 14-28
Lab—Device Nodes ...................................................................... 14-30
Lab—Using dmesg to Identify Your Tape Drive ...................... 14-31
Lab—Verifying Your Tape Drive With the mt Command...... 14-32
Lab—Device Links........................................................................ 14-33
Lab—Physical Device Names ..................................................... 14-35
Run Control (rc) Scripts ......................................................................... 15-1
System Startup................................................................................. 15-2
Starting Up the rc Script File ........................................................ 15-4
System Boot Procedure .................................................................. 15-6
System Operation Levels ............................................................... 15-8
The Run Control Scripts............................................................... 15-10
Run Control Script File Locations............................................... 15-12
Run Control Script Summary...................................................... 15-14
Single-User Versus Multiuser ..................................................... 15-16
Booting Single-User ...................................................................... 15-18
Single-User Bootup Flow ............................................................. 15-20
Changing from Single-User to Multiuser .................................. 15-22
Changing from Multiuser to Single-User .................................. 15-24

Contents v

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Stopping the Processor................................................................. 15-26
Aborting the Processor................................................................. 15-28
Lab—Software Boot ...................................................................... 15-30
Lab—Using halt and reboot..................................................... 15-31
Lab—Changing Run Levels......................................................... 15-33
Lab—System Aborts ..................................................................... 15-36
Network Terminology ............................................................................ 16-1
Network Terminology and Concepts .......................................... 16-2
What Is the Ethernet? ..................................................................... 16-4
Ethernet Interface............................................................................ 16-6
Network Hardware ........................................................................ 16-8
Standard Ethernet Connection.................................................... 16-10
Thinnet............................................................................................ 16-12
Ethernet Address .......................................................................... 16-14
ISDN................................................................................................ 16-16
The FDDI Standard....................................................................... 16-18
Internet Address and the /etc/hosts File............................... 16-20
The Loopback Address ................................................................ 16-22
The /etc/hostname.xx0 File ..................................................... 16-24
Lab—Network Terminology ....................................................... 16-26
Basic Network Troubleshooting ........................................................... 17-1
The ifconfig Command .............................................................. 17-2
Basic Network Commands—rup ................................................. 17-4
Basic Network Commands—ping ............................................... 17-6
Basic Network Commands—ping -s......................................... 17-8
Troubleshooting ............................................................................ 17-10
Troubleshooting—Error Messages............................................. 17-12
Lab—Basic Network Troubleshooting....................................... 17-16
Lab—Using the ifconfig Command ....................................... 17-18
Lab—Using the rup Command .................................................. 17-19
Sun NFS Service....................................................................................... 18-1
Characteristics of the NFS System................................................ 18-2
Types of Clients............................................................................... 18-4
NFS Background ............................................................................. 18-6
How Does the NFS System Work? ............................................... 18-8
NFS Background for a Client ...................................................... 18-10
NFS Background for a Server...................................................... 18-12
The /etc/hosts File .................................................................... 18-14
NFS Client/Server Interaction .................................................... 18-16
NFS Server Files—dfstab and sharetab............................... 18-18
Export Options .............................................................................. 18-20
The share Command ................................................................... 18-22
The /usr/sbin/dfshares Command ...................................... 18-24
The /usr/sbin/mount Command............................................ 18-26

vi Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
The /usr/sbin/umount Command........................................... 18-28
NFS Client Files—/etc/vfstab................................................. 18-30
NFS Client Files—/etc/vfstab and /etc/mnttab................ 18-32
NFS Client Mounts at Boot—/etc/vfstab.............................. 18-34
Lab—NFS Service ......................................................................... 18-36
Lab—NFS Background................................................................. 18-37
Lab—Partner Exercise .................................................................. 18-38
Lab—Informational Commands................................................. 18-40
Lab—Mounting and Exporting................................................... 18-41
SunInstall .................................................................................................. 19-1
Software Packages and Clusters ................................................... 19-2
Software Configuration Clusters .................................................. 19-4
Software Terminology Summary ................................................. 19-6
Disk Partition and Software Requirements................................. 19-8
Installation Process ....................................................................... 19-10
Booting the Release Media........................................................... 19-12
Defining the Terminal Type ........................................................ 19-14
Specifying the Host Name ........................................................... 19-15
Configuring the Network ............................................................ 19-16
Identifying the Internet Address ................................................ 19-17
Confirming the Network Configuration ................................... 19-18
Identifying the Name Service...................................................... 19-19
Configuring Sub-networks .......................................................... 19-20
Confirming Network Information.............................................. 19-21
Identifying the Geographic Region ............................................ 19-22
Selecting the Time Zone............................................................... 19-23
Confirming the Date and Time ................................................... 19-24
Confirming Time Zone and Current Date and Time............... 19-25
Selecting a Custom Installation................................................... 19-26
Custom Installation, System Type.............................................. 19-27
System Type Submenu................................................................. 19-28
Custom Installation, Software Selection .................................... 19-29
Software Selection Sub-menu...................................................... 19-30
Editing the End User System Support Configuration ............. 19-31
End User System Support Disk Space Requirements.............. 19-33
Custom Installation, Disks/File Systems .................................. 19-34
Selecting Available Disks............................................................. 19-35
Setting Disk Editing Properties................................................... 19-36
Configuring File Systems Menu ................................................. 19-37
File System Space Requirements ................................................ 19-38
Displaying Default Partition Sizes ............................................. 19-39
Completed Disk Configuration................................................... 19-40
Exiting the File System Menu...................................................... 19-41
Starting the Installation ................................................................ 19-42
During the Installation ................................................................. 19-43

Contents vii

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Applying root Password ............................................................ 19-44
Summary ........................................................................................ 19-45
Lab - SunInstall Custom Installation.......................................... 19-46
Lab - Configuration Sheet ............................................................ 19-48
Appendix-SunInstall Quick Install....................................................... A-1
Introduction ...................................................................................... A-2
Installation Information .................................................................. A-3
Quick Installation Information....................................................... A-4
Installation Information Worksheet .............................................. A-5
Preparing the System....................................................................... A-6
Quick Installation............................................................................. A-7
Name Form ....................................................................................... A-8
Network Form .................................................................................. A-9
IP Address Form ............................................................................ A-10
Verification Form ........................................................................... A-11
Name Service Selection Form....................................................... A-12
Subnetworks Form......................................................................... A-13
Verification Form ........................................................................... A-14
Geographic Region Form.............................................................. A-15
Time Zone Form............................................................................. A-16
Current Date and Time Form....................................................... A-17
Verification Form ........................................................................... A-18
SunInstall Main Menu ................................................................... A-19
Software Configurations Menu.................................................... A-20
Disk Selection Menu ...................................................................... A-21
Software Configuration Form ...................................................... A-22
Quick Install Configuration Screen ............................................. A-23
Root Password Form ..................................................................... A-24
Summary ......................................................................................... A-25
Exercise ............................................................................................ A-26

viii Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Introduction 1

Objectives

Upon completion of this module, you will be able to:

■ Explain the purpose of the maintenance course series.

■ Describe each course in the initial maintenance path.

■ Describe the course categories in the expanded maintenance path.

1-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

Maintenance Learning Path Overview

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210
SM-225 SM-230

1-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

Notes

■ Each course in this Maintenance Series is presented in a


systematic progression.
✓ To keep pace with the variety of SPARC™ Desktop, Deskside/Datacenter platforms
manufactured by Sun Microsystems®, Sun Service™ has redesigned its hardware
maintenance curriculum to provide a systems approach for hardware maintenance. Each
of the system maintenance courses (SM-100, SM-101, SM-210, SM-225, and SM-230) is an
on-going study of the software tools and system hardware as it applies to the complete
system.

■ The two Essentials for System Maintainers courses are the building
blocks required to progress to the other hardware courses in this
series.
✓ The SunOS™ 4.x Essentials for System Maintainers course covers the aspects of SunOS
4.x software (Berkeley Software Distribution [BSD] UNIX®) and hardware that is used
during the Desktop and Uniprocessor Deskside/Datacenter courses. Without the SunOS
4.x Essentials course, the student can fall behind in these subsequent courses.

✓ The Solaris® Essentials for System Maintainers course covers the aspects of Solaris
software (SunOS system software, based on System V Revision 4.0, UNIX) and hardware
that is used during the Desktop, Uniprocessor and Multiprocessor Deskside/Datacenter
courses. Without one of the Solaris Essentials courses, the student can fall behind in
these subsequent courses.

■ The Desktop Systems Maintenance course is essential for anyone


maintaining Sun™ desktop systems.
✓ The SPARC Desktop Systems Maintenance course builds upon the material covered in the
Essentials courses, in addition to many new topics and concepts that are necessary for
desktop maintenance. Most desktop systems can run on both the SunOS 4.x and Solaris
Sun OS operating environments; however, the latest desktop systems are Solaris only.

■ The Deskside/Datacenter Maintenance courses are essential for


anyone maintaining Sun deskside and datacenter systems.
✓ The SPARC Uniprocessor Deskside/Datacenter Maintenance course builds upon the
material covered in the Essentials courses, in addition to many new topics and concepts
that are necessary for the maintenance of the uniprocessor deskside/datacenter systems.
All of the uniprocessor deskside/datacenter systems can run on both the SunOS 4.x and
Solaris computing environments.

✓ The SPARC Multiprocessor Deskside/Datacenter Maintenance course builds upon the


material covered in the Essentials courses, in addition to many new topics and concepts
that are necessary for the maintenance of the multiprocessor deskside/datacenter
systems. Some multiprocessor deskside/datacenter systems can run on both the SunOS
4.x and Solaris computing environments; however, the latest desktop systems are Solaris
only.

Introduction 1-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

SM-100 Course Description

Prerequisites

Before taking the SM-100 SunOS 4.x Essentials for System Maintainers
course, you should have prior experience in the service and repair of
digital computers and their peripherals, and you should have
experience with various computer operating systems. You should also
be familiar with basic computer concepts, such as bus structure,
memory (RAM, ROM, EPROM), virtual memory, LAN, disk drive, and
monitor.

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210 SM-225 SM-230

1-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

SM-100 Course Description

Overview
This entry-level course is designed for the hardware maintenance
individual who has computer maintenance experience but no Sun
hardware or UNIX operating system experience. It teaches the
essential SunOS 4.x operating system knowledge and skills required to
successfully progress through the hardware maintenance curriculum,
and stresses lab exercises. Emphasis is on practical application of the
SunOS and UNIX environments in the hardware environment.

Objectives
■ Describe the major functions of the POST.
■ Describe the boot PROM and its functions.
■ Describe the general features and characteristics of Sun SPARC
systems.
■ Differentiate the general characteristics of each SPARC system
category and its peripherals.
■ Describe the SunOS file structure and navigate the file system.
■ Start up and shut down a Sun Workstation in the correct
sequence.
■ Install the SunOS operating system on a standalone system.
■ Execute essential SunOS commands and interpret the results.
■ Create a generic kernel for a Sun SPARC system.
■ Describe the NFS distributed file system and NIS network
software.
■ Trace the boot up process including firmware, software, and
hardware used.
■ Execute the format utility to determine the disk partition
offsets and sizes.
■ Execute and use selected elements of the OpenWindows
environment.
■ Use the vi text editor to create and modify selected UNIX files.

Introduction 1-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

SM-101 Course Description

Prerequisites

Before taking the SM-101 Solaris Essentials for System Maintainers


course, you should have prior experience in the service and repair of
digital computers and their peripherals, and you should have
experience with various computer operating systems. You should also
be familiar with basic computer concepts, such as bus structure,
memory (RAM, ROM, EPROM), virtual memory, LAN, disk drive, and
monitor.

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210
SM-225 SM-230

1-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

SM-101 Course Description

Overview
This entry-level course is designed for the hardware maintenance
individual who has computer maintenance experience but no Sun
hardware or Solaris® software computing environment experience.
The course teaches the essential Solaris knowledge and skills required
to successfully progress through the hardware maintenance
curriculum, and stresses lab exercises. Emphasis is on practical
application of the Solaris computing environment in the hardware
environment.

Objectives
Upon completion of this course, you should be able to:

■ Describe the major functions of the power-on self-test (POST).


■ Describe the boot PROM and its functions.
■ Describe the general features and characteristics of Sun
SPARC® systems.
■ Differentiate the general characteristics of each SPARC system
category and its peripherals.
■ Describe the Solaris file structure and navigate the file system.
■ Start up and shut down a Sun Workstation® in the correct
sequence.
■ Install Solaris software on a standalone system.
■ Execute essential Solaris commands and interpret the results.
■ Create a generic kernel for a Sun SPARC system.
■ Describe the NFS® distributed file system and network
information services (NIS) network software.
■ Trace the boot up process, including firmware, software, and
hardware used.
■ Execute the format utility to determine the disk partition
offsets and sizes.
■ Execute and use selected elements of the OpenWindows™
environment.
■ Use the vi text editor to create and modify selected UNIX®
files.

Introduction 1-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

SM-210 Course Description

Prerequisites
Before taking the SM-210 SPARC Desktop Systems Maintenance course,
you must have taken either or both of the SM-100 or SM-101 courses.
You should have prior experience in the service and repair of digital
computers and their peripherals, and you should have experience with
various computer operating systems. You should also be familiar with
basic computer concepts, such as bus structure, memory (RAM, ROM,
EPROM), virtual memory, LAN, disk drive, and monitor.

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210
SM-225 SM-230

1-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

SM-210 Course Description

Overview
In the SPARC Desktop Systems Maintenance course, you will learn to
install, configure, diagnose, and verify proper operation of SPARC
desktop workstations and associated peripherals. The boot process,
PROM-based diagnostics, and error conditions are also covered in this
course. Lab exercises are heavily emphasized.

Objectives
Upon completion of this course, you should be able to:

■ Format and partition disks, and install application software that


helps you to diagnose the system on-line.
■ Perform off-line diagnostics and be familiar with peripherals
specific to machine types.

■ Interpret error messages and recognize the SunOS operating


system and Solaris software interaction with external devices
when malfunctions occur.

Introduction 1-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

1-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

Introduction 1-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

SM-225 Course Description

Prerequisites
Before taking the SM-225 SPARC Uniprocessor Deskside/Datacenter
Maintenance course, you must have taken either or both of the SM-100
or SM-101 courses. You should have prior experience in the service
and repair of digital computers and their peripherals, and you should
have experience with various computer operating systems. You should
also be familiar with basic computer concepts, such as bus structure,
memory (RAM, ROM, EPROM), virtual memory, LAN, disk drive, and
monitor.

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210
SM-225 SM-230

1-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

SM-225 Course Description

Overview
In the Uniprocessor Deskside/Datacenter Maintenance course, you will
learn to install, configure, diagnose, and verify proper operation of
SPARC uniprocessor deskside, datacenter, and associated peripherals.
The boot process, PROM-based diagnostics, and error conditions are
also covered in this course. Lab exercises are heavily emphasized.

Objectives
Upon completion of this course, you should be able to:

■ Format and partition disks, and install application software that


helps you to diagnose the system on-line.
■ Perform off-line diagnostics and be familiar with peripherals
specific to machine types.

■ Interpret error messages and SunOS operating system interaction


with external devices when malfunctions occur.

Introduction 1-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

SM-230 Course Description

Prerequisites
Before taking the SM-230 SPARC Multiprocessor Deskside/Datacenter
Maintenance course, you must have taken the SM-101 course. You
should have prior experience in the service and repair of digital
computers and their peripherals, and you should have experience with
various computer operating systems. You should also be familiar with
basic computer concepts, such as bus structure, memory (RAM, ROM,
EPROM), virtual memory, LAN, disk drive, and monitor.

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101

SPARC Uniprocessor SPARC Multiprocessor


SPARC Desktop
Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210
SM-225 SM-230

1-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

SM-230 Course Description

Overview
In the SPARC Multiprocessor Deskside/Datacenter Maintenance course,
you will learn to install, configure, diagnose, and verify proper
operation of SPARC multiprocessor deskside, datacenter, and
associated peripherals. The boot process, PROM-based diagnostics,
and error conditions are covered. Lab exercises are heavily
emphasized.

Objectives
Upon completion of this course, you should be able to:

■ Format and partition disks, and install application software that


helps you to diagnose the system on-line.
■ Perform off-line diagnostics and be familiar with peripherals
specific to machine types.

■ Interpret error messages and Solaris software interaction with


external devices when malfunctions occur.

Introduction 1-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

Expanded Maintenance Path

SunOS 4.x Essentials for Solaris Essentials for


System Maintainers System Maintainers
SM-100 SM-101
Initial
maintenance
path

SPARC Desktop SPARC Uniprocessor SPARC Multiprocessor


Deskside/Datacenter Deskside/Datacenter
Systems Maintenance
Maintenance Maintenance
SM-210 SM-225 SM-230

Expanded
maintenance
path

Sun Systems
New Products Self-paced
Fault Analysis
Maintenance Maintenance
Workshop
SM-310 Video Courses
ST-350

System Administration
Curriculum and
Video Courses

1-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11 1

Expanded Maintenance Path

Before you can take any of the expanded maintenance path courses,
you must have completed the prerequisite courses listed below.
✓ The courses in the expanded path section can be taken in any order.

✓ Each of the video courses includes a workbook and is independent of other video
courses. A video course may cover a product found in the New Products course; typically,
videos cover new systems only.

New Products Maintenance (SM-310)


Prerequisites
Before taking the New Products Maintenance course, you must have
taken either the SM-210, SM-225, or SM-230 course.

Overview
The New Products Maintenance course is a periodic refresher course for
those who need incremental training on how to support new Sun
Workstations and operating system releases. If you already maintain
Sun Workstations, the self-paced maintenance video courses allow you
to concentrate on the specific workstation products you support. The
lecture and lab format used lays product-specific foundations in
preparation for extensive labs

Sun Systems Fault Analysis Workshop (ST-350)


Prerequisites
Before taking the Sun Systems Fault Analysis Workshop course, you must
have taken either the SM-210, SM-225, or SM-230 course.

Overview
The Fault Analysis Workshop enables you to perform basic,
intermediate, and some advanced system fault analysis and repair.
This course includes software, hardware, and system configuration
issues.

Introduction 1-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1

1-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Sun Product Line 2

Objectives

Upon completion of this module, you will be able to:

■ Describe the differences between SBus, VMEbus, and XDBus Sun


SPARC computers.

■ Describe the general characteristics of each type of Sun SPARC


system.

■ Define peripheral components used with Sun SPARC computers.

■ Describe peripheral packaging used with Sun SPARC computers.

■ Identify the monitor types used with Sun SPARC computers.

■ Identify system cable connections.

Evaluation

Complete the lab at the end of this module.

References

System and Network Administration Guide, Part Number 800-3805-10

2-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

RISC and SPARC

Reduced Instruction Set Computer (RISC) Processing


■ Limited instruction set

Sun Implementation of RISC Processing


■ Fixed-length, 32-bit implementation

■ Effective result of one instruction per CPU cycle

1st CPU Cycle 2nd CPU Cycle 3rd CPU Cycle 4th CPU Cycle

Fetch 1st Instruction 2nd Instruction 3rd Instruction 4th Instruction

Decode 1st Instruction 2nd Instruction 3rd Instruction

Execute 1st Instruction 2nd Instruction

Write 1st Instruction

Four-stage instruction platform

Scalable Processor ARChitecture (SPARC) Processors


■ Easily scaled down for improved chip technology

■ Easily transferred to different logic families

2-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

RISC Processing
■ In RISK processing, each instruction proceeds through four
stages:
■ Fetch

■ Decode

■ Execute

■ Write

■ As one instruction completes a stage, the next instruction takes its


place.
✓ Even though the instruction can take four cycles to complete, when it is finished, the next
instruction is 3/4 complete and finishes in the next cycle. This method enables one
instruction to be completed every CPU cycle.

Sun Implementation of RISC Processing


■ Fixed-length, 32-bit registers and instructions
✓ Register-intensive architecture—the output registers of one set are the input registers of
the next set.

✓ Designed especially to enhance the rate of instruction execution for the Sun OS.

■ Migration of functions to software


✓ Only those instructions that measurably improve performance by execution in hardware
are put in the internal processor instruction set. The software is then written to contain
sequences of simple instructions that combine to perform complex functions. This greatly
improves system efficiency and speed.

SPARC Processors
■ Name given to the RISC-based Sun processor chip set
✓ Scalable means that the internal chip design is flexible, so that as manufacturing
techniques improve, the chips can easily be made smaller without requiring major
redesigning. A natural function of a smaller chip set is both increased speed and smaller
packaging for the computer. The result can be seen in Sun’s new desktop SPARCstation™
systems

Sun Product Line 2-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

System Bus Definitions

VMEbus Design

VMEbus
Device

Memory board CPU board


Disk controller

SBus Design

CPU

SBus board

XDBus Design

System boards

2-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

VME—Versa Module Europa


■ The VMEbus is found in deskside and datacenter machines.
✓ VMEbus design requires a separate CPU board and a separate disk controller board, as
well as other option boards. Each of these devices transfers up to 32 bits of parallel data.
The VMEbus requires a backplane and is off-board the CPU. The dimensions of a Sun
VMEBus board is 15.75 inches long by 14.44 inches wide.

SBus—System Bus
■ The SBus is found in SPARC desktop machines.
✓ The SBus connector is on-board the CPU and provides for SBus card options. The
transfer rate is 32 bits of parallel data. The SBus is more compact than the VMEbus; the
minimum dimensions of an SBus board are 5.78 inches long by 3.30 inches wide.

XDBus—Xerox Dyna Bus


■ The XDBus is found in SPARC tabletop servers and data server
machines.
✓ The XDBus is the fastest system bus in Sun’s history. The XDbus is capable of
transferring up to 64 bits of parallel data. The XDbus is used in systems that demand high
bandwidth, data consistency, and VLSI (Very Large Scale Integration) within a shared-
memory multiprocessor systems.

✓ Sun uses the XDBus to enable rapid communications between multiple system boards.
The XDBus also enables intensive boot diagnostics between system boards for
autoconfiguration.

✓ The system boards for the XDBus come in various sizes, depending on the system.

Sun Product Line 2-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Desktop Systems Enclosure

3 SBus
connectors

Pizzabox

2 SBus
connectors

Dinnerbox

No SBus
connectors

Monitor

2-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

Enclosures Styles
Sun desktop systems have three enclosure styles:

■ Pizzabox enclosure
✓ The SPARCstation 1 and associated systems are commonly referred as the pizzabox
systems and have dimensions of 2.8 inches high by 16 inches wide by 16 inches deep,
plus monitor.

■ Dinnerbox enclosures
✓ The SPARCstation IPC and associated systems are commonly referred as the dinnerbox
systems and have dimensions of 4.6 inches high by 9.6 inches wide by 10.4 inches deep,
plus monitor.

■ Monitor enclosures
✓ The SPARCstation SLC and associated systems are commonly referred as the monitor
systems and are integrated into a 17 inch monitor enclosure. Its dimensions are 15.8
inches high by 15.5 inches wide by 17.3 inches deep.

Basic Features
■ Intended for use on the desk

■ Single CPU board

■ SBus support for various add-on devices


✓ The pizzabox has three available SBus connectors—the SPARCstation 10 has four SBus
connectors.

✓ The dinnerbox has two available SBus connectors.

✓ The monitor system has no available SBus connectors.

Sun Product Line 2-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Deskside and Datacenter System Enclosures

5-slot 12-slot
X30 chassis X70 chassis

16-slot
X90 chassis

2-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

Deskside Systems
■ Can be configured as a standalone, dataless, diskless client or
server.
■ Are intended for positioning next to or under a desk.

■ Come with either 5- or 12-slot VME bus card cages.


✓ The deskside workstations are equipped with wheels for easy mobility.

✓ The x30s are 5-slot systems and have dimensions of 23.6 inches high by 12.6 inches wide
by 27.6 inches deep.

✓ The X30s are officially called the 5-slot office pedestal.

✓ The X70s are 12-slot systems and have dimensions of 25.7 inches high by 18.9 inches
wide by 28.6 inches deep.

✓ The X70s are officially called the 12-slot office pedestal.

■ Deskside workstations can have disks and a tape installed within


each unit.

■ Can hold peripherals internally.


✓ The X30 system cabinet can have up to three devices.

✓ The X70 system cabinet can have up to six devices.

■ Both the X30 and X70 systems can be attached to expansion


pedestals for additional disk support.

Datacenter Systems
■ Can be configured as a server.

■ Are rack-mount systems.

■ Come with a 16-slot VME bus card cage.


✓ The datacenter workstations replaced the standard 19-inch rack.

✓ The X90s are 16-slot systems and have dimensions of 56 inches high by 29.5 inches wide
by 38.3 inches deep.

✓ The X90 system cabinet can contain up to two tape drives, one CDROM, and eight disk
drives.

Sun Product Line 2-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Tabletop and Dataserver System Enclosures

4-slot
tabletop server

10-slot
dataserver

2-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

Tabletop Servers
■ Can be configured as a server.

■ Are intended for use on a desk.

■ Come with four single XDBus slots for system boards.


✓ The tabletop server is a small, multiboard server.

✓ Each system board can have two SPARC processor modules, three SBus modules, and
512Mbyte of RAM.

✓ The tabletop server is a 4-slot system and has dimensions of 8.27 inches high by 19.6
inches wide by 21.06 inches deep.

■ Can have disks and a tape installed within the unit.


■ Can hold peripherals internally.
✓ The tabletop server cabinet can have up to 18 devices.

■ Can be attached to external peripherals for additional disk/tape


support.

Dataservers
■ Can be configured as a server.

■ Are rack-mount systems.

■ Come with 10 dual XDBus slots for system boards.


✓ The dataservers replace the datacenters.

✓ Each system board can have two SPARC processor modules, four SBus modules, and
512Mbyte of RAM.

✓ The dataservers have dimensions of 56 inches high by 29.5 inches wide by 38.3 inches
deep.

✓ The dataservers cabinet can have up to 18 disk drives, 1 tape drive, and 1 CD-ROM. The
tabletop server cabinet can have up to 18 devices.

Sun Product Line 2-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

SCSI Peripheral Overview

SCSI
■ Can support seven devices.

■ Uses a SCSI host adapter for system interfacing.

Embedded SCSI
■ Controller embedded with disk drive.

Peripheral Styles
■ Full-height.

■ Half-height.

■ Full-size 9-track tape drive.

System Usage
■ Desktop systems use SCSI only.

■ Deskside systems can use SCSI.

■ Datacenter systems only use SCSI tapes/CDROM.

■ Tabletop server systems only use SCSI devices.

■ Dataserver systems only use SCSI devices.

2-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

■ The small computer system interface (SCSI) is an interface


standard that provides high-speed parallel data transfer.

■ The embedded SCSI supports the SCSI host adapter.


✓ The CPU interfaces to the SCSI bus via a SCSI host adapter. Depending on the model, the
SCSI host adaptor is either on the CPU board or connects to the SBus or VMEbus.

■ The embedded SCSI provides support for a variety of devices,


such as a disk, tape, and CDROM.
✓ The embedded SCSI devices have the SCSI controller embedded (integrated) directly into
the drive electronics.

■ Supported SCSI devices come in three styles.


✓ Half-height (1.75 inches high)
Full-height (3.5 inches high)
Full-size 9-rack tape drive

■ Desktop systems only use SCSI devices.


✓ Pizza box systems have two internal disks.
Dinner box systems have one internal disk.
Monitor systems have no internal devices.

■ Deskside systems can use SCSI devices.


✓ The 5-slot office pedestal can have two full-height, or one full-height and two half-height
SCSI internal devices.

✓ The 12-slot office pedestals can have up to six SCSI internal devices.

■ Datacenter systems can use SCSI tape/CDROM devices only.


✓ Datacenters can have up to six tape devices and one CDROM.

✓ System acronyms for SCSI devices are:

- sd - SCSI disk

- st - SCSI tape

- sr - CDROM (in SunOS only; otherwise sd)

■ Tabletop server and dataserver systems only use SCSI devices.


✓ The tabletop server cabinet can have up to 18 devices. The dataservers cabinet can hold
up to 18 disk drives, 1 tape drive, and 1 CD-ROM.

Sun Product Line 2-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

SCSI Desktop Peripheral Packaging

Desktop Storage Pack (DSP)


■ Also called the lunchbox

■ Holds one half-height device

Lunchbox

Desktop Storage Module (DSM)


■ Also called the dinnerbox

■ Holds one full-height device

Dinnerbox

External Storage Module (ESM)


■ Also called the P-Box
■ Holds two full-height devices

P-box

2-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

The lunchbox and dinnerbox contain a single device and a power


supply.

■ The lunchbox measures 2.9 inches by 9.5 inches by 10.4 inches.


✓ The lunchbox is also know as a desktop storage pack or DSP. The DSP contains one
device of either a tape drive, a disk drive, or a CDROM. The DSP supports either a 3 1/2-
inch half-height embedded SCSI disk device, a 1/4-inch cartridge tape drive, or a 4-mm
DAT (digital-analog tape).

✓ A new version with a 4-mm DAT tape is called a Desktop Backup Storage Pack.

■ The dinnerbox measures 4.6 inches by 9.5 inches by 10.4 inches.


✓ The dinnerbox is also called a desktop storage module or DSM. The DSM is intended as a
replacement for the DSP. The DSM supports a single full-height device, either an 8-mm
tape drive or one SCSI disk.

■ Up to four dinnerboxes and lunchboxes can be daisy-chained.


✓ The SCSI specification allows for a maximum of 6-meters distance between the host
adaptor and the last device in the daisy-chain. The dinnerbox or lunchbox is attached to
the SCSI interface of the system.

The P-box contains up to two devices and a power supply.

✓ The P-box is also called an external storage module or ESM. The ESM is replaced by the
DSP. The ESM supports up to two full-height devices.

■ The P-box measures 9 inches by 7.5 inches by 20.25 inches.

■ Two P-boxes can be daisy-chained together and attached to one


workstation.
✓ The lunchbox, dinnerbox, and P-box can be used on deskside systems for expansion.

Sun Product Line 2-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

ESMD and IPI Disk Drives

ESMD—Enhanced Storage Module Device


■ Has four disks per controller

■ Has up to four controllers per deskside

IPI—Intelligent Peripheral Interface II


■ Has eight disks per controller

■ Has up to four controllers per deskside

■ Has up to five controllers per datacenter

2-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

■ ESMD and IPI disk subsystems are supported on deskside


systems.
■ Only the IPI disk subsystem is supported on datacenter systems.

■ The ESMD is a disk interface standard.


✓ The ESMD controller can control up to four disks simultaneously. Four ESMD controllers
are supported in the deskside systems.

✓ System acronym for ESMD devices is:

- xd—ESMD disk

■ The IPI/2 subsystem is based on the intelligent peripheral


interface, level 2, and level 3 ANSI standard.
✓ Provides the means to expand where ESMD could not.

✓ Gives increased capacity and I/O throughput.

✓ The IPI controller can control up to eight disks simultaneously. Four IPI controllers are
supported in the deskside systems, and up to five can be inserted into the datacenter
systems.

✓ System acronym for IPI devices is:

- id—IPI disk

Sun Product Line 2-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

SCSI Device Interconnection

External SCSI peripherals can be connected together as shown


below (this is called daisy chaining).

SCSI Port

Sun 0.8 meter


SCSI interconnect
cables
DSP Peripheral

DSP Peripheral
Sun 2 meter
SCSI interconnect
cables

ESM Box
(two peripherals)
Terminator

2-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

■ There is no SCSI In or SCSI Out orientation on external


peripheral enclosures
✓ The two SCSI connectors on the enclosures are wired in parallel.

■ The maximum overall cable length for a single SCSI interface is 6


meters.

■ The example at the left shows three SCSI enclosures connected


together with cables totalling 3.6 meters.
✓ There is a small amount of internal cabling in the system and the external enclosures that
must also be taken into account. This would add about another 0.5 meters to the total.

■ How many of these boxes can you daisy-chain together?


✓ Up to 7 on a single SCSI interface.

✓ This would require 7 cables that are at least 0.8 meters in length for a total of 5.6 meters.

✓ With the internal SCSI circuitry in each box you will exceed the maximum length.

■ The ESM box has special SCSI connectors that are larger in size
and it requires a cable with a special connector on one end.

Sun Product Line 2-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Deskside and Datacenter/Server Expansion

Desksides With Expansion Pedestal

Tabletop server

X30 SCSI X70 Expansion


5-slot expansion 12-slot pedestal
chassis pedestal chassis

Datacenter/Server With Expansion Cabinet

Datacenter/server Expansion cabinet


cabinet

2-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

Expansion Pedestals
■ Are used with deskside systems.

■ Have the same dimensions as the X70 chassis.

■ Support two expansion pedestals.


✓ Have an internal power supply for storage devices.

✓ Each cabinet supports up to four ESMD or IPI disks.

✓ Each cabinet supports up to eight SCSI drives, and either two tape units or one tape unit,
and one CD unit.

■ The tabletop server can support desktop expansion boxes, as well


as the SCSI expansion pedestal.
✓ The SCSI cabinet can be supported on desktop systems.

Expansion Cabinets
■ Are used with datacenter systems.

■ Are used with dataserver systems.

■ Have the same dimensions as the datacenter and dataserver


chassis.

■ Support two expansion cabinets.


✓ Have an internal power supply for storage devices.

✓ Each datacenter expansion cabinet supports up to 16 IPI drives, or 12 IPI drives, and 4
tape drives.

✓ Each dataserver expansion cabinet supports up to 36 SCSI drives, or 18 IPI drives, and 8
SCSI tape drives/CD-ROM.

Sun Product Line 2-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Monitors, Keyboards, and the Mouse (FRUs)

Typical Desktop System Components

Graphics display
Graphics display
(CRT)
(CRT)

Keyboard
Keyboard

CPU in
CPU
base in base

Mouse and pad


Mouse

Video cables
7 Monitor
1, 2, 3

Mouse
5 and pad

Keyboard

2-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

FRU means field replaceable unit.

Monitors
■ Monitors are not required for system operation.
✓ Monitors are available in color, monochrome, and gray-scale.

✓ Monitor sizes are:

- Monochrome—17-inch and 19-inch


- Color—16-inch, 19-inch, and a 21-inch (supported only by the GT graphics subsystem)

- Gray-scale—17-inch and 19-inch (uses single color input and displays 256 shades of
gray)

■ Standard pixel resolution on the monitors is 1152 by 900.


✓ Other resolutions are supported, depending upon the frame buffer installed.

■ Monitors require compatible frame buffers.

Frame Buffers
■ Frame buffers, like monitors, are not required.

■ A frame buffer is dedicated video memory and associated drivers.


✓ Some systems have the frame buffers physically built into the CPU board.

✓ Optional SBus frame buffers can be added to those systems capable of supported SBus
cards.

■ The frame buffer, not the monitor, determines the video


designation of the system.
✓ Example: GX (8 bit accelerated color) vs. GS (24 bit color) can use the same monitor.

Other FRUs
■ Keyboard

■ Three-buttoned optical mouse and mouse pad

■ Video cables

Sun Product Line 2-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

External System Connections

Typical Desktop System Connections

SPARCstation SLC (4/20)


SPARCstation ELC (4/25)
SPARCstation IPC (4/40)
SPARCstation IPX (4/50)

SCSI KB
Ethernet A B
Frame
buffer Audio

ENET
Audio SCSI
Keyboard
Serial Ports A and B

SPARCstation 10

Serial Twisted- For


ISDN AUI port future
port pair
ports Keyboard Ethernet use
Parallel
port SCSI

2-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Notes

SCSI Bus
✓ Supports a variety of disk, tape, and CDROM peripherals.

Ethernet Interfaces
■ AUI (attachment unit interface)
✓ Thick Ethernet with a passive adapter cable (outputs DB15 pins).

✓ Thin Ethernet with the passive adapter cable plus an active adapter.

✓ Also supports high-quality audio devices (a breakout adapter cable is needed to separate
out the audio portion of the interface).

■ TPE (twisted pair Ethernet)


✓ Also referred to as UTP (un-shielded twisted pair).

Asynchronous Serial Interfaces


■ Serial ports A and B
✓ Several types of connectors are supported.

✓ Used for terminals, serial printers, and modems.

■ Keyboard and mouse serial interface


✓ The mouse is connected to the system through the keyboard.

ISDN Interface
■ High-speed integrated services digital network (ISDN) digital
and high-quality audio communications
✓ There are two RJ45 connectors in parallel.

Other Interfaces
■ Audio interface
✓ General-purpose audio I/O interface for use with some Solaris software applications.

■ Parallel Interface
✓ General-purpose parallel interface, typically used for parallel port printers.

Sun Product Line 2-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Lab—Sun Product Line

Overview
The purpose of this lab is to correctly identify the different types of
Sun systems and peripheral terms.

Tools and Equipment


To complete this lab, you will need a pen or pencil and this module,
“Sun Product Line.”

Lab Exercises
1. RISC is defined as _____.
a. Reduced Instruction Set Code
b. Reduced Instruction Simulation Code
c. Reduced Instruction Set Computer

2. SPARC is defined as _____.


a. Sellable Processor ARChitecture
b. Sun Processor ARChitecture
c. Scalable Precision ARChitecture
d. Scalable Processor ARChitecture

3. Sun's implementation of RISC is _____.


a. Fixed-length, 32-bit registers and instructions
b. Fixed-length, 16-bit registers and instructions
c. Fixed-length, 32-bit registers and 16-bit instructions
d. Variable-length registers and instructions

4. Write SBus or VME next to the statements below.

_____ Located on the CPU

_____ Uses a backplane

_____ Exclusively on deskside and datacenter systems

2-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Lab—Sun Product Line

5. A SPARCstation 1 is commonly referred to as a ______ box.

a. Lunch c. Pizza

b. Dinner d. Breakfast

6. A SPARCstation SLC has ___ SBus slots.

a. 0 b. 1 c. 2 d. 3

7. Desktop systems support add-on devices using _______.

a. VME c. SBus

b. Cables d. Networks

8. Match the following system types with the descriptions.

a. Desktop b. Deskside c. Datacenter

_____ 16 VME slots _____ 12 VME slots

_____ Pizza box _____ Monitor only

_____ SBus only _____ 5 VME slots

_____ Dinner box _____ Expansion cabinet

9. SCSI is defined as _____.

a. Sun Computer System Interface

b. Small Computer System Interface

c. Small Computer to Sun Interface

d. Sun Computer SCSI Interface

Sun Product Line 2-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

Lab—Sun Product Line

10. SCSI controllers are connected to the CPU _____.

a. Directly c. Via a SCSI host adapter

b. Virtually d. Another SCSI controller

11. The lunchbox contains _____.

a. One full-height device c. Two full-height devices

b. One half-height device d. Two half-height devices

12. The external dinnerbox contains _____.

a. One full-height device c. Two full-height devices

b. One half-height device d. Two half-height devices

13. The P-box contains _____.

a. One full-height device c. Two full-height devices

b. One half-height device d. Two half-height devices

2-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
22 2

Lab—Sun Product Line

14. Match the following peripheral types with the following


descriptions.

a. SCSI b. ESMD c. IPI

_____ Eight disks per controller

_____ Four disks per controller

_____ One disk per controller

_____ Found exclusively on desktops

_____ xd

_____ id

_____ sd

_____ Expansion pedestal

_____ Expansion cabinet

_____ Dinner box

15. The video designation is determined by the ________.

a. Monitor c. Frame buffer

b. CPU board d. Cables

16. The standard pixel resolution is _______.

a. 1024x1024 c. 1600x1280

b. 1152x900 d. 720x680

17. How many SBus connectors does your system have? ______

This concludes the Sun Product Line lab.

Sun Product Line 2-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
2

2-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Introduction to Solaris 3

Objectives
Upon completion of this module, you will be able to:

■ Identify the differences between personal computers, mainframes,


and workstations.

■ Describe the purpose of an operating system.

■ Describe three major capabilities of the Solaris computing


environment.

■ Define the terms: host, user, client, diskless, dataless, datacenter,


and standalone.

■ Describe the Sun network.

Evaluation
Complete the lab at the end of this module.

Reference Information
System and Network Administration Guide, Part Number 800-3805-10,
Chapter 2

3-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

What Is a Workstation?

Personal
computer

Mainframe

Workstation

3-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Personal Computer
■ Single user
✓ One user at a time.

■ Limited memory (compared to a desktop or mainframe)

■ Limited hard disk (compared to a desktop or mainframe

Mainframe
■ Multiple users(hundreds)

■ Huge memory resources

■ Huge amounts of hard disk (disk farms)

■ Ideal for running a large number of simpler programs.

Workstation
■ Multiple users
✓ Optimized for one user at a time but other users can login remotely or from a modem.

■ Large memory resources

■ Large amounts of hard disk

■ Ideal for running a single complex science or engineering


application. (CAD, Database, 3 dimensional displays)

Introduction to Solaris 3-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Operating System Overview

■ Operating System

■ Virtual Memory Operating System

■ Solaris Computing Environment

File system

Solaris

Files

Kernel

Shell

Solaris computing environment

3-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Operating System
■ The operating system is a series of programs (or set of
instructions) that manages all computer operations and
provides a link between users and system resources.
✓ There are four components of the operating system:

- Kernel

- Shell
- File system

- Files

✓ The operating system converts requests coming from the mouse and keyboard into
computer operations.

✓ The operating system on Sun systems is part of the Solaris system software, and it is a
virtual memory operating system.

Virtual Memory Operating System


■ Any program instruction to be executed must reside in physical
memory.
✓ A virtual memory operating system allows applications to run even if they are larger than
physical memory. It does this by using a hard disk to support random access memory
(RAM). The required hard disk space is commonly called swap space.

✓ Swap space is discussed later in this course.

Solaris Computing Environment


■ The Solaris computing environment is a version of the UNIX
operating system.
✓ The Solaris operating system is popular in both commercial and technical environments.

✓ Versions of UNIX run on many different computer systems—from micros to mainframes.

Introduction to Solaris 3-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Kernel Overview

Hardware

CPU

Kernel

3-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

■ The kernel is the core of the UNIX operating system.


✓ It performs the following functions:

- Manages hardware, memory, and file-system resources


- Controls the transmission of information between your application and the CPU

- Stores information about the arrangement of the computer system and network

Introduction to Solaris 3-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Shell Overview

Hardware

CPU

Kernel

Shell

3-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Shell Functions
■ A shell is an interface between the user and the operating
system.
■ The shell interprets and validates commands you provide and
translates them into actions performed by the operating system.

■ There are three types of UNIX shells available in Solaris software:


■ Bourne shell ($)
✓ The Bourne shell, one of the three UNIX shells, is the default shell for the Sun OS 5.0
operating system. The Bourne shell was developed for AT&T™ System V.2 UNIX.

■ Korn shell ($)


✓ The Korn shell is a superset of the Bourne shell. It has many of the Bourne shell features
and additional features, such as aliasing and history.

✓ The command format of the Korn shell is compatible with the Bourne shell.

■ C shell (%)
✓ The C shell is also a superset of the Bourne shell. The C shell was developed for the
University of California at Berkeley (BSD) UNIX. It has many features that are similar to the
Korn shell.

✓ The C shell has unique features, such as the ability to perform command substitution and
to create a log-out file that performs special operations when a user logs off the system.

✓ The command format of the C shell is not compatible with the Bourne and Korn shells.

Introduction to Solaris 3-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

File System Overview

Solaris file system

Directory

Subdirectories

Files

3-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

■ The file system organizes data on a disk in a hierarchical


structure of directories similar to the way a file cabinet stores
information.

■ Directories compare to file drawers in a filing cabinet.

■ Subdirectories are similar to folders.

■ Files are equivalent to the contents of the folders, like pieces of


paper.
✓ File systems are discussed in more detail later in this course.

Introduction to Solaris 3-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Solaris Client-Server Environment

Server

Network
Clients

Remote printing system

3-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Solaris Client-Server Environment


The client-server environment has three components:

■ Network
✓ The network physically connects machines to enable communication between users on
other systems. Sun products, like the NFS distributed file system and the NIS, enable
users to share resources across the network.

✓ All Sun systems have a network interface built into the CPU board.

■ Server
✓ A server provides resources to one or more clients on the network.

■ Client
✓ A client is a machine that uses the services from one or more servers on a network.

■ Remote printing system


✓ Remote printing systems are generally available for use by all clients.

Introduction to Solaris 3-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Characteristics of the UNIX Operating System

Interactive
grob% man ls
Reformatting page. Wait... done

LS(1V) USER COMMANDS LS(1V)

NAME
ls - list the contents of a directory

Multiple Tasking

Monitoring system
performance
Editing a file

Multiple Users

3-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

■ The UNIX operating system, upon which the SunOS 5.0


operating system is based, has three basic characteristics:
■ Interactive
✓ Gives you a direct response when you enter information through the keyboard or the
mouse.

■ Multiple tasking
✓ UNIX enables you to use more than one tool or application at a time.

✓ The kernel can keep track of several processes at the same time.

■ Multiple users
✓ UNIX enables more than one user to access the same system resources simultaneously.

Introduction to Solaris 3-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Hosts and Users

Hosts
All computers, regardless of the type of machine, are called hosts. Each
host:

■ Has a unique host name


■ If attached to a network, has a unique address on the network
called an Internet address

User
A user is a person who performs a task on a computer or host. Each
user logs in to the host and gains access to a personal workspace called
a home directory. Each user is assigned a home directory from a
particular place in the file system.

3-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

■ Two important concepts are host and user.


■ Each host is located on the network by a unique address
called an Internet address.
✓ All machines, regardless of the type of machine, are called hosts. A host has a unique
name, called a host name.

■ A user is a person who uses a host.


✓ The user logs in to the machine, and performs some task on the host. Each user gains
access to files on the host from a particular place in the file system called a home
directory. Usually, each user is assigned their own home directory.

Introduction to Solaris 3-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Standalone and File-Server Systems

A user can operate a standalone host as an independently functioning


workstation with one user, attach it to a network, or use it as a time-
sharing system with several users. If you attach the standalone host to
a network, it can use services provided by servers on the network, such
as additional files and electronic mail.

Standalone
The standalone workstation:

■ Has its own local disk that contains all files and executables
required for functioning
■ Does not require a network to function

■ Does not require a file server to boot

File Server
A file server is a machine that:

■ Shares its disk storage and files with client machines

■ Provides client support over the network

■ Can provide several software services

3-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Standalone
■ The standalone workstation does not need a file server to boot.

■ The standalone workstation has its own local disk.


✓ The user can operate the standalone workstation as an independently functioning
workstation with one user, attach it to a network, or use it as a time-sharing system with
several users. If the user attaches the standalone workstation to a network, it can then
use services provided by servers on the network, such as additional files, electronic mail,
and the like.

File Server
■ File servers provide the files and disk storage needed by client
machines.
■ The most important characteristic of a file server is that it provides
substantial disk space for use by other machines on the network.
✓ Typically, file servers have more powerful CPUs, more memory, and faster and larger disk
sub-systems. The file server is most often a datacenter machine because it is powerful
enough to perform many server functions.

Introduction to Solaris 3-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Client Types

A client is a system that utilizes data from another system across the
network. There are two types of clients: dataless and diskless.

Dataless Client
■ Must get executables from a file server

■ Cannot boot completely from local files

Diskless Client
■ Does not use a disk

■ Must get all files and executables from a file server

3-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

Dataless Client
■ A dataless client is a workstation that has its own disk for
storing part of what it needs to boot.
■ The dataless client receives most executables from a file server; it
cannot boot completely without the executable programs.
✓ A dataless client is attached to a network and relies on a file server for necessary
resources. The dataless client gets executable files (called the /usr files), which are
necessary for its operation, from a file server over the network. This configuration permits
the storing of executables for several dataless clients on one file server, which reduces
the overall amount of disk space required.

Diskless Client
■ A diskless client is a workstation that uses no local disk space.

■ The diskless client’s operating system and individual user files are
stored on the file server’s disk.
✓ Typically, the diskless client’s files that are required for booting reside on a single file
server, but executable files and data files can reside on more than one file server.
Diskless clients reduce the system cost and are quieter than systems with local disks.
They also make system administration easier because they are confined to the server.

Introduction to Solaris 3-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Network Definitions

A network is the hardware that connects various systems, enabling


them to communicate.

Solaris client-server environment

3-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Notes

■ A local area network is called a LAN.


✓ It is called a Local Area Network because the network is local to the area in which it is
being used. It ties together machines that are close in proximity to one another.

■ The LAN that Sun uses is called Ethernet.


✓ The Ethernet has a backbone cable that transmits network communications between
machines. This backbone cable can consist of many types of cables; from coaxial to fiber-
optic to twisted-pair (like telephone wire).

■ All Sun computers are designed to use Ethernet.


✓ All Sun computers are designed with an Ethernet controller and a connector and are used
for network communications. The ability to use the networking software is built into the
operating system; however, networking programs must be installed from the installation
media if the network is to be used.

■ The cable that connects the Ethernet interface to the


backbone is called a transceiver cable.
✓ The transceiver cable, also called a drop cable or medium attachment unit (MAU),
connects to the Ethernet interface at the back of the machine. It connects to the backbone
through a device called a transceiver. The transceiver provides the electrical isolation
between the coaxial and the transceiver cables.

■ The built-in Ethernet controller is on the CPU board.


✓ The Ethernet controller makes intelligent decisions about sending and receiving data.
There are two types used on Sun machines:

- ie—Intel® Ethernet controller

- le—Lance™ (Amdahl®) Ethernet controller

■ All machines on a LAN are called nodes.


✓ Whether the machine is a type of Sun computer, a printer, a plotter, or some other
company’s computer, it is known generally as a node.

Introduction to Solaris 3-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Lab—Solaris Introduction

Overview
The purpose of this lab is to correctly identify the different types of
computers, operating systems, and the major parts of the Solaris
computing environment.

Tools and Equipment


To complete this lab, you will need a pen or pencil and this module,
“Introduction to Solaris.”

Lab Exercise
1. A personal computer is ____________ .
(circle all that apply)

a. Single-user, single-tasking

b. Single-user, multiple-tasking

c. Multiple-user, multiple-tasking

d. Dedicated processor, dedicated resources

2. A mainframe computer is __________ .


(circle all that apply)

a. Single-user, single-tasking

b. Multiple-user, multiple-tasking

c. Single-user, multiple-tasking

d. Multiple-user, single-tasking

e. Time-shared processor, shared resources

3-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Lab—Solaris Introduction

3. A workstation is: ________________


(circle all that apply)

f. single-user, multiple-tasking

g. multiple-user, single-tasking

h. time-shared processor, dedicated resources

i. dedicated processor, shared resources

4. An operating system is a series of programs that

________________________________________________________

_______________________________________________________ .

5. A virtual memory operating system allows applications to run as


if there is more

_______________________________________________________ .

6. Solaris is a ____________________________ computing


environment.

7. The kernel is the ___________ of the UNIX operating system.

a. Core c. User

b. Owner d. Shell

Introduction to Solaris 3-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Lab—Solaris Introduction

8. Match the following items to the descriptions listed below.

a. Kernel b. Shell c. File system

_____ Represents the user interface, translating requests into


actions

_____ Manages and allocates resources among users

_____ Provides command interpretation

_____ Organizes and stores data in a hierarchical structure

_____ Performs memory management

_____ Components are files and directories

_____ Controls disks, tapes, printers, terminals,


communication lines, and other devices

9. The __________ physically connects machines to enable


communication between users on other systems.

a. Diskette c. Network

b. Disk d. Telephone

10. The __________ provides resources to the network.

a. Server c. Client

b. Operating system d. Shell

11. The __________ uses services from the network.

a. Server c. Client

b. Operating system d. Shell

3-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
33 3

Lab—Solaris Introduction

12. Match the UNIX characteristics with the appropriate descriptions


listed below:

a. Multiple-tasking b. Interactive c. Multiple-user

_____ Direct response to keyboard and mouse input

_____ Users share system resources

_____ Ability to run several programs simultaneously

13. Host is referred to by a __________ .

a. Host name c. User name

b. User type d. Machine type

14. A user is a _________ .

a. System name c. System on the network

b. System type d. Person using a host

15. A standalone system is a system _______ .

a. Without a disk

b. With a disk that requires a network from which to boot

c. Which provides network services

d. With a local disk

16. A file server is a system _________ .

a. Without a disk

b. With a disk that requires a network from which to boot

c. Which provides network services

d. With a local disk

Introduction to Solaris 3-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
3

Lab—Solaris Introduction

17. A dataless client is a system ________ .

a. Without a disk

b. With a disk that requires a network from which to boot

c. Which provides network services

d. With a local disk

18. A diskless client is a system _______.

a. Without a disk

b. With a disk that requires a network from which to boot

c. Which provides network services

d. With a local disk

19. The default Sun LAN is called ________.

a. Token ring c. Ethernet

b. Microwave d. LAN

20. A generic name for any device using a LAN is _______ .

a. Node c. User

b. Host d. Workstation

This concludes the Introduction to the Solaris Computing


Environment lab.

3-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
System Boot Sequence 4

Objectives
Upon completion of this module, you will be able to:

■ Identify the completion of POST.


■ Identify the banner and its components.
■ Perform a system reset.
■ Perform a system boot.
■ Identify and trace specific parts of the basic boot sequence.
■ Log into a system.
■ Log out of a system.
■ Halt a system.

Evaluation
Complete the lab at end of this module.

Reference Information
Solaris User’s Guide: Getting Started, Part Number 800-3830, Chapter 4

4-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

System Boot Sequence Overview


Reset Reset

POST

Boot PROM Boot PROM loads boot blocks from disk

Boot block Boot blocks instructions load the boot program

boot
boot program loads the kernel (/kernel/unix)
program

the kernel
Kernel checks for attached devices
(/kernel/unix)

Script files Execute rc script files

Login

4-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ The system output during a start-up operation is the result of


several distinctly different stages.
✓ Each stage is unique and can easily be identified with a little experience.

■ A general understanding is more important than knowing all of


the detailed steps in a maintenance environment.
✓ The step-by-step understanding is the result of time spent working in the field and
studying system files over a period of time.

■ The block diagram shows all of the steps that are involved during
a system boot.
✓ This lecture focuses on each of the general areas; future modules explain them in more
detail.

System Boot Sequence 4-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Boot PROM Functions

Boot PROM(s)

POST
diagnostics

Device
drivers
IU

Machine instructions (SPARC CPU chip)


User
diagnostics

Boot
programs

4-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

The primary function of any boot PROM is to interact with the system
hardware and to provide the software foundation necessary to run
programs.
✓ Contents of the boot PROM cannot be altered.

✓ During system initialization, the SunOS and standalone programs depend on the boot
PROM for their initial program loading.

There are four major parts to the boot PROM

■ POST diagnostics
✓ This is called Power-On Self-Test (POST).

✓ POST diagnostics test the vital circuitry on the CPU board. They are run automatically
when system power is turned on or when a system reset is forced by using firmware
commands.

■ Boot programs and device driver


✓ These contain driver programs and codes that are necessary to begin the system boot
process.

■ Extended diagnostics
✓ Referred to as “extended” diagnostics—these are manually initiated, and test the input
devices, output devices, and boot devices necessary to boot the system. The number of
extended diagnostics varies with different revisions of the boot PROMs and systems.

■ Utility commands (firmware user interface)


✓ The user commands can be used to alter locations in memory, registers, and to change
system configurations.

System Boot Sequence 4-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Boot PROM Resources

Uniprocessor Deskside and Datacenter Systems


The IDPROM contains:

■ Ethernet address

■ Host ID

■ Serial number

The EEPROM contains:

■ Configuration parameters

Multiprocessor and Desktop Systems


The NVRAM contains:

■ Ethernet address

■ Host ID

■ Serial number

■ Configuration parameters

4-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ The uniprocessor deskside and datacenters have a IDPROM


and EEPROM combination.
✓ The IDPROM contains the Ethernet address, host ID, and serial number.

✓ The EEPROM contains system configurations.

✓ The IDPROM cannot be altered; only the parameters in the EEPROM can be changed.

■ The desktop systems and the multiprocessor deskside and


datacenters use the NVRAM in place of the IDPROM/EEPROM
combination.
✓ On desktop systems and multiprocessor systems, the NVRAM contains the Ethernet
address, host ID, serial number, and system operational parameters.

✓ Some NVRAM parameters can be changed.

System Boot Sequence 4-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Boot PROM User Interface

System Output

Type b (boot), c (continue), or n (new command mode)


>

Format

> Old-Mode prompt)

> c (continue from a UNIX abort)


> b (boot the system)
> n (go to new-mode)

ok New-Mode prompt)

ok
ok old -mode

Example

Type b (boot), c (continue), or n (new command mode)


> n
Type help for more information
ok

4-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ Uniprocessor deskside and datacenter systems have only the >


prompt.
✓ This prompt allows the user to communicate at the assembly-language level of the boot
PROM.

✓ This prompt allows the user to use commands that are designed to modify and examine
various system registers or, enable and disable sections of CPU logic. All of the logic
involved cannot be replaced and is thoroughly tested by POST diagnostics.

■ The desktop and the multiprocessor deskside and datacenter


systems have both the > and the ok prompt.

■ The > prompt on the screen does not operate as the traditional
monitor prompt does. As shown, you can type only three
commands at this prompt:

Type b (boot), c (continue), or n (new command mode)


>

■ b—to boot the system

■ c—to continue an interrupted program


✓ Such as when the Stop - a (L1-A) command was used.

■ n—to get into the new mode of operation


✓ The new mode of operation is the Forth toolkit.

■ The Forth toolkit prompt is the ok prompt.


✓ The boot PROMs contain commands and variables written in Forth language.

✓ The PROM-based operating system is called an interpreter and it converts the Forth words
to machine instructions.

✓ The Forth toolkit allows more flexibility and user friendliness than the old-mode (>).

✓ The > prompt enables the user to do much more than the original monitor prompt.

■ Once you are in the toolkit, you must type the command
old–mode to get back to the monitor-like prompt.
✓ Because there are equivalent new-mode commands, using old-mode commands is not
necessary.

✓ Old-mode is for users who have not worked with newer Sun systems. It is a historical
leftover.

System Boot Sequence 4-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Resetting the System

Use the following to reset the system via the keyboard:

Monitor Programs
> k2

Forth Toolkit

Type b (boot), c (continue), or n (new command mode)


> n
Type help for more information
ok reset

4-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ Resetting the system using the keyboard resets the CPU and
restarts POST.
✓ This is almost the equivalent of power cycling the system.

✓ Resetting the system displays the banner after the POST completes.

✓ The uniprocessor deskside and datacenters use > k2.

✓ The desktop and multiprocessor deskside and datacenters use ok reset.

System Boot Sequence 4-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Power-On Self-Test Overview

Power-on (reset)

P A series of tests are run before the banner


O is displayed.

S None of the messages generated by


POST are displayed to the terminal.
T

Selftest Completed

SPARCstation IPX, Type-4 Keyboard


ROM Rev 2.3, 16MB Memory, Serial # 10879
Ethernet address 8:0:22:9:1D:4A, Host Id 57002A7F

Testing 16 Megabytes of memory \

4-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ Upon power-up, the boot PROM initiates the POST.

■ The boot PROM contains the programs for POST and system
initialization sequence.

■ The objectives of POST are to quickly verify the system’s ability to


load the SunOS operating system, and to initialize the system
hardware.
✓ The majority of the messages produced by POST are not displayed on the monitor screen.

■ The POST and component initialization occur concurrently; each


component is initialized as testing completes.
✓ The POST performs minimum confidence (not comprehensive) tests.

✓ The exact tests and depth vary with different system models.

■ When POST is completed, the keyboard banner is displayed on the


terminal.

System Boot Sequence 4-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

The Keyboard Banner

Banner Display
Selftest Completed

SPARCstation IPX, Type-4 Keyboard


ROM Rev 2.3, 16MB Memory, Serial # 10879
Ethernet address 8:0:22:9:1D:4A, Host Id 57002A7F
Testing 16 Megabytes of memory \

Banner Contents
■ System Type

■ Keyboard Type

■ Boot PROM revision

■ Amount of memory detected

■ System serial number

■ Ethernet address

■ Host ID

4-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes
Use the following to display the banner via the keyboard:

Monitor Programs
> kb

Forth Toolkit
Type b (boot), c (continue), or n (new command mode)
> n
Type help for more information
ok banner

■ Displaying the banner using the keyboard enables examination


without resetting the CPU and restarting POST.
✓ Using the appropriate banner command displays the banner without resetting the CPU
and restarting POST.

✓ The uniprocessor deskside and datacenters use > kb.

✓ All desktop and multiprocessor systems use ok banner.

■ When self-test has been completed, the banner is displayed on


the output device.
✓ This is an indication that POST has been completed.

■ The banner information is collected by the boot PROM from


several sources:

■ Ethernet address, Hostid, serial number, system type


✓ This information is permanently stored in the NVRAM and is retrieved by the Boot PROM.

■ Keyboard type
✓ The system keyboard has a small PROM that is read by the Boot PROM.

■ Boot PROM revision


✓ The ROM revision number is permanently encoded in the Boot PROM itself

■ Amount of memory
✓ Amount of memory detected is a result of the amount of memory POST initialized.

✓ Incorrect memory size could indicate a memory problem.

✓ Amount of memory to test is a user specified number stored in the NVRAM.

System Boot Sequence 4-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Booting the System

Use the following to boot the system:

Monitor Programs

> b -v

or

Type b (boot), c (continue), or n (new command mode)


> b -v

Forth Toolkit
ok boot -v

4-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ To boot from the default boot device, use > b or ok boot.


✓ The default boot device is a user specified entry in the NVRAM; typically, this is a disk.

■ On uniprocessor deskside and datacenter systems using the


monitor programs, use > b.

■ On desktop and multiprocessor deskside and datacenter systems,


use > b or ok boot.
✓ Booting these systems re-displays the banner.

■ Displaying the banner using the keyboard enables examination


without resetting the system.
✓ Using the appropriate banner command displays the banner without resetting the CPU
and restarting POST.

■ The uniprocessor deskside and datacenter systems use the form >
kb.

■ The desktop and multiprocessor deskside and datacenter systems


use the form ok banner.

■ The -v option causes Solaris software to output for more verbose


boot messages than usual.
✓ This is useful during problem isolation.

System Boot Sequence 4-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Aborting the Boot Sequence

If your system has just started to boot and you suddenly want to stop
it, you can abort the boot sequence by pressing Stop-A (L1-A) on the
keyboard.

Press and
Hold Stop (L1)

F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 | Del


Esc 1 2 3 4 5 6 7 8 9 0 - = Back
Type Letter A Tab Q W E R T Y U I O P [ ] Ret
Control A S D F G H J K L : “ ~
Shift Z X C V B N M , . / Shift
Help Ins

■ System output—uniprocessor desksides and datacenters

Abort at PC 0xFFE9585C
>

■ System output—desktops and multiprocessor desksides and


datacenters

Type b (boot), c (continue), or n (new command mode)


>

4-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

The Stop -A key combination (also called L1 -A) is a system abort


command.
✓ This key combination sends an abort sequence to the CPU to terminate the boot.

✓ The Stop -A combination places the system into the monitor mode.

■ The uniprocessor deskside and datacenters prints the following


message:

Abort at PC 0xFFE9585C
>
■ The desktop systems and the multiprocessor deskside and
datacenters prints the following message:

Type b (boot), c (continue), or n (new command mode)


>

Monitor prompt >


✓ This prompt is called a monitor prompt. It indicates the most basic level of system
operation, such as communicating with the boot PROM. This comes directly from the boot
PROM and indicates that UNIX is halted. There is nothing running in the CPU memory.
Other manufacturers might refer to this as “console mode.”

Warning – Aborting Solaris software after it has finished booting is


an emergency procedure and should never be done unless there is
no other way, such as logging in remotely over the network and
halting Solaris software.

System Boot Sequence 4-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Loading the Boot Program and the Kernel

Annotation Boot Program (Output)

ok boot -v
Boot device: /sbus/esp@0,800000/sd@3,0 File and args: -v

Annotation Kernel (Output)

Size: 618912+118756+45904 Bytes


SunOS Release 5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1992, Sun Microsystems, Inc.
mem = 16384K (0x1000000)
avail mem = 14077952
Ethernet address = 8:0:20:c:10:d3
root nexus = SUNW,Sun 4_50

4-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ The default boot device is determined.


✓ The system configuration determines which device boots the operating system.

■ The boot program is loaded into main memory.


✓ The primary purpose of the boot program is to locate and load the kernel into the main
system memory.

✓ The default name of the kernel is /kernel/unix.

■ The boot program locates the kernel (/kernel/unix) and begins


loading.
✓ The “Size:” numbers are program information and represent the number of instructions
loaded; that is assigned data and un-assigned data. They have nothing to do with the size
of the /kernel/unix file.

■ The kernel first identifies the system type and the available
memory.

■ This is an example of a desktop system boot.

■ The kernel first identifies its manufacturer, itself, memory


statistics, and the machine’s Ethernet address.
✓ The kernel identifies its manufacturer from compiled data in the kernel; identifies itself
from the information in the hostid; gets the memory statistics (initial size and current
available memory) by probing the memory; and the machine’s Ethernet address from
idprom/NVRAM.

System Boot Sequence 4-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Kernel Device Probing

Resulting Output
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
swap on swapfs fstype swapfs size 13420K
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000

4-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ The kernel probes for system devices and loads the appropriate
device drivers.
✓ The kernel tries to match active devices with device drivers in the /kernel directory. If
there is no device driver for an existing device, the system continues booting and this
effectively turns off the device.

✓ By matching the device drivers with existing devices, the system in effect becomes an
auto-configuring system.

■ The system also generates an entry in the /devices directory for


each device seen.
✓ There is an entry for each device in the /devices directory. If they are not there, the
device was not seen during boot.

■ Only devices that are present show at boot time.


✓ The only disks that are present in the example shown are: One SCSI disk drive (sd0).

✓ sd6 is the CDROM.

■ The following is boot command output without the -v option:

ok boot
Boot device: /sbus/esp@0,800000/sd@3,0 File and args:
SunOS Release 5.1 Version Generic [UNIX(R) System V
Release 4.0]
Copyright (c) 1983-1992, Sun Microsystems, Inc.
Hostname: SUNIPX
The system is coming up. Please wait.
checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast:add net
224.0.0.0:gateway sparc
Print services started.
syslog service starting.
The system is ready.

sparc console login: root

System Boot Sequence 4-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

RC Script File Startup

Script File Output

Hostname: sparc
dump on /dev/dsk/c0t3d0s1 size 32872K
The system is coming up. Please wait.
checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast:add net
224.0.0.0:gateway sparc
Print services started.
syslog service starting.
The system is ready.

sparc console login: root

4-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ After the kernel has finished probing for devices, a series of


script files are executed to start up any additional system
software that may be required.
■ For certain option boards, device drivers and microcode is
downloaded into memory.

■ The various boot messages are output by the script files.

System Boot Sequence 4-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Logging In and Logging Out

Login Prompt Format

hostname console login: user login name

At the Login Prompt, Type Your Login Name

sparc console login: root

To Log Out of Machine, Type:

# exit

sparc console login:

4-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ The machine’s name usually precedes the login prompt.


✓ By default in Sun systems, the machine’s name or host name precedes the login prompt.

✓ The machine name is different on each machine.

✓ The machine name in the example is sparc.

■ The login reflects the name of the user.


✓ The log-in procedure identifies to Solaris software, who the user is, where to place that
user in the system, and which command interpreter shell to start.

✓ In the example, the user name is root; root is a default Solaris software login name.

✓ If the login name is not valid, the user is refused access.

■ The root user is the superuser.


✓ The superuser of a system has expanded powers to perform system-level functions that
other users are not allowed to perform.

✓ For example, the root user can perform system maintenance to keep the operating system
functioning.

■ exit closes out your log-in session.


✓ This causes the login shell to exit.

System Boot Sequence 4-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

System Prompts

Different Prompts:

# (root)

$ (regular user)

Command Format

# passwd

Adding or Changing the Password for root

# passwd

New password:

Re-type new password:

4-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ Sun systems have two prompts available by default:

■ The # or root prompt tells you the user has special privileges.

■ The $ or regular user prompt tells you the user does not have
special privileges.
✓ The superuser, as described in the previous section, has access to the entire file
structure that the root holds. Regular users have access only to their own files and
directories.

■ When a new system boots up, there is no password existing for the
root user.
✓ Passwords need to be typed for each user.

■ Passwords must be six characters or longer.


✓ Shorter passwords are not accepted by Solaris software.

✓ Passwords longer than eight characters are truncated after the eighth character.

■ Valid password characters are: a–z and 0–9.

■ Valid passwords contain 6–8 characters.

■ Solaris is case sensitive—use lower-case letters for the password.


✓ Using upper-case letters can create problems when logging into the machine.

✓ Passwords must contain at least two alphabetic characters and at least one numeric or
special character.

✓ The password typed in at the keyboard is not echoed to the screen, and therefore cannot
be seen. This prevents others from seeing how many characters are in the password.

■ The double password prompt is to verify the password spelling.


✓ The password is selected and input by the user.

✓ If the password used is not valid, the user is refused access.

System Boot Sequence 4-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Stopping the Processor

Stopping the Processor

# halt

System Output

Halted

Program terminated
Type help for more information
ok

or

Halted

Program terminated
Type b (boot), c (continue), or n (new command mode)
>

4-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Notes

■ halt writes out any information pending to the disks and then
stops the processor.
✓ halt stops all processing by gracefully shutting down the system processes.

✓ Only the root user is permitted to halt the system.

✓ Only the superuser root is able to use these commands because it prevents regular
users from halting the system and perhaps causing damage to other users’ files.

■ halt sends no warning messages to users; only use halt on


machines without client systems.

■ The following examples show the system output after a halt


command has been issued on a desktop or multiprocessor
deskside or datacenter system.

■ The example below shows a halt command issued on a


uniprocessor deskside or datacenter system.

# halt
Halted
Program terminated
>

System Boot Sequence 4-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Lab—Initial System Preparation

Lab Overview
The purpose of this lab is to identify how to correctly:

■ Record contents of banner.

■ Reset the system.

■ Boot the system.

■ Identify and record specific parts of the boot flow.

■ Correctly log into the system.

■ Correctly log out of the system.

■ Correctly halt the system.

Tools and Equipment


To complete this lab, you will need one Sun Workstation, a pen or
pencil, and this module, “System Boot Sequence.”

4-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Lab—System Reset and Banner

1. Power on your system. If already powered on, halt your system


and power cycle it.

Note – After the banner is displayed, prevent booting with Stop -A


(L1-A).

2. Record the banner information in the space below.

Selftest Completed

Sun SPARCsystem ________ Type ___ keyboard


ROM Rev ___. ___ MB memory installed, Serial # ______
Ethernet address __:__:__:__:__:__ Hostid

3. Match the banner information with the firmware it is derived


from: (circle all that apply)

Banner Information Firmware

_____ Sun SPARC system a. Boot PROM

_____ Keyboard type b. NVRAM

_____ ROM Rev c. Keyboard PROM

_____ MB memory installed d. ID PROM

_____ Serial # e. Ethernet PROM

_____ Ethernet address f. EEPROM

_____ Host ID g. POST

System Boot Sequence 4-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Lab—System Reset and Banner

Note – All of the information, with the exception of MB memory


installed, comes from the firmware.

4. Use the appropriate command to perform a system reset.

> k2 or ok reset

5. What did your system do immediately after you typed the reset
command?

a. Blanked the screen c. Powered off the system

b. Displayed the banner d. Installed software

Note – If the banner displays, remember to use L1-A.

6. After the system finishes with its self-test, use the appropriate
command to manually display the banner.

> kb or ok banner

7. Did the banner re-display? Yes No

Note–The only difference you should see is that the Selftest Completed
message will be absent because POST diagnostics were not run.

4-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Lab—Default Boot and Boot Messages

In this section, you will boot the default boot device and identify parts
of the boot messages. (Your boot messages may be slightly different.)

1. Use the appropriate command to perform a system boot of the


default boot device.

> b -v or ok boot -v

2. Did the following boot messages occur? Yes No

Note–The message below will look quite different if your system has
Boot PROMs that are a 1.x revision

Boot device: /sbus/esp@0,800000/sd@3,0 File and args: -v


Size: 753664 + 96936 + 86504 bytes

Note – This message indicates that the boot sequence has begun.

3. What is the name of the booted kernel? _______________________

4. Did the following kernel messages occur? Yes No


SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1993 Sun Microsystems, Inc.
mem = 16384K (0x1000000)
avail mem = 14077952
Ethernet address = 8:0:22:9:1d:4a
root nexus = SUNW,Sun 4_50

Note – This message indicates that the kernel load has been successful.

5. What does the value in the “mem=” entry mean?


___________________________________________________________

6. Does the value in the “mem=” entry match the system banner “MB
memory installed” entry you previously recorded?

Yes No

System Boot Sequence 4-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Lab—Default Boot and Boot Messages

7. Did messages similar to the following occur? Yes No

sbus0 at root: obio 0xf8000000


dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
swap on swapfs fstype swapfs size 13420K
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
Hostname: sparc
dump on /dev/dsk/c0t3d0s1 size 32872K

Note – This message indicates that these are the available hardware
devices and the associated devices drivers interrogated by the kernel.

8. From the above messages, identify what type of option boards


your system uses?

a. SBus

b. VME

4-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Lab—Default Boot and Boot Messages

9. Did the following kernel messages occur? Yes No

The system is coming up. Please wait.


checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast: add net 224.0.0.0: gateway
sparc
Print services started.
syslog service starting.
The system is ready.
volume management started.
pseudo-device: vol0
vol0 is /pseudo-vol
fd0 at root: obio 0xf7200000 sparc ipl 11
fd0 is /fd@1, f7200000

sparc console login:

Note – This message indicates that the rc scripts have run to


completion.

10. From these messages, record the 8-digit address for the floppy
disk drive fd0. (Skip this question if you have a SPARCstation
SLC or ELC.)

Address: ___________________________________________

System Boot Sequence 4-37

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Lab—Logging In

In this section, you will be using different commands to log into the
system, log out of the system, and to halt the Solaris operating system.

1. At the login prompt, log into your system as root.

2. Did the system prompt you for a password? Yes No

3. If you answered the previous question No, why didn‘t the system
ask for a password?_________________________________________

4. Did the following login message occur? Yes No


sparc console login: root
Last login: Thu Feb 11 09:37:26 on console
Sun Microsystems Inc. SunOS 5.2 Generic March 1993
#

Note – The above messages indicates that login was successful.

5. What information can you extract from the login messages?

a. Solaris revision c. System name

b. User type d. System type

6. What does the system prompt identify?

a. Solaris revision c. System name

b. User type d. System type

7. How does the system prompt indicate the user type?


___________________________________________________________

8. At the system prompt, type the command who.

9. What did the system respond with? ___________________________

10. What does this indicate? _____________________________________

4-38 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Lab—Logging Out and Halting

1. To end the current login session, type exit.

a. What did the system respond with? _________________________


_________________________________________________________

b. What does this indicate? ___________________________________


_________________________________________________________

2. At the login prompt, log into your system as student.

3. Did the system prompt you for a password? Yes No

4. If you answered the previous question Yes, type student.

5. Did the following login message occur? Yes No


sparc console login: student
Last login: Thu Feb 11 09:37:26 on console
Sun Microsystems Inc. SunOS 5.2 Generic March 1993
$

6. There should have been a Login incorrect message. Why?


___________________________________________________________

7. At the login prompt, log into your system as root.

8. Are you logged in? Yes No

If you answered No, why? _______________________________

___________________________________________________________

9. At the system prompt, type the halt command. What did the
system respond with?
___________________________________________________________

___________________________________________________________

___________________________________________________________

System Boot Sequence 4-39

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

Lab—Logging Out, and Halting

10. What system prompt do you see?

a. # c. $

b. ok d. >

11. What does this prompt indicate? _____________________________

___________________________________________________________

12. Boot your system again.

13. At the login prompt, type root.

14. Did the following login messages occur? Yes No

sparc login: root


Last login: Thu Feb 11 09:50:26 on console
Sun Microsystems Inc. SunOS 5.2 Generic March 1993
#

15. Did the login message change? Yes No

16. If you answered Yes to the previous question, what changed?

__________________________________________________________

4-40 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
44 4

Lab—Setting Passwords

1. Now, set your password using the appropriate command.

a. Command used? ________________________________________

b. System response: ________________________________________

2. At the password prompt, type your workstation name as the


password.

3. Log out and log back in as root.

4. Did the system prompt you for a password? Yes No

a. If YES, type the password you created in step 2.

Did the system log you in? Yes No

b. If NO, why didn’t you get logged in?

_________________________________________

_________________________________________

5. Log out to end this session.

This concludes the System Boot Sequence lab.

System Boot Sequence 4-41

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
4

4-42 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
File System Hierarchy 5

Objectives

Upon completion of this module, you will be able to:

■ Identify the major parts of a file system.

■ Identify the major parts of the Solaris computing environment


directory structure.

Evaluation

Complete the lab at the end of this module.

Reference Information

Solaris User’s Guide: Getting Started, Part Number 800-3830,


Chapters 1–3

5-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
5

File System Directories and Subdirectories

Directories

/usr
/dev
/home

Subdirectories

etc share bin

Files

awk
at
as
arch
ar
adb

bin

5-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
55 5

Notes

■ A directory is a special type of file containing information about


other files and directories.
■ A subdirectory is a directory contained within another directory.

■ A file is a container to store data. Files can consist of memos,


reports, graphics, or other types of data. Files can also be
executable.

■ A directory can contain files and subdirectories.

■ The major advantage of the computer file system is that


directories, subdirectories, and files can be stored hierarchically.

root (/)

Parent directory Parent directory

Subdirectory Subdirectory Subdirectory Subdirectory

File System Hierarchy 5-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
5

Solaris Software Hierarchical File System Structure

kernel dev etc usr sbin home ufsboot

drv sparc

bin kernel share

drv

5-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
55 5

Notes

■ The Solaris computing environment has a file structure


hierarchy of directories, subdirectories, and files that are
usually organized or grouped together for a specific purpose.
✓ The Solaris software file system looks like an inverted tree structure.

■ The hierarchical file structure permits you to organize files


underneath subdirectories as you like.
✓ For example, the directory usr has other directories, such as bin, etc, and share
underneath it.

■ In these directories, there are other files or subdirectories.


✓ Note – Two files or two subdirectories can have the same name as long as they are in a
different directory. For example, kernel is a directory under both / and usr.

■ The parent directory is the directory one level above whatever


directory you are currently in.
✓ The parent directory for the entire file system is /.

■ The current directory is also called the current working directory.

■ There is no practical limit to the number of directory levels in the


file system.

File System Hierarchy 5-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
5

Important Solaris Software Subdirectories

kernel dev etc usr sbin home ufsboot

sparc

bin etc share

5-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
55 5

Notes

■ The topmost file is called the root directory, and it is the


starting point of the file hierarchy.All other directories are
hierarchically organized under the root.
■ The root directory, indicated by a slash (/), is required for the
Solaris computing environment to function. It contains critical
system files and the following important directories:
■ dev contains device files and provides access to disk and
tape devices.
■ etc contains important files and commands used for system
administration.

■ kernel is the collection of software comprising the core image


file (/kernel/unix) and all of the modules loaded at any
instant in time. The system does not function without a kernel
to control it.

■ Another important directory is usr, which contains important


system files and programs like OpenWindows, as well as other
standard software.

■ The home directory is used to store users’ home (or login)


directories. System administrators are responsible for setting up
users’ home directories.

■ You are automatically located in your home directory immediately


after logging in to the system.
✓ The root login home directory is /.

File System Hierarchy 5-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
5

Lab—File System Hierarchy

Overview
The purpose of this lab is to correctly identify the different parts of the
hierarchical file system and the major parts of the Solaris computing
environment file structure.

Tools and Equipment


To complete this lab, you will need a pen or pencil and this module,
“File System Hierarchy.”

Lab Exercise
Answer the following questions True or False.

_____ A directory is a special type of file that contains


information about other files and directories.

_____ The Solaris computing environment file system structure


is linear rather than hierarchical.

_____ The parent directory is one level above the current


directory.

_____ Two files or directories can have the same name as long
as they are in different directories.

_____ The limit of directory levels is 512 directories.

_____ The topmost file is called the top directory.

_____ The /usr directory contains system files and programs.

_____ The /etc directory provides access to devices like disks


and tapes.

_____ Once the hierarchical file structure is created, the user


cannot change it.

_____ Two files or directories can have the same name as long
as they share the same parent directory.

5-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Directory Commands 6

Objectives
Upon completion of this module, you will be able to:

■ Manage files and directories.

■ Describe file naming conventions.

■ Move around the directory structure.

■ Create, copy, and remove directories.

■ List directory contents.

Evaluation
Complete the lab at end of this module.

Reference Information
Solaris User’s Guide: Getting Started, Part Number 800-3830, Chapter 4

6-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

File Naming Conventions

Legal File Names

budget_2090 sched-q1

staff.rpt dept.goals

revenueq4% lost+found

Priority+ action-

6-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

Solaris file names can contain:

■ Alpha characters: A–Z and a–z

■ Numeric characters: 0–9

Solaris is a case-sensitive computing environment. The files sched.q1


and sched.Q1 are identified as two distinct files by the system.

Directory Commands 6-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Solaris Command Line Format

The general format for Solaris commands is:

command -option(s) argument(s)

■ Basic command line:

prompt: command

# pwd
# ls

■ Command line with options:

prompt: command -options

# ls -l
# ls -F

■ Command line with arguments:

prompt: command arguments

# ls /usr/lib
# cd /usr/lib/fonts
# man ls

■ Command line with arguments and options:

prompt: command -options arguments

# ls -l /usr/lib/font
# tar -tvf /dev/rmt/0

6-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ The Solaris command line format can be thought of as:

verb adverb object

or

what how who


✓ The verb is the command itself. The adverb is the option(s) used with the command. The
object is the thing upon which the command is performed. Solaris computing environment
reference manuals usually refer to the object as arguments. Solaris computing
environment reference manuals usually refer to the adverb as options.

■ Arguments are usually file names or directory names. Many


commands take more than one argument.
✓ An argument or a command can be specified as a path name.

✓ Path names begin with a slash (/), indicating the root directory (/).

✓ The other slashes in the path names are delimiters between directory names.

■ Options are prefaced with a hyphen (-). For example, -l is the


option to the ls command shown below.

Example:

ls -l /usr/lib/fonts

Directory Commands 6-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Displaying Manual Pages

Example of a man Page Display:

# man cd
CD(1) USER COMMANDS CD(1)

NAME
cd - change working directory
SYNOPSIS
cd [directory]
DESCRIPTION
directory becomes the new working directory. The process
must have execute (search) permission in directory. If cd
is used without arguments, it returns you to your ligon
directory. In csh(1) you may specify a list of directories
in which directory is to be sought as a subdirectory if it
is not a subdirectory of the current directory; see the
description of the cdpath variable in csh(1).
SEE ALSO
csh(1), pwd(1), sh(1)

Sun Release 4.1 Last change: 9 September 1987 1

6-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ Command format: man command.

■ The man command is used to display on-line manual pages for


most Solaris commands.
✓ The on-line manual pages are part of the Solaris computing environment as optional
software.

✓ Use the following keys to control the scrolling capabilities:

- Spacebar to scroll through a manual page one screen at a time

- Return to scroll through a manual page one line at a time

- B to move back one screen

- Q to quit the man command

■ man displays information from the reference manuals.


✓ It can display complete manual pages that you select by title or one-line summaries
selected by a keyword.

■ The SYNOPSIS line gives an example of how the command works.

■ To exit a long man display, type Q for quit.


✓ Sometimes the man page needed to be read has more information than is required—the
“Q” enables you to leave long man page displays.

Note – Unfortunately, the standard installation routine does not load


the man pages. These will have to be loaded in a future module.

Directory Commands 6-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Changing and Displaying Directories (cd and pwd)

From root’s Home Directory, (/)

# cd /usr
# pwd
/usr
#

kernel dev etc usr sbin home


ufsboot

drv

kernel sbin share games demo dict bin

drv man

6-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ Command format: cd (directory_name)

■ The cd command is utilized to change directories within a file


system.
✓ To change to another directory, specify the path name. The path name can be the name of
a subdirectory or several directories combined to make a single path.

Example:

# cd /usr

or

# cd /etc/lib

Note – The current directory is the directory that you are currently
working in and is displayed by using the pwd (print working
directory) command.

■ Command format: pwd

■ Use the pwd command to display the path name of your current
directory.

Examples:

# cd /usr/lib
# pwd
/usr/lib

# cd /home
# pwd
/home

Directory Commands 6-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Changing to the Parent Directory

From /usr Parent Directory, (/)

# cd ..
# pwd
/
#

kernel dev etc usr sbin home


ufsboot

drv

kernel sbin share games demo dict bin

drv man

6-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ The parent directory is the directory located one level above


(closer to the root directory) the current directory location.
✓ To return to a parent directory, use the cd command with the argument “ ..”. The “ ..”
denotes returning one level toward the root, the highest level in the directory hierarchy.

■ In the previous example, cd .. is the equivalent of typing


cd /.
✓ If the current working directory was /usr/demo, cd .. would be the equivalent of typing
cd /usr.

✓ You cannot move higher than the / directory.

■ You can use .. to move up several directories at a time. For


example, to move from the /usr/share/man directory to the /
directory, type:

# cd ../../..
# pwd
/

Note – Attempting to use the cd command to a non-directory gives the


following message: Not a directory.

Directory Commands 6-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Absolute Path Names

To the /usr/share Directory From root

# pwd
/
# cd /usr/share
# pwd
/usr/share
#

kernel dev etc usr sbin home


ufsboot

drv

kernel sbin share games demo dict bin

drv man

6-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ An absolute path name, also called a full path name, specifies a


file in relation to the entire Solaris file hierarchy, beginning at
the root (/) directory.
✓ An absolute path name always begins with a slash (/), indicating the root directory, and it
lists every directory to the destination directory.

✓ The other slashes in the path names are delimiters between directory names.

■ Using the cd command with an absolute path name gives you the
freedom to move to any directory in the file system without using
the current working directory as a reference point.

Examples of changing directories using absolute path names:

From directory To directory Command

/kernel/drv / cd /

/usr/local /usr/share/man cd /usr/share/man

/usr/dict /usr/games cd /usr/games

Directory Commands 6-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Relative Path Names

To the /usr/kernel Directory From /usr/share

# pwd
/usr/share
# cd ../kernel
# pwd
/usr/kernel
#

kernel dev etc usr sbin home


ufsboot

drv

kernel sbin share games demo dict bin

drv man

6-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ A relative path name specifies a file in relation to the current or


working directory.
✓ It is a more convenient way to maneuver in the file system without having to give the full,
absolute path name every time you want to access a file.

■ Relative path names start from the current working directory.


✓ The user must visualize where the destination directory is located with respect to the file
structure.

Examples of changing directories using relative path names:

From directory To directory Command

usr/kernel/drv usr/kernel cd ..

/usr /usr/dict cd dict

/usr/demo /usr/games cd ../games

Directory Commands 6-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Listing Directories (ls)

To List the Contents of the /etc Directory

# pwd
/etc
# ls
dfsdcopyhalt
fsmountnetid
passwdrmtabtm

# pwd
/etc
# ls

etc

dfs fs tm
dcopy halt mount netid passwd rmtab

6-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

■ The ls command lists the contents of directories.


✓ Unless you provide a path name, ls automatically assumes that you are in the current
working directory. You can run ls with either an absolute path name or a relative path
name to view the contents of a directory other than the current working directory.

■ The following example shows a partial listing of the /usr/etc


directory:
✓ ls lists the contents of a directory in the following order:

- Numerals-1file

- Uppercase letters-Afile

- Lowercase letters-afile

Examples:

# pwd
/usr/bin
# ls /usr/games
adventure boggletool factor mille snake
banner canfieldtool ...

# ls ..
4lib demo include man spool
5bin dict games ...

# ls ../5bin
adb cal expr od tabs
banner cpio grep ...

Directory Commands 6-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Creating Directories (mkdir)

To Make the Directories:


■ /export/test1

# cd /export
# pwd
/export
# ls
# mkdir test1
# ls
test1

■ /export/test2 and /export/test3

# mkdir test2 test3


# ls
test1 test2 test3

export

test1 test2 test3

6-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

Command format:

mkdir directory (directory...directory)

■ The mkdir command creates new directories.


✓ mkdir requires write permission in the parent directory.

■ If an attempt is made to create a new directory whose name


already exists, the following error message appears:

mkdir: directoryname: File exists

■ You must have the correct permissions in the parent directory to


create a directory.

# mkdir /home/games
mkdir: /home/games: Permission denied
#
✓ Permissions are covered later in the course.

■ You can create more than one new directory at a time.

Example:

# mkdir test2 test3


# ls

test1 test2 test3

Directory Commands 6-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Other Ways to Use the mkdir Command

To Make a Subdirectory in /export/test1 Called


/export/test1/test1a

# pwd
/export
# ls
test1
# mkdir test1/test1a
# ls
test1
# ls test1
test1a
#

export

test1 test2 test3

testla

6-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

New subdirectories can be created in several ways:

■ Example 1: A slash delineates primary directory and subdirectory.

# pwd
/export
# mkdir test1/test1a
# ls
test1
# ls test1
test1a

■ Example 2: Requires you to cd to the parent directory of the


new directory.

# pwd
/export
# cd test1
# ls
# mkdir test1a
# ls
test1a

■ Example 3: Requires that you use the absolute path name.

# pwd
/export
# mkdir /export/test1/test1a
# ls
test1
# ls test1
test1a

Directory Commands 6-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Removing Directories (rmdir)

To Remove the /export/test1 Directory:

# pwd
/export
# ls
test1
# rmdir test1
rmdir: test1: Directory not empty
# ls test1
test1a
# rmdir test1/test1a
# rmdir test1
# ls

export

test1 test2 test3

testla

6-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Notes

Command format:

rmdir directory (directory...directory)

■ The rmdir command removes existing empty directories.


✓ If the directory to be removed is not empty, you will see the error message, Directory
not empty.

■ In the example, the rmdir command fails on the directory


/export/test1 because it is not an empty directory. Next, the
test1a directory is removed from the /export/test1 directory.
✓ rmdir accepts multiple directory names on the command line.

■ Relative and absolute path names can be used to identify the


directories you want to remove.
✓ To use rmdir, the user must have write permission in the parent directory.

■ If you type rmdir from the wrong parent directory, or if the


directory name is misspelled, the following error message appears:

rmdir: directoryname: No such file or directory

Directory Commands 6-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Lab—Directory Commands

Overview
The purpose of this lab is to:

■ Correctly maneuver the file hierarchy.

■ Describe the use of system directories.

■ Identify your location in the file hierarchy.

■ Create and remove directories.

■ Use the system reference manual.

Tools and Equipment


One or two workstations for every two students running the Solaris
computing environment. a pencil or pen and this module, “Directory
Commands.”

Lab Exercise

Navigating the File Hierarchy


1. Log into the machine, print your current working directory, and
record your command line, indicating space(s) and the location
below:
Command line used: ___________________________

Location (absolute path): _______________________

2. You should be in the root directory. What is root the parent


directory of? ______________________

3. Change directories to the etc directory located beneath root using


the absolute path name. Record the command line used, indicating
space(s):

Command line: ________________

4. What other path could you have used as an argument to get to the
etc directory? ____________________________________

6-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Lab—Directory Commands

5. Print your current working directory. Record the command line


used and the location below:

Command line: _______________________________

Location (absolute path): _______________________

6. Change directories to the /usr directory. Record the command line


used below:

Command line: ________________________________

7. Print your current working directory. Record your location below:

Location (absolute path): _______________________

8. Change directories again, this time to the /usr/openwin directory,


using the relative path name.

Command line: ________________________________

9. Print your current working directory. Record your location below:

Location (absolute path): _______________________

10. In the space provided, draw a hierarchical diagram of your


present location beginning with the root directory. Hint – The root
directory is always indicated by a /. Use rectangles to indicate the
directories in the path.

Directory Commands 6-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

Lab—Directory Commands

Listing the Contents of Directories


1. Without moving from your present location, list the contents of the
share directory.

Record your command line: _____________________

Record the system output:

________ ________ ________ ________

________ ________ ________ ________

________ ________ ________ ________

________ ________ ________ ________

2. What is the parent directory of your present working directory?

______________________________________________

3. Without moving from your present location, list the contents of the
parent directory, and record the command used and output.

Command line: ________________________________

System output:

________ ________ ________ ________

________ ________ ________ ________

4. Without moving from your present location, list the contents of the
/var directory.

Command line: ________________________________

System output:

________ ________ ________ ________

________ ________ ________ ________

________ ________ ________ ________

________ ________ ________ ________

6-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
66 6

Lab—Directory Commands

Making and Removing Directories


1. Change to the /export directory.

Command line: ________________________________

2. Print out your working directory. Record the absolute path.

Location (absolute path): _______________________

3. What does the /export directory contain?


__________________________________________________

4. Use the make directory command to create a directory named


Dir1.

Command line: ________________________________

5. List the contents of /export. Record your command line and the
current directory contents.

Command line: _______________________________

Contents of current directory: ___________________

6. Make two more directories. Name one Dir2 and the other Dir3.

7. List the directory contents again to see if your directories are there.
Record the current directory contents below.

________ ________ ________ ________

8. Now, remove the Dir3 directory. Record your command line and
the contents of the current directory.

Command line: ________________________________

Contents of current directory: ________ ________

________ ________ ________ ________

This concludes the Directory Commands lab.

Directory Commands 6-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
6

6-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
File Commands 7

Objectives

Upon completion of this module, you will be able to:

■ Define a file and describe different types of files.

■ Execute the ls command using different options to display file


and directory information.

■ Execute the file command to identify the type of file.

■ Read a file using the more command.

Evaluation

Complete the lab at the end of this module.

Reference Information

Solaris User’s Guide: Getting Started, Part Number 800-3830, Chapter 4

7-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

What Is a File?

Do it now!

Dear Helen,
.......................
......................
......................
......................
......................
......................
......................
......................
......................
.........
.........

Documents
Commands

Files

/dev/null
“Nothing” file

Devices % ls -F
man1/ man2/ . . . .

Directories

7-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

■ The file is the basic unit of the Solaris computing environment.

■ Documents, commands, devices, and directories are all files.

Following are definitions of the various kinds of files:

■ Documents include text files, such as letters, computer source


code, or anything else you might write.
■ Most commands are executable files; that is, they are files that the
system can process without further translation. For example, the
chess command is an executable file.

■ Devices are files. The Solaris computing environment treats your


terminal, your printer, your disk drive, or any device that operates
as a part of, or extension of, the computer as files.

■ The /dev/null file is a “nothing” file. It is a special file that is like


a “trash” file, and any data that is directed there is discarded.

■ Directories are files. A directory is a file that contains other files.

File Commands 7-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Displaying Detailed Information About Files

■ Use the ls -l command to display detailed information about


your files and directories.

# ls -l /
lrwxrwxrwx 1 root root 9 Jun 29 23:40 bin -> usr/bin
drwxrwxr-x 15 root sys 4608 Jul 11 23:26 dev
drwxrwxr-x 4 root sys 512 Jun 30 00:14 devices
drwxrwxr-x 21 root sys 2560 Jul 11 22:35 etc
-rw-r--r-- 1 root sys 164324 Apr 1 15:46 ufsboot
drwxrwxr-x 21 root sys 512 Jun 30 1993 usr

Links Size
File or
directory
Permissions Group name

File type Owner Modification


date

7-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

File Description Fields

■ File types:

- Ordinary file (data or executable)


d Subdirectory
l Linked directory or files
✓ A symbolic link, identified by l, is a file that contains a reference to the name of another
file.

✓ When a program or a user references the symbolic link, the kernel references the file (or
directory) named by the link.

✓ Symbolic links are used to provide more than one name for a file or to provide a reference
to a file (or directory) across file systems.

✓ In the display example, the directory bin is a symbolic link to usr/bin.

■ Permissions
✓ Permissions allow or prohibit access by other users to read, write, or execute files;
subdirectories; or programs (which are executable files) in a directory.

■ Link count
✓ Indicates the hard link count for the file or directory. A hard link is an additional name for
a file. When a new link is made to a file, an alias for the file is created. Directories have at
least two links: one from the parent directory and one from inside the directory itself.

■ Owner
✓ Original creator of the subdirectory or file.

■ Group
✓ Group or original creator of the subdirectory or file.

■ Size of subdirectories or files in bytes

■ Created or modified
✓ Date and time of last modification in military format. Files older than 6 months show date
and year of the last modification.

■ Name of subdirectory or file

File Commands 7-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Displaying Files by Type

■ Use the ls -F command to display files by type.

# ls -F /
bin@ kadb lib@
etc/ kernel/ ufsboot
#

7-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

■ The four file types are identified with symbols as follows:

File Type Symbol


Directory /
Executable *
Link @
Any other file (none)
type

■ The following example shows the display that is returned when


you type ls -F /.

You can use the ls-1 and ls-F commands together.

Example:

# ls -lF /
total 1463
lrwxrwxrwx1rootroot9 Jun 29 23:40 bin->/usr/bin
drwxrwxr-x15rootsys4608 Jul 11 23:26 dev/
drwxrwxr-x4rootsys512 Jun 30 00:14 devices/
drwxrwxr-x21rootsys2560 Jul 11 22:35 etc/
-rw-r--r--1rootsys164324 Apr 1 15:46 ufsboot
drwxrwxr-x21rootsys512 Jun 30 1993 usr/

File Commands 7-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Identifying File Types With the file Command

Some Types of Files Cannot be Read

#file /usr/bin/ls
/usr/bin/ls: ELF 32-bit MSB executable SPARC Version 1

#file /home
/home: directory

#file /etc/utmp
/etc/utmp: data

Some Types of Files Can be Read

#file /etc/vfstab
/etc/vfstab: ascii text

#file /etc/mountall
/etc/mountall: executable /sbin/sh script

#file /etc/auto_home
/etc/auto_home: English text

7-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

Command format:

# file filename

■ The file command determines the file type by examining its


contents.
✓ The file command performs a series of tests on each file name to determine what it
contains. If the contents of a file appear to be ASCII text, file examines the first 512
bytes and tries to guess its language.

■ Use file when in doubt before trying to read the file name’s
contents.
✓ The file command prints a short explanation of the supposed file type.

- Three identifiable types cannot be read—those that are data, those that are directories,
and those that say executable SPARC. All others are readable.

- Executable SPARC means it is one of several ways to compile executables.

- The command scripts, executable shell scripts, and [nt]roff types are readable but
may not be readily understood without the appropriate programming background.

File Commands 7-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Displaying Files With the more Command

■ Use the more command to read one page at a time.

# more /etc/format.dat
#
# @(#)format.dat 1.31 92/07/21 SMI
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
# Data file for the ‘format’ program. This file defines the known
# disks, disk types, and partition maps.
#

#
# This is the search path for ‘format’. It contains all the disks that
# will be searched for if no disk list is given on the command line.
#
search_path = xd0, xd1, xd2, xd3, xd4, xd5, xd6, xd7, xd8, xd9, xd10,
xd11, \
xd12, xd13, xd14, xd15, xy[0-3], sd[0-7], sd8, sd9,
sd1[0-9], \
sd20, id0[0-4][0-7]

#
# This is the list of supported disks for the Xylogics 450/451
controller.
#
disk_type = “Fujitsu-M2312K” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 587 : acyl = 2 : pcyl = 589 : nhead = 7 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 1

disk_type = “Fujitsu-M2284/M2322” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 821 : acyl = 2 : pcyl = 823 : nhead = 10 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 2
--More--(5%)

7-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

Command format:

# more filename

The more command is a filter that displays the contents of a text file on
the terminal, one screen at a time. It normally pauses after each screen
and prints --More-- at the bottom of the screen.

✓ The more command displays the file as the file exists. The bottom line that says
--More--(5%) tells you that 5% of the file is being displayed.

✓ If the file to be displayed is smaller than a page, the entire file is displayed with no
--More-- statement shown.

✓ The size of the more file determines the percentage at the bottom.

You can use the following keys with the more command:

■ Spacebar Display the next screen full

■ ReturnDisplay the next line

■ b Move back one screen

■ fSkip past the next screen full

■ hDisplay a help menu of more features

■ q Quit and return to the shell prompt

File Commands 7-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Keyboard Interrupts

■ Press the Control key and the c key together to stop a program
or command.

Control

Control C

7-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Notes

■ You can use a sequence of control characters to perform specific


tasks, such as stopping and starting screen output.
■ To enter a sequence of control characters, hold down the Control
key and press some other key (character) on the keyboard.

■ The Control key is represented on the screen by the caret (^), such
as ^C for Control-C.

Control characters Purpose

Control-S Stops screen output


Control-Q Starts screen output
Control-C Interrupts current activity
Control-D Indicates end-of-file or logout
Control-U Erases the command line
Control-W Erases the word

File Commands 7-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Lab—File Commands

Overview

The purpose of this lab is to use the utility commands in this module
to correctly identify, create, remove, and read files.

Tools and Equipment

One or two workstations for every two students with a functioning


Solaris software file system, a pen or pencil, and this module, “File
Commands.”

Lab Exercise

Displaying and Identifying Files


1. Change directories to the /etc directory. Verify your current
working directory.

2. Use the ls command with the -l option to list the following file
names. Record the file types.

Caution – When examining directories using the ls command,


you must also use the -d option or ls will list only the contents of the
! directory.

File types: a. directory (d) b. file (blank) c. link (l)

_____ motd ($ ls -dl motd)

_____ dfs

_____ cron

_____ format.dat

7-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Lab—File Commands

3. Use the ls command with the -F option to list the following file
names. Record the file types.

File types: a. directory (/) c. file (blank)

b. executable (*) d. link (@)

_____ auto_master ($ ls -dF auto_master)

_____ dcopy

_____ fs

_____ device.tab

4. Use the file command to list the following file names. Record the
file types.

File types: a. directory c. ASCII text

b. shell commands d. link

_____ lp ($ file lp)

_____ magic

_____ profile

_____ getty

Note – None of the files in the above step are SPARC executable file
types.

5. Move to the /bin directory and use the file command to


examine the files named awk, csh, and cut. (These are all
compiled executable program files.)

File Commands 7-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Lab—File Commands

6. Use the more command to view the contents of the following files.
Record whether the file is readable or not readable.

File types: a. readable b. unreadable

_____ ls ($ more ls)

_____ file

_____ pwd

_____ vi

_____ calendar

Note – Except for the file calendar, none of these files are readable.
That is because they are executable SPARC files. They are compiled
programs and can only be run (executed). Attempting to view the
contents of these files can “lock up” a dumb terminal’s display. Files of
this type are also called “binaries.”

7. Change directories to the /etc directory. Verify your current


working directory.

8. Use the ls command with the -l option to list the following file
names. Record the file types.

File types: a. dir (d) b. file (blank) c. link (l)

_____ halt ($ ls -l halt)

_____ vfstab

_____ auto_home

_____ rc0

_____ format.dat

7-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Lab—File Commands

9. Use the ls command with the -F option to list the following file
names. Record the file types.

File types: a. directory (/) c. file (blank)

b. executable (*) d. link (@)


_____ halt ($ ls -F halt)
_____ vfstab
_____ auto_home
_____ rc0
_____ format.dat

10. Use the file command to list the following file names. Record the
file types.

File types: a. directory c. text or script

b. executables d. link e. file


_____ halt ($ file halt)
_____ vfstab
_____ auto_home
_____ rc0
_____ format.dat

11. Use the more command to list the following file names. Record
whether the file was readable or not readable.

File types: a. readable b. unreadable


_____ halt ($ more halt)
_____ vfstab
_____ auto_home
_____ rc0
_____ format.dat

File Commands 7-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

Lab—File Commands

12. Were there any commands that didn't work the way you expected?
If so, why? ________________________________________

Note – All these files (except halt and rc0) were able to be read but
were of different types. The /etc/halt file is a link to
/usr/sbin/halt, an executable binary file. /etc/rc0 is a directory.

7-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
77 7

Lab—File Commands

Listing the Contents of Directories


1. Without moving from your present location, use the ls command
without any options to list the contents of the /usr/openwin
directory.

Record your command line: _______________________________

Record the system output: ________ ________

________ ________ ________ ________

________ ________ ________ ________

2. Use the ls command again to list the contents of the


/usr/openwin directory, but this time use the option that allows
you to distinguish directories from files using symbols.

Record your command line: _______________________________

Record the system output: ________ ________

________ ________ ________ ________

________ ________ ________ ________

3. How can you discern the directories from the files?

The directories have _____________________________________

The files have ___________________________________________

This concludes the File Commands lab.

File Commands 7-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
7

7-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Package Commands 8

Objectives

Upon completion of this module, you will be able to:

■ Display software package information using the pkginfo


command.
■ Add a software package from a CD-ROM to your system using the
pkgadd command.

Evaluation

Complete the lab at the end of this module.

References

Solaris 2.2 System Configuration and Installation Guide, Chapter 13,


“Adding and Removing Packages”

8-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Displaying Package Information Using pkginfo

# pkginfo | more
pkg_category pkg_name description
application SUNWabs Solaris 2.2 System Software AnswerBook
system SUNWaccr System Accounting, (Root)
system SUNWaccu System Accounting, (Usr)
system SUNWadmap System/Network Admin. Applications
system SUNWadmfw System & Network Administration Framework
system SUNWadmr System & Network Administration Root
system SUNWarc Archive Libraries
system SUNWast Automated Security Enhancement Tools
system SUNWaudio Audio applications
system SUNWaudmo Audio demo programs
system SUNWbcp Binary Compatibility
system SUNWbnur Networking UUCP Utilities, (Root)
system SUNWbnuu Networking UUCP Utilities, (Usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWcar Core Architecture, (Root)
graphics SUNWcg12 GS (cg12) Device Driver

description
A brief description of the
software product

pkg_name
Software package name; it begins
with SUNW if it is a Sun product

pkg_category
The package can be an application,
graphics, or system package

8-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
88 8

Notes

Use the pkginfo command to display software package information.

Command format:

pkginfo

✓ Using the pkginfo command without options or arguments outputs the category, name,
and description of packages installed on the system.

Package Commands 8-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Displaying Installed Packages Using pkginfo -1

To List All Installed Packages on the System

# pkginfo -l | more

To List a Specific Installed Package on the System

# pkginfo -l SUNWaudio
PKGINST: SUNWaudio
NAME: Audio applications
CATEGORY: system
ARCH: sparc
VERSION: 3.0,REV=1.0.7
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Audio binaries for SunOS 5.2
PSTAMP: patio930308165920
INSTDATE: Jul 12 1993 14:50
HOTLINE: Please contact your local service provider
STATUS: spooled
FILES: 9 spooled pathnames
2 directories
3 executables
4 package information files
758 blocks used (approx)
#

8-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
88 8

Notes

Use the pkginfo -l command to display installation software


package information.

Command format:

pkginfo (-l pkgname)

✓ pkginfo -l displays all installed packages; pkginfo -l “SUNWname” displays that


package only.

✓ This includes the date of installation [INSTDATE].

■ If you attempt to display an uninstalled package, the system


displays the following error:

# pkginfo -l SUNWman
ERROR: information for “SUNWman” was not found

Package Commands 8-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Displaying Available CD-ROM Packages Using pkginfo -1

To List All Packages on the CD-ROM

# pkginfo -d /cdrom/solaris_2_2/s0/Solaris_2.2 | more

To List a Specific Package on the CD-ROM

# pkginfo -d /cdrom/solaris_2_2/s0/Solaris_2.2 -l SUNWaudio


PKGINST: SUNWaudio
NAME: Audio applications
CATEGORY: system
ARCH: sparc
VERSION: 3.0,REV=1.0.7
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Audio binaries for SunOS 5.2
PSTAMP: patio930308165920
HOTLINE: Please contact your local service provider
STATUS: spooled
FILES: 9 spooled pathnames
2 directories
3 executables
4 package information files
758 blocks used (approx)
#

8-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
88 8

Notes

Use the pkginfo-d command to list all software packages that reside
on the installation CD-ROM.

To list a specific package on the CD-ROM, use the following command


format.

Command format:

pkginfo (-d device | pathname -l pkgname)

✓ The volume manager creates the /cdrom directory and mounts the CD-ROM automatically.

■ The last line of the output identifies the size of the package. Use
this information and the df -k command to determine if you
have enough disk space to install the package.
✓ The important point here is to see how much disk space the package needs before you
install it.

Package Commands 8-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Adding a Software Package Using pkgadd

Adding the Audio Package

# pkgadd -d /cdrom/solaris_2_2/s0/Solaris_2.2 SUNWaudio


Processing package instance <SUNWaudio> from
</cdrom/solaris_2_2/s0/Solaris_2.2>

Audio applications
(sparc) 3.0,REV=1.0.7
(C) 1993 Sun Microsystems, Inc. All Rights Reserved.
<< Many copyright messages here... >>
Using </> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing Audio applications as <SUNWaudio>

758 blocks
[verifying class <none>]
## Installation of part 1 of 1 is complete.

Installation of <SUNWaudio> was successful.


#

8-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
88 8

Notes

Command format:

pkgadd (-d device | pathname ) pkgname

✓ Use the pkgadd command to add a software package to your system.

✓ Mail is sent to root when the package is added successfully.

Package Commands 8-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Lab—Package Commands

Overview

This lab introduces you to the basic operation of the pkgadd program.
This program enables you to load Solaris software packages from the
CD-ROM.

Objectives

■ Use the pkgadd command to load man pages from CD-ROM.

Materials Requirements

■ Any SPARC desktop workstation with Solaris software


running, a pen or pencil, and this module, “Package
Commands.”
■ A Solaris SunOS 2.x operating system CD-ROM and a CD-ROM
unit.

8-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
88 8

Lab—Package Commands

Lab Exercise

Install the On-line man Pages


1. Insert the Solaris 2.2 software CD-ROM.

2. Log into the operating system as superuser.

3. List the available package commands in the /usr/sbin directory.

# ls /usr/sbin/pkg*

4. Does the pkgadd command exist? Yes No

5. List the contents of the /usr/man directory.

# ls /usr/man/*

6. Does /usr/man have any contents? Yes No

7. Verify that SUNWman has been installed.

# pkginfo -l SUNWman

8. Is SUNWman installed? Yes No

Note – The CD-ROM is automatically acquired through the utility


named Volume Manager.

9. Start the pkgadd utility:


# pkgadd -d /cdrom/solaris_2_2/s0/Solaris_2.2 SUNWman

Package Commands 8-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
8

Lab—Package Commands

Make Sure the Installation Was Successful


1. List the contents of the /usr/man directory.

# ls /usr/man/*

2. Are there any contents to /usr/man? Yes No

3. Verify that SUNWman has been installed.

# pkginfo -l SUNWman

4. Is SUNWman installed? Yes No

5. Look at the files:

# ls /usr/man/*

6. If SUNWman exists, use the man command on the following items.

$ man man

$ man intro

$ man filesystem

This concludes the Package Commands lab.

8-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
The OpenWindows Environment 9

Objectives

Upon completion of this module, you will be able to:

■ Start the OpenWindows application development platform.

■ Start, move, and quit a Command Tool window.

■ Enter commands into a Command Tool window.

■ Exit the OpenWindows program.

Evaluation

Complete the lab at the end of this module.

References

OpenWindows, Version 3 User’s Guide, Part Number 800-4930-10

9-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Starting the OpenWindows Environment

To start a non-customized version of the OpenWindows environment,


use the command: # /usr/openwin/bin/openwin

cmdtool (CONSOLE) - /sbin/sh


Console
(command
tool)

Workspace Tutorial
File
Manager

Volume
Manager
Wastebasket

9-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ The OpenWindows application introduces you to Sun’s


windowing environment.
■ The window-based environment lets you run SunOS operating
system commands in multiple windows.
✓ It enables you to use SunOS operating system commands and Shell Tools to perform a
wide variety of tasks in multiple windows simultaneously.

■ The command /usr/openwin/bin/openwin brings up the Sun


window environment.
✓ After a few seconds, your screen turns gray (or blue for color systems), the version notice
appears, and images appear one by one. On the gray or blue background you will see
several images:

■ An open console frame, a Wastebasket icon, a File Manager screen,


a Volume Manager screen, and an OpenWindows Help Viewer
appear.
✓ The Volume Manager screen allows you to access CD-ROM and diskettes without root
permissions.

■ When a tool is open, it is called a window pane.

■ When a tool is closed into an icon, it cannot receive input from the
keyboard.
✓ The Wastebasket icon shows papers sticking up if files within the wastebasket have not
been deleted. The File Manager screen (file folder) graphically displays your home
directory, subdirectories, and files within that directory. Each of the windows or icons
belongs to a tool or window application program. Some of the tools are open as windows,
such as console; and some are closed, like wastebasket. When a tool is open (click
SELECT twice to open an icon), it is ready to receive input from the keyboard and mouse.
When a tool is closed into an icon, it can receive input from the keyboard and mouse.

■ The background screen area on which objects such as windows,


icons, and menus are displayed is called the workspace.
✓ In the OpenWindows environment, use the mouse to control these objects and choose
your activities.

The OpenWindows Environment 9-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Using the Mouse

SELECT
Use the left mouse button to select a window
or something in it, or to work a window control.

ADJUST
Use the middle mouse button to deselect an object
or to select additional objects.

MENU
Use the right mouse button to open or choose
from a menu.

9-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

The mouse is an input device connected to the workstation that


determines the location of the pointer and thus determines the active
window. You use the mouse to control objects on the workspace and in
windows.

✓ When you want to type text in a window, move the pointer to the window and click the
SELECT mouse button to set the place where characters are displayed. This way of
directing where you work is called click-to-type.

■ Click—To press a mouse button once and release it without


moving the pointer.
■ Press—To push down and hold a mouse button.

■ Drag—To press and hold down the SELECT mouse button while
moving the pointer on the screen.

To open an icon, just click the SELECT button twice in rapid


succession.

The OpenWindows Environment 9-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Window Control

■ It is important to know all the elements of a window so you can


use the mouse effectively to control window functions

Window Window
menu button Application title border
Resize
corner

cmdtool - /sbin/sh
Command
prompt and
#
host name

Window
border

Window
pane

Scrollbar

9-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ The base window displays the application contents.


✓ Application contents display in the window pane area.

■ To resize a window pane, move the pointer to one of the four resize
corners, press the SELECT button, and drag to increase or reduce
the total area of the window.
✓ Resizing a window changes the window area, but it does not change the scale of the
window elements.

■ You can move a window on the workspace by pressing the


SELECT button on the header, footer, or a side border, and
dragging the window to the new location.
✓ The header is the area at the top of a base window that displays the application title.

■ The window menu button closes the window or displays a menu.


✓ If you move the pointer to the window menu button and click SELECT, the window closes
to an icon. If instead of clicking SELECT you depress the MENU mouse button, a menu
displays.

■ The window pane is the area of the base window where the
application information is displayed and manipulated.

■ Scrollbars enable you to view information that is too large for the
window pane.
✓ When all application information cannot display at one time, panes have scrollbars to
allow moving the window contents forward and backward.

The OpenWindows Environment 9-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

File Manager

■ Quit File Manager or any window by choosing Quit from the


Window menu.

Window
Close ◆W
Full Size
Move
Resize
Properties
Back
Refresh
Quit ◆Q

9-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

File Manager is a program that provides a graphical interface for


manipulating files as an alternative to typing commands.

✓ It uses icons to represent directories, programs, and data files so that you can browse
through the file system with just the push of a button. You can move or copy files by
dragging their icons and can start applications merely by double-clicking on the icon.

■ It displays directories as file folder icons, files or documents as


pieces of paper, and programs as small windows.
■ File Manager window is divided into three areas or panes.

■ The top pane has six menu buttons that represent and
trigger various functions.
■ The middle pane displays the current directory and its path.

■ The bottom pane displays all the current directory files.

■ The File Manager window always displays as a window when you


start up a default OpenWindows environment.

■ To quit File Manager, or any window, move the pointer to the


header and press the MENU button. Click on Quit using the
SELECT or MENU button.
✓ File Manager has the potential to allow someone to do a great deal of damage to a
directory structure or file system depending on who the user happens to be.

✓ If the user is root, all file systems are available to perform any of the functions allowed by
the File Manager. Of course root always has the potential of doing harm; however, the File
Manager makes it much easier to manage.

Caution – Do not drag anything into the wastebasket! If you remove


! system files, you may have to reload the software.

The OpenWindows Environment 9-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Console Window

Console Window Output

cmdtool (CONSOLE) - /sbin/sh


maker: Using /usr/dist/pkgs/framemaker,v3.1.1/.fminit2.0.ps
maker: Starting FrameMaker 3.1.1. Copyright (c) 1986-1992
maker: Finished loading
rpc.cmsd: file error on /usr/spool/calendar/callog.bass
fd0: drive not ready
***ERROR***
process(0x2b6210, ‘GlobalEventMgr’, runnable,
instance(class(ClassEventMgr)))
Error: /undefined

Starting a Console Window

Workspace
Programs
Utilities Refresh
Properties . . .Reset Input
Help . . . Function Keys
Desktop IntroWindow
... Controls
Exit . . . Save Workspace
Lock Screen
Console . . .

9-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ The Console window receives all system notification messages,


such as warnings and program errors.
✓ The Console window is for system use. Without a Console window, these messages
appear directly on the display monitor. Always keep only one Console window open on
your monitor.

■ Always have an open Console window on your workspace.


✓ System messages cannot be seen if the Console window is closed into an icon.

■ To replace the Console window, use the Workspace menu.


✓ If the Console window should be inadvertently removed from the workspace, it can be
replaced by bringing up the Workspace menu and sliding to the Utilities menu, then
choosing the Console item.

The OpenWindows Environment 9-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Workspace Menu

You can access the Workspace menu button anywhere on your workspace.

cmdtool (CONSOLE) - /sbin/sh

Workspace Programs

Programs File Manager . . .


Utilities Text Editor . . .
Properties . . . Mail Tool . . .
Workspace
Help . . . Calendar Manager . . .
menu
Desktop Intro . . . Command Tool . . .

Exit . . . Shell Tool . . .


Clock . . .
Calculator . . .
Performance Meter . . .
Print Tool . . .
Audio Tool . . .
Tape Tool . . .
Submenu
Image Tool . . .
Snapshot . . .
Icon Editor . . .
Binder . . .
AnswerBook . . .

9-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ You access applications from the Programs submenu of the


Workspace menu.
✓ The workspace has a default pop-up menu called the Workspace menu. You can access it
by pressing the MENU mouse button anywhere on the workspace. Use the Workspace
menu to start up new applications, run utilities, set global properties, such as window
color and input area options, and exit the OpenWindows environment.

■ Pushpins are used on some menus and on all Command, Property,


and Help pop-up windows.
✓ When a menu or window has a pushpin, you can pin the menu, or window, to the screen
to keep it available for repeated use.

■ To “pin” an unpinned pushpin, the pin pops into the hole, and the
menu or window stays on the screen until you unpin it by clicking
on the pinned pushpin.
✓ When you do this, the pushpin pops out of the hole and the menu or window is dismissed
from the screen.

■ To gain access to tools from the Workspace menu: Press the MENU
mouse button.

■ Select Programs and drag the mouse to the right.


✓ A submenu appears displaying all of the tools that are available to you.

■ Select a new tool and release the MENU mouse button.

The OpenWindows Environment 9-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Command Tool

Workspace Programs

Programs File Manager . . .


Utilities Text Editor . . .
Properties . . . Mail Tool . . .

Help . . . Calendar Manager . . .


Desktop Intro . .Command
. Tool . . .
Exit . . . Shell Tool . . .
Clock . . .
Calculator . . .
Performance Meter . . .
Print Tool . . .
Audio Tool . . .
Tape Tool . . .
Image Tool . . .
cmdtool - /sbin/sh
Snapshot . . .
# ls /home Icon Editor . . .
lost+found Binder . . .
AnswerBook . . .
#

Click SELECT
on the arrows
to scroll up or
down

9-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ To start up a Command Tool, click the MENU button on the


workspace, click it again on Programs, and once more on the
Command Tool.
✓ The Command Tool window appears on the screen. You can reposition or resize the
Command Tool window and, if desired, saved as an icon for later use.

■ A Command Tool emulates an ASCII terminal.


✓ When you type into a Command Tool window, you must first position the mouse pointer in
the window and click the SELECT button.

■ A Command Tool enables you to edit binary input.


✓ If you make a mistake, backspace over the error and retype. The cursor can be placed
anywhere within a line by positioning the pointer and clicking the SELECT button; typing
can resume in that position.

■ To scroll up or down, position the pointer on the up-arrow of the


scrollbar and click the SELECT button.
✓ The scrollbar enables you to see information that has scrolled off the screen.

The OpenWindows Environment 9-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Repositioning a Command Tool

cmdtool - /sbin/sh

# ls /home
lost+found

9-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

To reposition a Command Tool:

1. Position the mouse pointer on the window border.

2. Press the SELECT button, drag the window to its new position,
and release.

The OpenWindows Environment 9-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Exiting the OpenWindows Environment

Open Your Workspace Menu and Select Exit

Workspace
Programs
Utilities
Properties . . .
Help . . .
Desktop Intro . . .

Exit . . .

Please confirm exit from window system

Exit Cancel

9-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Notes

■ To exit from the OpenWindows environment, choose Exit from


the Workspace menu.
✓ When you choose Exit from the Workspace menu, a second menu displays to confirm
your selection. If you choose Cancel, the program cancels the action and the
OpenWindows environment remains. If you choose Exit, the OpenWindows environment
closes and you are placed in a standard terminal screen.

The OpenWindows Environment 9-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Lab—OpenWindows

Overview

The purpose of this lab is to learn how to:

■ Start the OpenWindows environment

■ Open a Command Tool in which to execute commands

■ Quit the Command Tool

■ Exit OpenWindows

Tools and Equipment

To complete this lab, you will need, a Sun SPARCstation running


Solaris software, a pen or pencil, and this module, “The
OpenWindows Environment.”

Lab Exercise

1. Locate and execute OpenWindows platform by typing the


following command:

# /usr/openwin/bin/openwin

Note – If you see an error message, check your spelling, then consult
your instructor.

2. Open a Command Tool window by performing the following


steps:

a. Position the mouse pointer anywhere on the workspace and


click the MENU button.

b. In the Workspace menu, click MENU on Programs.

c. In the Programs submenu, click MENU on Command Tool.

9-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
99 9

Lab—OpenWindows Environment

3. Open another Command Tool using the MENU button.

4. To position the Command Tool windows, perform the following


steps:

a. Place the mouse pointer on the header of the second Command


Tool.

b. Press SELECT and drag the window so that both windows are
visible.

5. To type in one of the Command Tool windows, you must first


select the window by performing the following steps:

a. Position the mouse pointer into the Command Tool pane.

b. Click SELECT to select the window.

c. Now, enter the following command at the system prompt in


the window:

# ls /kernel

6. Using the procedure shown in Step 5, select a window and type


the following command into the second Command Tool window:
# ls /usr/kernel

Note – /kernel and /usr/kernel have the same directory name, yet
have different directory contents. Any SunOS operating system
command can be executed in any window using the method in Step 5.

7. Quit both Command Tool windows using the following steps:

a. Position the pointer on the header of the Command Tool.

b. Click the MENU mouse button to select the window.

c. Click the MENU button on Quit.

The OpenWindows Environment 9-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
9

Lab—OpenWindows Environment

8. Exit the OpenWindows environment by performing the following


steps:

a. Click MENU on the Workspace menu.

b. Click MENU on Exit . . ..

Note – A confirmation window pops up giving you the option to Exit


or Cancel.

c. Click SELECT on Exit.

Optional Exercise

9. Start the OpenWindows platform again, and work through the


Help Viewer (“Introducing Your Sun Desktop”). This tutorial
introduces you to the skills needed in the OpenWindows
environment. This tool should already be visible on the right side
of your screen.

Note – If the Help Viewer tutorial (Desktop Intro) is not visible on


your screen and you want to open a Help Viewer, perform the
following steps:

a. Position the arrow on the Workspace menu and click MENU.

a. Click MENU on Desktop Intro... with the MENU button.

b. After reading the first page of the Desktop Intro, continue to


subsequent pages by clicking SELECT on Next Page.

This concludes the OpenWindows Environment lab.

9-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Disk Drive Partitioning 10

Objectives

Upon completion of this module, you will be able to:

■ Interpret logical disk device names.

■ Interpret partition listings.

■ Start the format utility.

■ Partition a disk.

■ Label a disk.

■ Verify a disk label with the format utility verify command.

■ Read a disk drive label using the prtvtoc command.

Evaluation

Complete the lab at the end of this module.

10-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Logical Disk Device Names

/dev/[r]dsk/c n t n d n sn

The /dev directory


The rdsk or dsk subdirectory
Controller number
Target number
Disk number
Slice number

Example:

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - no rw,suid
/dev/dsk/c0t3d0s6 - /usr - - no rw,suid
swap - /tmp tmpfs - no rw
/dev/dsk/c0t1d0s5 - /opt ufs - no suid,rw

10-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

Disk partioning is a way to manage your file system by dividing the


disk drive into sections. However, before you can manipulate the
partitions on the disk you must understand the device names that
refer to disk drives.

■ The SunOS 5.x operating system uses the conventions shown on


the facing page to name the logical disk devices.
■ The logical device names are located in the /dev directory.

■ There are two kinds of logical names:

■ Raw devices, found in the rdsk subdirectory

■ Block devices, found in the dsk subdirectory

■ Each disk has entries in both the rdsk and dsk subdirectories
because sometimes the operating system needs to communicate
with a device in “raw” mode, and other times in “block” mode.
You will see examples of both later in this course.

■ The logical name is broken down into four parts:

■ cn —Controller number represents the logical address of the


controller that the disk is connected to, such as c0, c1, c2, and
so on.

■ tn —Target number represents the SCSI target address of the


disk. If the disk is not a SCSI disk, tn is omitted.

■ dn —Disk number represents the address of the disk. This


number is equivalent to the Logical Unit Number (LUN) for
SCSI disks. For the current embedded SCSI disk drives used
today, this number is set to d0.

■ sn —Slice number represents the slice (partition) of the disk.


Values range from 0 to 7.

■ The following example shows how the command, mount -p,


prints a list of mounted file systems. The file systems are displayed
using their logical disk names. (This command is covered in a later
module.)

Disk Drive Partitioning 10-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Disk Partitioning

■ Divides a disk drive into different sections called slices and


allows for proper file system management.
■ This process is also referred to as partitioning.

0 6
1

10-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

■ The disk drives used with Sun Workstations are divided into as
many as seven sections, called slices or partitions, labeled 0
through 7.

Note – 0 through 7 equals eight partitions; however, Slice 2 is reserved


to represent the size of the entire disk, therefore, there are only seven
slices maximum. If there are two or more slices, Slice 2 is only a gauge
of the total disk capacity and not considered a slice. However, if Slice 2
is the only slice, then it represents the whole disk as one single slice.

■ Sun conventions associate certain SunOS operating system file


systems with certain slices as noted:

root— Slice 0

swap—Slice 1

usr—Slice 6

home—Slice 7

■ Each slice is treated by the operating system as a completely


separate disk device.

■ A slice can also be called a partition.

■ Slices are defined by the disk VTOC.

Disk Drive Partitioning 10-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

How Partitions Are Described

Slice 2 (whole disk)


cylinders: 0–849
(850 cylinders)

Slice 0
cylinders: 0–49
number cylinders = 50
0 1 6
Slice 1
cylinders: 50–249
number cylinders = 200

Slice 6
cylinders: 250–849
number of cylinders = 600

10-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

■ A partiton (slice) is described by the number of cylinders that it


has.
■ A properly partitioned disk has all of its cylinders partitioned, and
does not have overlapping partitions.

■ The sum of all the slice‘s cylinders must equal Slice 2.

Disk Drive Partitioning 10-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

VTOC—What Is It?

The Volume Table of Contents (VTOC) is an expanded disk label that


contains information describing the layout of the disk. The VTOC is
located in the first disk sector, Slice 0, and is created by the format
utility.

Slice 0

Slice 1

Slice 2

VTOC
(sector 0)

Contents of the VTOC Include:

■ Disk geometry

■ Partition tables

■ Optional volume name

■ Optional partition tags

■ Optional partition flags

10-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

The VTOC describes the layout of the disk and contains the following
information:

■ Disk geometry—Describes the number of heads, sectors, and


cylinders.
■ Partition tables—Describe the slices on the disk.

■ Volume name—Identifies the disk device (optionally assigned by a


system administrator).

■ Slice tags—Name the standard mount points for each of the slices.

■ Slice flags—Label whether each slice is writable and mountable.

Disk Drive Partitioning 10-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Displaying a Disk’s VTOC

# prtvtoc /dev/rdsk/c0t0d0s0

* /dev/rdsk/c0t0d0s0 partition map


*
* Dimensions:
* 512 bytes/sector
* 80 sectors/track
* 9 tracks/cylinder
* 720 sectors/cylinder
* 2500 cylinders
* 1151 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 41040 41039 /
1 3 01 41040 205200 246239
2 5 00 0 828720 828719
5 6 00 246240 20880 267119 /opt
6 4 00 267120 561600 828719 /usr
#

10-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

■ The prtvtoc (print VTOC) command displays a disk’s volume


table of contents.
✓ The dimensions portion of the display shows the disk geometry and the partition tags and
flags. The lower portion of the display shows the disk’s partition table. However, this table
looks a bit different than the partition table that is displayed in the format utility.

Disk Drive Partitioning 10-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Partitioning Disks With the format Utility

■ Disk slices are manipulated by the partition routine in the


format utility:

# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:


0. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec
/sbus@1,f8000000/esp@0,800000/sd@3,0
1. c0t1d0 <SUN0669 cyl 1614 alt 2 hd 15 sec
/sbus@1,f8000000/esp@0,800000/sd@1,0
Specify disk (enter its number): 0

■ The Main menu lists the possible options.

selecting c0t3d0
[disk formatted]
Warning: Current Disk has mounted partitions.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition-select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format> partition

10-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

The format utility is a disk-maintenance tool used to partition disks as


well as perform other disk-maintenance tasks. You can use the format
utility to:

■ Manipulate slices (the partition routine).

■ Reformat disks (the format option).

■ Repair and analyze disk sectors.

■ Verify and re-label a disk.

■ Assign an optional disk volume name.

Note – You must be root (superuser) to use the format utility.

■ When the format utility is invoked, it probes the SCSI bus to find
the disks.

■ The logical disk device names are displayed with the physical disk
device names.

■ The desired routine is entered at the format> prompt. In the


example on the facing page, the partition submenu is entered.

Disk Drive Partitioning 10-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

The Partition Menu

The Partition Menu

PARTITION MENU:

0 - change ‘0’ partition


1 - change ‘1’ partition
2 - change ‘2’ partition
3 - change ‘3’ partition
4 - change ‘4’ partition
5 - change ‘5’ partition
6 - change ‘6’ partition
7 - change ‘7’ partition
select - select a predefined table
modify - Modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to disk

partition> p

10-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

The Partition menu provides commands that enable you to view and
manipulate disk partitions.

■ Commands 0 through 7 allow you to alter slices on a disk.

■ Select enables you to assign predefined partition tables to your


disk.

■ Modify enables you to use and modify a predefined partition table.

■ Name enables you to assign a temporary name to a partition table


while working in the partition routine.

■ Print displays the current partition table information.

■ Label writes the partition table to the disk (writes to the VTOC).

Note – You can enter a ? at any time to re-display format utility


menus.

Disk Drive Partitioning 10-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

The partition> modify Submenu

This submenu allows you to modify an entire partition table very


quickly using any of three methods to describe the size the each
partition.

partition> modify
Select partitioning base:
0. Current partition table (original sd3)
1. All Free Hog
Choose base (enter number) [0]? 0

Part Tag Flag Cylinders Size Blocks


0 unassigned wm 0 - 96 34.10MB (97/0/0)
1 unassigned wm 97 - 429 117.07MB (333/0/0)
2 unassigned wm 0 - 1150 404.65MB (1151/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 0 0 (0/0/0)
6 unassigned wm 430 - 1150 253.48MB (721/0/0)
7 unassigned wm 0 0 (0/0/0)

Do you wish to continue creating a new partition


table based on above table[yes]? y
Free Hog partition[6]?
Enter size of partition ‘0’ [69840b, 97c, 34.10mb]: [0b, 0c, 0mb]
Please specify units in either b (blocks), c (cylinders) or m (megabytes)
Enter size of partition ‘0’ [69840b, 97c, 34.10mb]: 0b
Enter size of partition ‘1’ [239760b, 333c, 117.07mb]: 45mb
Enter size of partition ‘3’ [0b, 0c, 0.00mb]: 200c
Enter size of partition ‘4’ [0b, 0c, 0.00mb]:
Enter size of partition ‘5’ [0b, 0c, 0.00mb]:
Enter size of partition ‘7’ [0b, 0c, 0.00mb]:

Note–Any disk space that is not configured is automatically allocated


to the Free Hog partition.

10-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

The rest of the partition> modify session:

Do you wish to continue creating a new partition


table based on above table[yes]? y
Free Hog partition[6]?
Enter size of partition ‘0’ [69840b, 97c, 34.10mb]: [0b, 0c, 0mb]
Please specify units in either b (blocks), c (cylinders) or m (megabytes)
Enter size of partition ‘0’ [69840b, 97c, 34.10mb]: 0b
Enter size of partition ‘1’ [239760b, 333c, 117.07mb]: 45mb
Enter size of partition ‘3’ [0b, 0c, 0.00mb]: 200c
Enter size of partition ‘4’ [0b, 0c, 0.00mb]:
Enter size of partition ‘5’ [0b, 0c, 0.00mb]:
Enter size of partition ‘7’ [0b, 0c, 0.00mb]:

Part Tag Flag Cylinders Size Blocks


0 unassigned wm 0 0 (0/0/0)
1 unassigned wm 0 - 127 45.00MB (128/0/0)
2 unassigned wm 0 - 1150 404.65MB (1151/0/0)
3 unassigned wm 128 - 327 70.31MB (200/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 0 0 (0/0/0)
6 unassigned wm 328 - 1150 289.34MB (823/0/0)
7 unassigned wm 0 0 (0/0/0)

Okay to make this the current partition table[yes]? y


Enter table name (remember quotes): “Donny”

partition> (you can use label at this point to commit the changes)

Disk Drive Partitioning 10-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Understanding a Partition Table

Partition Table
Current partition table (original):
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 41 14.77MB (42/0/0)
1 swap wu 42 - 172 46.05MB (131/0/0)
2 backup wm 0 - 1150 404.65MB (1151/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 173 - 202 10.55MB (30/0/0)
6 usr wm 203 - 550 122.34MB (348/0/0)
7 home wm 551 - 1150 210.94MB (600/0/0)

partition>

10-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

■ The Print command displays the current partition table with


the following information:

■ Part—Identifies partition (slice) numbers 0–7

■ Tag—Identifies what the partitions are used for (valid tags:


root, swap, backup, usr, home, var, boot, and
unassigned)

■ Flag—Identifies access permissions


w=read/writer=read onlym=mountableu=unmountable

■ Cylinders—Identifies starting and ending cylinder numbers

■ Size—Identifies partition size in Mbytes

■ Blocks—Identifies the partition’s total number of cylinders

■ Tags and flags are optional items assigned to partitions to indicate


the intent of the given partition.

■ The blocks column describes the total number of cylinders for each
partition in this fashion:

Blocks
42/0/0

Cylinders Sectors
Heads

■ Partition 2 represents the entire disk.

■ Partitions with “0” values for cylinders and size categories are not
used by system software and effectively do not exist.

Disk Drive Partitioning 10-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

How to Repartition a Disk

partition> 0
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 41 14.77MB (42/0/0)

Enter partition id tag [root]: <cr>


Enter partition permission flags[wm]: <cr>
Enter new starting cylinder[0]: <cr>
Enter partition size[30132b, 42c, 14.77mb]: 16mb

Disk blocks

Cylinders

Mbytes

10-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

You can change the size of your disk partitions. To repartition a disk,
follow the steps below.

Enlarge partition “0” from 14.77 Mbytes to 16 Mbytes.

1. Enter “0” to modify the values for partition “0.”

2. Apply the tag name. A Return accepts the default value shown in
brackets. A “?” lists the valid tag names. This field is optional.

3. Enter the Partition permission values (see previous page for


descriptions).

4. Enter the new starting cylinder; next cylinder available from the
previous partition.

5. Enter the new size of the partition. This can be described using
total number of blocks, cylinders, or Mbytes.

Now that the size of partition “0” has changed, the adjacent partitions
must be properly adjusted.

■ To remove a partition from a disk, enter zero values for the


starting cylinder and for size.
■ When the partition table is modified, any data that was on the
drive is no longer accessible.

Disk Drive Partitioning 10-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Changing Partition Sizes

In this class exercise, use the following partition table entries to


increase the size of Slice 6 by 50 Mbytes.

Current partition table (original):


Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 41 14.77MB (42/0/0)
1 swap wu 42 - 172 46.05MB (131/0/0)
2 backup wm 0 - 1150 404.65MB (1151/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 173 - 202 10.55MB (30/0/0)
6 usr wm 203 - 550 122.34MB (348/0/0)
7 home wm 551 - 1150 210.94MB (600/0/0)

partition>

10-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

To increase Slice 6 by 50 Mbytes, answer these partition questions


using the values in the partition table:

partition>

Part Tag Flag Cylinders Size Blocks


6 usr wm 203-550 122.34MB (348/0/0)

Enter partition id tag [usr]:


Enter partition permission flags[wm]:
Enter new starting cylinder[203]:
Enter partition size[250560b, 348c, 122.34mb]:

Now, answer the questions again to adjust Slice 7:

partition>

Part Tag Flag Cylinders Size Blocks


7 home wm 551 - 1151 210.94MB (600/0/0)

Enter partition id tag [home]:


Enter partition permission flags[wm]:
Enter new starting cylinder[551]:
Enter partition size[4320000b, 600c, 210.94mb]:

Disk Drive Partitioning 10-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Checking Your Work and Saving the New Table

Your new partition table should look like this:

partition> print

Current partition table (original sd0):


Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 41 14.77MB (42/0/0)
1 swap wu 42 - 172 46.05MB (131/0/0)
2 backup wm 0 - 1150 404.65MB (1151/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 173 - 202 10.55MB (30/0/0)
6 usr wm 203 - 693 172.62MB (491/0/0)
7 home wm 694 - 1150 160.66MB (457/0/0)

Add up to equal
Slice 2

Write the new partition table to disk’s VTOC, as follows:

partition> label
Ready to label disk,
continue? y

partition> q

10-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

It is important to check your new partition values carefully since the


partition routine does not. To check the partition values:

■ First, add up the values in the blocks column. The total should
equal Slice 2.

42 + 131 + 30 + 491 + 457 = 1151 Slice 2

■ Second, ensure that the first cylinder of each partition begins


immediately following the previous partition. Once the values are
correct, be sure to label the disk.

■ Finally, type “q” at the partition> prompt to return to the Main


menu.

Disk Drive Partitioning 10-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Reading the Label From the Drive

The Main menu provides the verify command to read the disk’s
VTOC.

selecting c0t3d0
[disk formatted]
Warning: Current Disk has mounted partitions.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition-select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format>

10-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Notes

The following display is an example of using the verify command:

format> verify

Primary label contents:

ascii name= <SUN424 cyl 1151 alt 2 hd 9 sec 80>


pcyl=2500
ncyl=1151
acyl= 2
nhead= 9
nsect= 80
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 41 14.77MB (42/0/0)
1 swap wu 42 - 172 46.05MB (131/0/0)
2 backup wm 0 - 1150 404.65MB
(1151/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 173 - 202 10.55MB (30/0/0)
6 usr wm 203 - 693 172.62MB (491/0/0)
7 home wm 694 - 1150 160.66MB (457/0/0)
format: quit

Typing Quit exits the format utility.

Disk Drive Partitioning 10-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Lab—Disk Partitioning and Labeling

Overview

The purpose of this lab is to:

■ Partition and label disk drives with the format utility.

■ Divide a practice disk drive into three partitions.

■ Read the new partition table from the disk drive.

Tools and Equipment

To complete this lab, you will need:

■ One Sun workstation, a pen or pencil, and this module, “Disk


Drive Partitioning.”
■ A system disk and a spare disk.

Caution – It is most important during this lab that you do not


repartition the system disk. Ensure your system has a spare disk drive
! that can be used for practice.

10-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Lab—Disk Partitioning and Labeling

Pre-Lab Preparations

1. Boot the operating system: ok boot -r.

2. Log in as root (you cannot run the format command unless you
are root).

Lab Exercise

Finding Your Practice Disk


1. Use the mount command as shown below to display all disks with
mounted file systems.

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - no rw,suid
/dev/dsk/c0t3d0s6 - /usr - - no rw,suid
swap - /tmp tmpfs - no rw
/dev/dsk/c0t1d0s5 - /opt ufs - no suid,rw

The “t” numbers

The example indicates that two disk drives are in use; t3 and t1.

2. Record the “t” numbers from your mount command:

_____
_____
_____
_____
_____

Note – These numbers represent disk drives that are in use. Avoid
using these disks in the following lab exercises.

Disk Drive Partitioning 10-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Lab—Starting Up the format Utility Program

1. Start the format utility by entering the format command.

Note – Be sure that you select a spare disk on which to practice.

Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN0207 cyl 1254 alt 2 hd 9 sec 36>
/sbus@1,f8000000/esp@0,800000/sd@3,0
1. c0t1d0 <SUN0669 cyl 1614 alt 2 hd 15 sec 54>
/sbus@1,f8000000/esp@0,800000/sd@1,0
2. c0t2d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
/sbus@1,f8000000/esp@0,800000/sd@2,0
Specify disk (enter its number): 2

selecting c0t2d0 Select a disk drive


[disk formatted] that is NOT in use.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format> partition

10-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Lab—Selecting the Partition Menu

When you select the partition menu, you are given a choice of many
commands. You will use only a few for this lab. Others will be
addressed later in this course.

1. Enter a p to print the current partition table, as shown below.

PARTITION MENU:

0 - change ‘0’ partition


1 - change ‘1’ partition
2 - change ‘2’ partition
3 - change ‘3’ partition
4 - change ‘4’ partition
5 - change ‘5’ partition
6 - change ‘6’ partition
7 - change ‘7’ partition
select - select a predefined table
modify - Modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to disk
quit
partition> p

Disk Drive Partitioning 10-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Lab—Partitioning Your Disk

Your practice disk‘s partition table should now be showing on your


screen.

1. Record the following information from Slice 2 of your disk:

Total cylinders _____________________

Total Mbytes _______________________

These values represent the whole disk. Never change these values.

2. Create a partition table using the following values and the


instructions below.

■ Slice 4 equals 40 Mbytes

■ Slice 5 equals 50 Mbytes

■ Slice 6 equals the rest of the disk

■ All other slices (except for Slice 2) have zero values for
Cylinders and Size.

Instructions:
1. Enter a ? to see the list of commands available to you.

2. Enter 0 to change the values for Slice 0 as follows:


partition> 0

PartTag Flag Cylinders Size Blocks


0 root wm 0 - 41 14.77MB (42/0/0)

Enter partition id tag [root]: <cr>


Enter partition permission flags[wm]: <cr>
Enter new starting cylinder[0]: <cr>
Enter partition size[30132b, 42c, 14.77mb]: 0

3. Repeat Step 2 for Slices 1, 3, and 7.

10-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Lab—Partitioning Your Disk

4. Enter p to print your table. You should have zero values for Size
for Slices 0, 1, 3, and 7.

5. Enter 4 to change the values for Slice 4 as follows:

partition> 4

Part Tag Flag Cylinders Size Blocks


4 unassigned wm 0 0 (0/0/0)

Enter partition id tag [unassigned]: <cr>


Enter partition permission flags[wm]: <cr>
Enter new starting cylinder[0]: 0
Enter partition size[0b, 0c, 0.00mb]: 40mb

6. Enter p to print your table.

7. What are the cylinder values for Slice 4?_____________

8. Enter 5 to change the values for Slice 5 as follows:


partition> 5

Part Tag Flag Cylinders Size Blocks


5 unassigned wm 0 0 (0/0/0)

Enter partition id tag [unassigned]: <cr>


Enter partition permission flags[wm]: <cr>
Enter new starting cylinder[0]:
Enter partition size[0b, 0c, 0.00mb]: 50mb

The new starting cylinder should be the next cylinder available


(1+ the last cylinder of the previous slice).

Disk Drive Partitioning 10-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Lab—Partitioning Your Disk

9. Enter p to print.

10. Make the following calculations:

■ Record the last cylinder of Slice 5: __________.

■ Add up the blocks column values for Slices 4 and 5.

■ Record the sum: _________.

■ Subtract the sum from the of Slice 2’s blocks and record:
__________.

■ This is the amount of disk left over that is applied to the


last slice.

11. Enter the values for the last slice as follows:


partition> 6

Part Tag Flag Cylinders Size Blocks


6 unassigned wm 0 0 (0/0/0)

Enter partition id tag [unassigned]: <cr>


Enter partition permission flags[wm]: <cr>
Enter new starting cylinder[0]:
Enter partition size[0b, 0c, 0.00mb]:

Calculate as before
Enter the value that represents the rest of the disk.
(Note that this value should be followed by a “c,”
(such as, 894c).

10-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1010 10

Lab—Partitioning Your Disk

12. Enter a p to print your completed partition table.

13. Check your work:

■ Add the size values for Slices 4, 5, and 6. The total should
equal the size value for Slice 2.

■ Visually verify that the starting cylinder of each slice begins


right after the ending cylinder of the previous slice.

14. Now that your new table is complete, write it to the VTOC with
the label command as shown:

partition> label
Ready to label disk, continue? y

Format Your Drive


1. Enter q to quit the partition routine and return to the Main menu.

2. Enter format.

3. Type y to answer yes to continue.

Display Your New VTOC With the format Utility


1. Wait until the drive has finished formatting and verifying.

2. Enter verify to display the VTOC.

3. Enter q to quit the Main menu.

Disk Drive Partitioning 10-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
10

Lab—Display the New VTOC With the prtvtoc Command

1. The Solaris software prompt should now be displayed.

2. Enter the command prtvtoc with the designation of your practice


disk, as shown below.

# prtvtoc /dev/rdsk/c0t0d0s4

Note – The prtvtoc command will not work if you specify a slice that
has a zero size.

This concludes the Disk Drive Partitioning lab.

10-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
File System Initialization 11

Objectives
Upon completion of this module, you will be able to:

■ Describe the relationship of partitions to file systems.

■ Describe swap and its use.

■ Define a mount point.

■ Describe relationships of file systems to mount points.

■ List the three most common file systems.

■ Initialize partitions using newfs.

■ Define the use of the boot block, superblock, and inode.

■ Describe data blocks, disk blocks, and fragments.

■ Execute fsck program, mount and prtvtoc commands correctly.

Evaluation

Complete the lab at the end of this module.

References

Nemeth, Snyder, and Seebass, UNIX System Administration Handbook,


Englewood Cliffs, N.J.; Prentice Hall Inc., 1989

11-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Disk Partitioning

Raw Disk

0
1 6

Boot block

/ (root)
Slice 0
swap
Slice 1

/usr Disk label

Slice 6

11-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

Partitioning a disk using the format utility, as discussed in the


previous module, does not create a file system. After the partitioning
process is complete, what remains is referred to as a raw disk. It is a
disk divided into areas. This module describes how to use these areas
and add file structures to build a file system.

■ On a just partitioned disk, all the partitions are considered raw.

■ Some partitions do their job as raw partitions. Two examples are


swap partitions and special database partitions.
✓ The swap area is used when the operating system has less physical memory (RAM) than
it needs to process its program.

✓ swap is the area where memory images that are not currently being used are stored. A
process is taken out of active memory (primary memory) and placed on the swap device
in order to make room for another process to run.

✓ A standard Sun system reserves Slice 1 on the first disk for swap.

■ Most partitions that contain data require additional file system


structures to be in place before any data can be installed.

■ In the example on the facing page, Slices 0 and 6 require additional


work before data can be installed on them. Slice 1 is swap, so it
does not.

File System Initialization 11-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

What Is a File System?

Hierarchical Directory Structure

Located in Slice “0”


/

kernel ufsboot usr etc bin home var

sparc
ucb man etc kvm lib

Located in Slice 6
username smfun

Located in Slice 7

■ There is only one file system per partition.

■ swap is not a file system; it is left as a raw partition.

■ When the system boots, the root file system is automatically


mounted by the kernel.

Note – Additional file systems are mounted in order to gain access to


other directories and files that may be needed to support the user’s
needs.

11-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ A file system contains a hierarchical directory structure and


files.
■ Each file system resides on a separate disk partition.

■ By being on separate partitions, each file system is like a small


disk unto itself and is protected from damage by the other file
systems.
✓ The operating system is comprises three basic file systems. Each file system contains
one directory, and its subdirectories and files. Each file system is known by a specific
name that is a standard, default name and cannot be changed.

■ There is only one file system per partition.


✓ swap is not a file system, it is left as a raw partition.

■ When the system boots, the root file system is automatically


mounted by the kernel.
✓ Additional file systems are mounted in order to gain access to other directories and files
that may be needed to support the user’s needs.

✓ File systems do not have to start at the root. File systems can be attached anywhere in
the operating system hierarchy.

■ File systems are not apparent by just the file name.


✓ Since all file systems in a disk are attached through directory names, it is impossible to
tell if file systems are attached by just the file name.

File System Initialization 11-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

What Makes a Partition Into a File System

CPU memory

Superblock

Superblock

Updated
every 30 seconds Loaded into memory
at boot time.

Boot block
(15 sectors)

Disk label
slice 6 (1 sector)

slice 1
Superblocks
(16 sectors) slice 0

11-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ Partitions that contain data are called file systems.

■ Each partition that becomes a file system has an individual


superblock.
✓ The superblock is built when the file system is created and it never changes location.

✓ The initial superblock is always at sector 16 of each file system.

■ The superblock contains the basic parameters for the file system
and is built when the file system is created.
✓ A copy of the superblock is loaded into memory when the file system is attached to the
operating system.

✓ This allows constant updating of file system information without a lot of disk accesses.

■ Every 30 seconds, the superblocks in memory are written to the


file system.
✓ This process is called “sync” as the superblock in memory is “synced” with the one on
the file system.

✓ The superblock informs the fsck utility whether it needs to run on that file system.

■ The swap partition does not contain data or superblocks.

■ Syncing the superblock must be performed before you power


down the system.
✓ This can be done several different ways:

- Manually type the sync command


- Halt the system using the halt command

- Reboot the system using the reboot command

✓ The halt command syncs the superblocks, brings the system to the PROM level, and
waits for user input.

✓ The reboot command syncs the superblocks, brings the system to the PROM level, and
immediately reboots the system.

Caution – Failure to sync the superblock before powering down can


! corrupt data on any or all file systems.

File System Initialization 11-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Creating a New File System

# newfs /dev/rdsk/c0t1d0s0
newfs: construct a new file system /dev/rdsk/c0t1d0s0: (y/n)? y
/dev/rdsk/c0t1d0s0:28188 sectors in 87 cylinders of 9 tracks, 36 sectors
15.5MB in 3 cyl groups (16 c/g, 5.90MB/g, 2688 i/g)
super-block backups (for fsck -F ufs -o b= #) at:
32, 11632, 23232,

11-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The newfs routine turns raw partitions into file systems.


✓ The newfs routine creates the superblock and its backups.

✓ The newfs routine creates the lost+found directory.

■ newfs completely removes any access to pre-existing data from


the area it is working on.

File System Initialization 11-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Mounting a File System

After you create the file system, you need to make it accessible. This is
done by associating the file system with a mount point through a
process called mounting.

# mkdir /data1
# mount /dev/dsk/c0t1d0s0 /data1

Device and Mount


partition point

# mount

/ on /dev/dsk/c0t3d0s0 read/write on Apr 24 18:33:50 1993


/usr on /dev/dsk/c0t3d0s6 read/write on Apr 24 18:33:50 1993
/home on /dev/dsk/c0t3d0s7 read/write on Apr 24 18:33:50 1993
/data1 on /dev/dsk/c0t1d0s0 read/write on May 2 02:05:05 1993

Mount point Device and Read/write or read- Date and time


name partition only permissions mounted

11-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ To make the file system usable, it must be mounted.


✓ This is done by associating the file system with the mount point through a process called
mounting. Once the file system is mounted, all the subdirectories and files within it are
made available for use.

■ For mounting to take place, there must be a destination for the file
system.

■ First make a directory to mount with by using the mkdir


command. This is called the mount point.

■ File systems are mounted on empty directories (the mount point)


with the mount command as seen in the top example on the facing
page.
✓ This is done through a directory and a command named mount. This directory is the
mount point and looks like a simple directory when viewed from the operating system.
Usually the directory used for the mount point is empty. If it is not, the previous contents
of the mount point directory become unavailable as long as a file system is mounted
there, but are not permanently affected by the mounting process.

■ Once the file system is mounted, the operating system recognizes


it and data can be written.

■ The root file system has a single slash indicating its mount point.
✓ The usr file system has the directory /usr as its mount point, and the home file system
has the directory /home as its mount point.

■ The mount command displays which partition is mounted on


which mount point.
✓ The mount command with no arguments (as seen on the facing page, bottom example),
displays only the active mounts between partitions and mount points are displayed. By
associating the partitions with the mount points in this way, the file systems are made
available for use.

File System Initialization 11-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

/usr/etc/mount

■ The mount command display has four fields:

# mount

/ on /dev/dsk/c0t3d0s0 read/write on Apr 24 18:33:50 1993


/usr on /dev/dsk/c0t3d0s6 read/write on Apr 24 18:33:50 1993
/home on /dev/dsk/c0t3d0s7 read/write on Apr 24 18:33:50 1993
/data1 on /dev/dsk/c0t1d0s0 read/write on May 2 02:05:05 1993

Mount point Device and Read/write or read- Date and time


name partition only permissions mounted

11-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ During system startup, the SunOS operating system creates a


file named /etc/mnttab to mount file systems.
■ mount prints out the contents of /etc/mnttab.

■ The swap partition is never mounted.


✓ The swap partition is not found in the /etc/mnttab file because it does not need to be
mounted. Only file systems are mounted and swap is not a file system.

File System Initialization 11-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Background Structures

VTOC
Boot block
Superblock
Backup superblock

Cylinder group block

inode table

Data block(s)

Backup superblock
Created by
the newfs Cylinder group block
command

inode table

Data block(s)

Backup superblock

Cylinder group block

inode table

11-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The background structures of the file system are the


superblock, the cylinder group blocks, and the inode tables.
■ These are created via the newfs command.

# newfs /dev/rdsk/c0t1d0s0
newfs: construct a new file system /dev/rdsk/c0t1d0s0: (y/n)? y
/dev/rdsk/c0t1d0s0:28188 sectors in 87 cylinders of 9 tracks, 36 sectors
15.5MB in 3 cyl groups (16 c/g, 5.90MB/g, 2688 i/g)
super-block backups (for fsck -F ufs -o b= #) at:
32, 11632, 23232,

✓ Background structures are necessary for a disk to operate with its installed file systems.
The background structures help the operating system find files that are requested by a
user, to keep the operating system from becoming corrupted, to allow users to create
files, and so on. Background structures keep the operating system operating efficiently
and effectively. They are what is often referred to as the “administrative overhead” of the
operating system.

■ The operating system uses a procedure to group cylinders for


greater efficiency.
✓ A cylinder group is comprised of 32 or less cylinders on a disk (the default is 16).

■ Because of cylinder groups, some of the detrimental scattering of


data is prevented.
✓ The SunOS operating system file system attempts to allocate directories and their files
within the same cylinder group.

■ The VTOC is created by the format utility.

■ The boot block is installed by the installboot program.

File System Initialization 11-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

VTOC and Boot Blocks

VTOC sector #0

Boot blocks for


boot strap program
sectors #1–15

One file system


residing on one
partition

Initial superblock sector# 16

Backup superblock sector# 32

Cylinder group block

Inode table

11-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The first sector is called the VTOC.

■ The VTOC stores the partition offsets and partition sizes.


✓ Once a file system is installed on a partition, the operating system must be able to find
that partition and then later use the /etc/fstab file to mount the file system. This
process is accomplished during the use of the format program when the offsets and
sizes of the partitions are stored in the first sector on the disk.

✓ The VTOC, created by the format utility, is read first; its address is 0/0/0. Besides storing
offsets and sizes, the VTOC also stores the geometry of the disk:

- the type of disk

- the number of heads

- the total number of cylinders

- a copy of the defect list

- the sectors per track.

■ Following the VTOC is the boot block.

■ If the boot block becomes corrupted, the disk will not boot up.
✓ There are 15 sectors reserved for the boot block, 0/0/1 to 0/0/15. The boot block
contains: the addresses of where the boot program is located on the disk, and other
information necessary for the initialization of the SunOS operating system.

✓ All file systems have an active VTOC, but only the root file system has an active boot
block area, although space is allocated for them in every file system.

File System Initialization 11-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Displaying a Disk’s VTOC

# prtvtoc /dev/rdsk/c0t0d0s0

* /dev/rdsk/c0t0d0s0 partition map


*
* Dimensions:
* 512 bytes/sector
* 80 sectors/track
* 9 tracks/cylinder
* 720 sectors/cylinder
* 2500 cylinders
* 1151 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 41040 41039 /
1 3 01 41040 205200 246239
2 5 00 0 828720 828719
5 6 00 246240 20880 267119 /opt
6 4 00 267120 561600 828719 /usr
#

11-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The prtvtoc (print VTOC) command is used to display a disk’s


volume table of contents.
✓ The dimensions portion of the example display show the geometry of the disk.

✓ The lower portion of the display shows the disk’s partition table. However, this table looks
a bit different than the partition table that is displayed in the format utility.

File System Initialization 11-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Superblock and Cylinder Group Block

Superblock
■ Superblock clean flag

■ Number of cylinder groups

■ Number of data blocks

■ Number of fragments in a data block

■ Size of a data block

■ Size of a fragment

■ Number of tracks in a cylinder

■ Number of sectors in a track

■ Number of sectors per cylinder

■ Number of cylinders in the partition

Cylinder Group Block


■ Number of cylinders

■ Number of data blocks

■ Position of the last used data block

■ Number of free data blocks and their locations

■ Position of the last used fragment

■ Number of free fragments

11-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ A file system consists of a number of cylinder groups, each of


which has inodes and data blocks.
■ Associated with each cylinder group is a cylinder group block that
defines the cylinder group.
✓ In addition to the information in the graphic, the cylinder group block describes the total
number of inode blocks, the position of the last used inode, and the total data blocks for
each cylinder. The number of free blocks and free fragments in the cylinder group are
contained in the cylinder summary table.

■ The file system is described by its superblock.

■ The superblock contains the basic parameters for the file system.
✓ The superblock is built when the file system is created and it never changes, except for
the clean flag. The state of the superblock clean flag is checked by the fsck command to
determine the state of the file system. If the file system is corrupted, fsck makes its
checks; however if the clean flag indicates all is well, fsck does not check it. Because the
superblock contains critical data, it is replicated to protect against catastrophic loss. The
copies are referenced if a disk failure causes the superblock to become corrupted. The
superblock begins at an address of 0/0/16; the first superblock backup begins at an
address of 0/0/32.

■ The superblock is contained in 16 disk sectors, one SunOS data


block in size.
✓ The superblock is a global structure containing information about the file system. In
addition to the information in the graphic, the superblock describes how many blocks
need to be kept free, the number of disk revolutions per second, the maximum number of
blocks a file can use in a cylinder group, total number of cylinders per cylinder group, and
the number of inodes per cylinder group, and other information. When you mount a file
system, a copy of the superblock is made in memory.

✓ All subsequent operations to create or remove files involve modifying the in-memory
superblock. A common cause of file system corruption is for the operating system to
crash (for example, due to a power failure) as you are trying to reconcile the memory
superblock to disk.

File System Initialization 11-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

SunOS Operating System Data Blocks

sec0
512 bytes = Disk block

sec0
512 bytes SunOS fragment
sec1 1024 bytes
512 bytes
sec2
512 bytes SunOS fragment
sec3 1024 bytes
512 bytes
sec4
512 bytes SunOS fragment
sec5 1024 bytes
512 bytes
sec6
512 bytes SunOS fragment
sec7 1024 bytes
SunOS data block 512 bytes
8192 bytes sec8
512 bytes SunOS fragment
sec9 1024 bytes
512 bytes
sec10
512 bytes SunOS fragment
sec11 1024 bytes
512 bytes
sec12
512 bytes SunOS fragment
sec13 1024 bytes
512 bytes
sec14
512 bytes SunOS fragment
sec15 1024 bytes
512 bytes

11-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ Different files are of different sizes in bytes.

■ The operating system transfers data in sizes up to 8192 bytes in


size.

■ Data blocks are 8192 bytes in size.

■ Data blocks assist the transfer of data.

■ Large data blocks make disk transfers much more rapid when
transferring large amounts of data.
✓ Files are stored in fragments of 1024 bytes. Each fragment comprises two contiguous disk
blocks of 512 bytes on the disk.

✓ If only data blocks were used to store files, each file that did not fill a large block to
capacity would waste all of the empty portion of the block, since it could not be allocated
to another file. If this were the case, then this loss of space multiplied by many such files
could cause the amount of disk space lost to be quite high.

■ Using only data blocks, disk space could be wasted with small
files.

■ Data blocks are comprised of fragments.

■ Fragments are 1024 bytes in size.

Using fragments makes disks more efficient.

■ Fragments are allotted in those instances when a file does not


fill an entire block.
■ A fragment consists of two disk blocks.
✓ A method for coping with the disk space loss caused using only data blocks is to divide
each data block into fragments. The smallest area a file is allowed to fill on the disk is 8
fragments. If the file is smaller than 8192 bytes, it is stored in sequential disk blocks up to
and including its size, but will not be smaller than a fragment.

File System Initialization 11-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Data Blocks and Fragments

Data block
8192 bytes

1024
bytes
Fragment
File A and file B
share a single fileA fileA fileA fileA fileB fileB fileB Block 1
file system block

Block 2

File A is extended
into the last free fileA fileA fileA fileA fileA fileB fileB fileB Block 1
fragment; file A
needs more space

Block 2

fileB fileB fileB Block 1


OS finds a block
that has enough
free fragments and
move file A into it fileA fileA fileA fileA fileA fileA Block 2

11-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ Fragments make storing files on disks more efficient.

■ By using fragments, you can store data from two files in the same
block.
✓ That means data blocks are used more fully. Without fragments, there would be many data
blocks that would be partially empty. Those data blocks would remain empty because the
operating system would not be able to fill them. This would cause a severe waste of disk
space. The operating system does use fragments, and thereby uses the disk more
completely.

■ Fragments from the same file cannot be stored in two different


blocks, unless the file has first filled one of the data blocks
completely.

■ Files large enough to fill more than one data block are usually
found within the same cylinder group.
✓ A file that needs more disk space, but doesn’t need another block, is allotted fragments
only. If a file grows to require more space than is available in a block it shares with a
second file, the operating system moves all of the data of the file from that block into
another block, to assure that all fragments are in the same block. Files that are large
enough to require more than one data block are usually not contiguous, but scattered
within the cylinder group.

■ In the instance of very large files, each large file is spread across
cylinder groups.
✓ A large file is only allowed 1 Mbyte per cylinder group. This prevents one file from using
an entire cylinder group. The trade-off here is that you only have to perform a long seek
after reading or writing approximately 1 Mbyte.

■ At startup, fsck reports the amount of fragmentation of a file


system:

/dev/rdsk/c0t3d0s6: 1046 files, 113639 used, 26727 free


/dev/rdsk/c0t3d0s6: (543 frags, 3273 blocks, 0.4% fragmentation

File System Initialization 11-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

File inodes

inode

Permissions Data
Links blocks
and other
Information Indirect
block
2048
0 data
blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
2048
data
blocks
Indirect
block
2048
addresses
Double
indirect
block
2048
addresses

11-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ An inode is a background structure that directs the operating


system to the locations of the data blocks that are stored on the
disk for a single file.
■ The kernel maintains information about each existing file in the
file’s inode.

■ Directories are viewed as special files by the operating system.


✓ Each inode contains more than 40 pieces of information making up a “description” of its
file. The inode contains information on:

- Who owns the file

- How many data blocks and fragments make up the file

- How many bytes the file contains

- Type of file; regular, character/block special, directory, socket, symbolic link, or named
pipe

- When the file was last accessed

- When the file was last modified

- Addresses of the file data block locations on the disk

- Permissions for the file

- Kernel information

■ The inode contains pointers (addresses) that tell the operating


system how to find the data blocks for its file.
✓ Each inode has an array of 14 pointers. The first 12 point directly to the data blocks. The
thirteenth points to an indirect block that contains 2048 pointers to data blocks. The
fourteenth points to a double indirect block that contains 2048 pointers to indirect blocks,
each of which contains 2048 pointers to data blocks.

■ The inode does not contain the name of the file.


✓ A file’s name is found in the directory in which the file is created.

File System Initialization 11-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

inode Table

■ The inode table

■ The inode table is a single inode control point

■ The inode table is loaded into memory at boot time

11-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The inode table provides a quick reference to the inodes being


used by files.
✓ When a file system is mounted, the inode tables for that file system are loaded into
memory. The inode tables remain in memory while the file system is mounted, which
makes the lookup of data blocks very fast. The only information stored in directories is a
pointer to the inode (the inode number) and the file name. All other information about the
file such as permissions, ownership, size of file, and so on, is found in the inode. The
inode table is like an index of a book, it makes finding the inode fast just like finding
something in a book from looking in the index.

■ The inode table extends over several data blocks.


✓ Because there must be a reference for each inode that is used, the inode table becomes
very large. There is one inode for each file and each directory in the SunOS operating
system and there must be a reference to each of those inodes in the inode table.

File System Initialization 11-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

fsck Inconsistency Problems

When a corrupted file system is found during the system boot


operation, fsck attempts to repair any errors that it considers “safe” to
repair.

Typical fsck Inconsistency Message

checking filesystems
/dev/rdsk/c0t3d0s6:ZERO LENGTH DIRECTORY I=1632 OWNER=root MODE=40755
/dev/rdsk/c0t3d0s6:SIZE=0 MTIME=May 13 12:46 1992
/dev/rdsk/c0t3d0s6:DIR=/usr/games
WARNING - Unable to repair some of the following filesystems:
/usr
Run fsck manually (fsck filesystem...)
Exit the shell when done to continue the boot process
#

11-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ The example on the facing page shows fsck running at boot


time. In this case, fsck was not able to fix the file system
inconsistency safely (without truncating some files), therefore,
the bootup process is stopped until an administrator can fix the
problem.
■ The fsck program is used to check and repair file system damage.

■ The SunOS file system can be corrupted by a power failure,


inappropriate system shutdown, or hardware that goes bad.

■ The fsck program is used to correct file system corruption.


✓ File system corruption is not the same thing as a bad disk sector. fsck detects and
attempts to make corrections to logical inconsistencies when it is checking the integrity
of the file systems. Logical inconsistencies are usually due to the operating system
crashing unexpectedly.

✓ This type of fsck error message might result from drives that are simply powered off.
fsck, having difficulty accessing the drive, reports a problem that may not be a file
system inconsistency.

File System Initialization 11-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

fsck Usage

Examples

# fsck -o p /dev/rdsk/c0t3d0s6

/dev/rdsk/c0t3d0s6: UNREF FILE I=4130 OWNER=root MODE=100664


/dev/rdsk/c0t3d0s6: SIZE=3072 MTIME=Mar 31 12:40 1993 (CLEARED)
/dev/rdsk/c0t3d0s6: UNREF FILE I=4149 OWNER=root MODE=100664
/dev/rdsk/c0t3d0s6: SIZE=4096 MTIME=Mar 31 12:59 1993 (CLEARED)
/dev/rdsk/c0t3d0s6: UNREF FILE I=4176 OWNER=root MODE=100664
/dev/rdsk/c0t3d0s6: SIZE=1024 MTIME=Mar 31 12:59 1993 (CLEARED)
/dev/rdsk/c0t3d0s6: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/rdsk/c0t3d0s6: 1046 files, 113639 used, 26727 free
/dev/rdsk/c0t3d0s6: (543 frags, 3273 blocks, 0.4% fragmentation

# fsck -o p /dev/rdsk/c0t3d0s6

/dev/rdsk/c0t3d0s6: is stable

11-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Notes

■ To correct file system problems, you must run the fsck


command in the manual mode.
■ Using the “r” in /dev/rsd0h allows fsck to run on any file
system, mounted or unmounted.
✓ The “r” signifies the “raw” mode, which allows fsck to check the file system without
referring to the superblock loaded in system memory.

■ The fsck program can operate in several modes—two of which


are preen and interactive.

■ Preen is a non-interactive mode that automatically repairs


non-destructive file system inconsistencies. Preen is the mode that
runs at boot time.

■ The interactive mode allows users to audit and repair any


inconsistencies.
✓ fsck options [-o]:
no option – interactive mode, system waits for user intervention [default]
-o pPreen – no intervention, correct expected inconsistencies.
-o bRun – fsck using a designated backup superblock if the original, #16 is corrupted.

✓ Running fsck without specifying a specific disk, forces all file systems listed in the
/etc/vfstab file to be checked.

■ There are five Phases of fsck:

Phase 1 – Check blocks and sizes


Phase 2 – Check path names
Phase 3 – Check connectivity
Phase 4 – Check reference counts
Phase 5 – Check cylinder groups

■ Each file system contains a superblock clean flag that is examined


during the booting cycle. If a file system is not marked clean or
stable, the fsck program is run on that file system.
✓ The following information can be found in the System Administration and Networking
Manual, section fsck, pages 757–787 and by using on-line manual pages for fsck.

File System Initialization 11-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—File System Initialization

Objectives
■ Divide a disk drive into two partitions (“0” and “6”).

■ Initialize both partitions using the newfs command.

■ Create two mount point directories in root.

■ Manually mount each of the new partitions.

■ “Undo” your activities.

■ Run fsck on the new file systems.

Tools and Equipment


■ One Sun SPARCstation, a pen or pencil, and this module, “File
System Initialization.”
■ A spare disk drive on your system.

■ A “floater” disk drive for this lab.

■ A system that can boot the SunOS operating system.

11-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—Disk Partitioning Overview

Lab Exercise
Partitioning a disk using the format utility does not create a file
system. After the partitioning process is completed, you have what is
referred to as a “raw” disk. It is only divided into areas or partitions.
What you do with those areas is the subject of this lab.

■ Partition “0” is normally made into a file system (/).

■ Partition “1” is left as a raw partition for swapping.

■ Partition “6” is made into a file system (/usr).

Raw Disk

0 6
1

Boot blocks
Partition 0
/ (root)
VTOC
Partition 1
swap Partition 6
/usr

File System Initialization 11-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—Finding Your Practice Disk

1. Use the mount command to show all disks with mounted file
systems.

The example here indicates that two


disk drives are in use; t3 and t1.

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - no rw,suid
/dev/dsk/c0t3d0s6 - /usr - - no rw,suid
swap - /tmp tmpfs - no rw
/dev/dsk/c0t1d0s5 - /opt ufs - no suid,rw

The “t” numbers

2. Record “t” numbers from your mount command:

__________

__________

__________

__________

__________

Note – These numbers represent disk drives that are in use. Avoid
using these disks in the following lab exercises.

11-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—Partitioning Your New Disk

It is most important during this lab that you do not repartition the
system disk. Refer to Module 10, "Disk Drive Partitioning" as needed.

Partition Your Practice Disk into Two Equal-sized Partitions


1. Start up the format utility and select the spare disk.

# format
Select only a disk
Searching for disks...done drive that is not in use.
AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN0207 cyl 1254 alt 2 hd 9 sec 36>
/sbus@1,f8000000/esp@0,800000/sd@3,0
1. c0t1d0 <SUN0669 cyl 1614 alt 2 hd 15 sec 54>
/sbus@1,f8000000/esp@0,800000/sd@1,0
2. c0t2d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
/sbus@1,f8000000/esp@0,800000/sd@2,0
Specify disk (enter its number): 2

2. Select the Partition menu.

3. Print the Partition listing of your new disk.

4. Make Partition 0 equal to 30 Mbytes.

5. Make Partition 6 the rest of the disk.

6. “Zero” all Partitions 1, 3, 4, 5, and 7. Remember: don’t change


Partition 2, it represents the whole disk.

7. Check your values carefully.

8. Write the new label (partition> label).

9. Exit the Partition menu, then exit the format utility.

Note – If you are having any problems, ask your instructor for
assistance.

File System Initialization 11-37

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—Initializing the Partitions on Your New Disk

Your newly partitioned disk cannot hold data. To prepare it to accept


data, you must install the background file structures. To do this, run the
newfs command.

Caution – newfs wipes out any data on the disk so be careful to


! choose your practice disk!

10. Run newfs on both of your partitions (you must initialize each
partition separately).

Choose your practice disk!

# newfs /dev/rdsk/c0t2d0s0
newfs: construct a new file system /dev/rdsk/c0t2d0s0: (y/n)? y
/dev/rdsk/c0t2d0s0:28188 sectors in 87 cylinders of 9 tracks, 36 sectors
15.5MB in 3 cyl groups (16 c/g, 5.90MB/g, 2688 i/g)
super-block backups (for fsck -F ufs -o -b= #) at:
32, 11632, 23232,

# newfs /dev/rdsk/c0t2d0s6
newfs: construct a new file system /dev/rdsk/c0t2d0s6: (y/n)? y
/dev/rdsk/c0t2d0s6:14094 sectors in 44 cylinders of 9 tracks, 36 sectors
31MB in 6 cyl groups (16 c/g, 5.90MB/g, 2688 i/g)
super-block backups (for fsck -F ufs -o -b= #) at:
32, 11632, 23232,

11. What are the two main items created by the newfs command?

____________________________

____________________________

11-38 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—Creating Mount Point Directories

Mount points directories are always made in the root directory and
are owned by root. They are just empty directories until they are
mounted.

Making the Mount Point Directories in root


1. What is used for a mount point?

2. Create two mount points for your new file systems:

# mkdir /mnt1 /mnt2

3. Change directory to one of the new directories and look at it.

# cd /mnt1
# ls

4. Did the ls command show anything in the /mnt1 directory?

Yes ____ No ____

5. Change to the root directory.

# cd /

File System Initialization 11-39

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—Manually Mounting File Systems using mount

The mount command can be used to mount a single partition for


testing purposes.

1. Mount your two new file systems as shown below. You will have
to substitute the ID number of your new disk in the command
lines.

# mount /dev/dsk/c0t2d0s0 /mnt1

# mount /dev/dsk/c0t2d0s6 /mnt2

Note – Substitute the t


number of your spare disk.

2. Change directory to one of your new file systems and look at it.

# cd /mnt1

# ls

3. Is there anything there? If so, what?

______________________________

4. You have now successfully added file systems to your


workstation.

Note – If you are having trouble, ask the instructor for assistance.

11-40 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—File System Cleanup

You must undo everything you have done so far in this lab so that the
next person will be able to complete this procedure.

Put It Back the Way You Found It


1. Manually unmount your two new partitions.

# cd /

# umount /mnt1

# umount /mnt2

2. Remove the mount points and reboot.

# rm -r /mnt1 /mnt2
# reboot

3. How does the system respond to the reboot command?

a. File systems are checked

b. File systems are not checked

c. System stops at: login:

d. System stops at: #

Note – If your system will not complete the boot operation, call the
instructor now!!!

File System Initialization 11-41

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—Data Blocks, Disk Blocks, and Fragments

1. In the space below, compute the number of disk blocks (sectors)


found in one fragment.

_____ disk blocks (sectors) = one fragment

2. In the space below, compute the number of fragments found in


one data block.

_____ fragments = one data block

3. In the data block below, draw the component fragments and disk
blocks (sectors).

Data block = _______ bytes

4. Compute the number of bytes for data below.

_______ bytes per sector * _____ = one fragment

_______ bytes per fragment * _____ = one data block

5. A data block is a structure that (circle all that apply):

a. Causes disk overflow

b. Assists the transfer of data

c. Slows down data transfer because of its large size

d. Is more efficient when used with fragments

6. What is the data block used for?

a. It stores all of the inodes for the cylinder group

b. It stores label information

c. It stores files

d. It stores cylinder group information

11-42 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—Displaying the Disk Label with prtvtoc

1. Use the prtvtoc command to print out the disk label. Record your
output below:

# prtvtoc /dev/dsk/c0t1d0s0

* _____________ partition map


*
* Dimensions:
* ___ bytes/sector
* ___ sectors/track
* ___ tracks/cylinder
* ___ sectors/cylinder
* ___ cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
* 0 2 00 0 30240 30239
* 1 3 01 30240 94320 124559
* 2 5 00 0 828720 828720
* 5 0 00 124560 21600 146159
* 6 4 00 146160 353520 499679
* 7 8 00 499680 329040 828719

File System Initialization 11-43

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—Displaying the Disk Label with prtvtoc

2. How many Mbytes is the entire disk?

disk = _____ MBytes

Hint – The entire disk is displayed as Partition 2.

3. How many partitions are actually being used? __________

4. The prtvtoc command gives information (circle all that apply):

a. That resembles the partition printout in format

b. About the type of controller being used

c. About the starting sector for every used partition

d. About the total number of sectors on the disk

e. About the total number of cylinders on the disk

5. How many possible partitions are available for each disk?________

6. What happens if the boot block becomes corrupted?

a. Nothing, the boot block is no longer used on Sun machines

b. The disk will boot up using the label block

c. The disk will not boot up

d. Not much, the boot block can automatically repair itself, but it
takes several hours

11-44 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1111 11

Lab—fsck, the Superblock, and inodes

1. Execute fsck -op on the /opt partition. Record the output below:
machine name # fsck -o p /opt

2. What is the purpose for using the fsck command (circle all that
apply)?

a. To correct inconsistencies in block information

b. To correct inconsistencies in the disk label

c. To correct inconsistencies in the superblock

d. To correct inconsistencies in inode information

e. To correct file system corruption

3. A file system can become corrupted by:

a. Creating more files than are allowed

b. A power failure

c. Hardware that runs too fast

4. There are how many inodes for each file in a file system?

a. Two c. Three

b. One d. As many as the file needs

File System Initialization 11-45

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
11

Lab—fsck, the Superblock, and inodes

5. An inode (circle all that apply):

a. Directs the operating system to the location of a stored file

b. Contains the file name

c. Points to a single file

d. Points to many files

e. Contains pointers to find the data blocks

6. The superblock:

a. Directs the operating system to the location of a stored file

b. Contains the basic parameters of the file system

c. Is 16 cylinders in length

d. Cannot be corrupted

e. Contains the clean flag

This concludes the File System Initialization lab.

11-46 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
vfstab and vi 12

Objectives
Upon completion of this module, you will be able to:

■ Describe the /etc/vfstab file and its use.

■ Edit the /etc/vfstab file correctly.

■ Create a file using the vi text editor and name the file correctly.

■ Create a file using the cp command and name the file correctly.

■ Remove a file using the rm command.

Evaluation
Complete the lab at the end of this module.

References
SunOS User’s Guide: Getting Started, Part Number 800-3830-10

12-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

How File Systems Are Mounted at Boot Time

# more /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
/proc - /proc proc - no -
fd - /dev/fd fd - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 2 no -
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /export/home ufs 3 yes -
/dev/dsk/c0t3d0s5 /dev/rdsk/c0t3d0s5 /opt ufs 6 yes -
/dev/dsk/c0t3d0s1 - - swap - no -

12-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ The operating system references the file /etc/vfstab (virtual


file system table) at boot time to determine what file systems
exist.
✓ Any unlisted file systems must be manually mounted to be used by the operating system.

The /etc/vfstab has seven fields of information:

1. device to mount—describes where the physical partition


resides.

2. device to fsck—describes which raw device to run fsck on at


boot time.

3. mount point—describes which mount point to use.

4. FS type—identifies the file system type; ufs for local file system,
or nfs for remote file systems.

5. fsck pass—describes the order that fsck should run on the file
systems.

6. mount at boot—has two possible options; yes, mount at boot


time, or no, do not mount at boot time.

7. mount options—identifies the type of access to the file system


such as read and write access.
■ Fields are separated by spaces.

■ A “-” is used to indicate no entry in a field.

■ There is so much information contained in each line of the


/etc/vfstab file that the fields do not line up in columns when
displayed. Therefore, extra care must be taken when editing this
file.

Note – The swap partition can be listed in the /etc/vfstab file;


however, it is not mounted at boot time.

vfstab and vi 12-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Boot Messages

ok boot -v
. . .
. . .
. . .
. . .
The /usr file system (/dev/rdsk/c0t3d0s6) is being checked.
/dev/rdsk/c0t3d0s6: 8604 files, 95916 used, 20899 free
/dev/rdsk/c0t3d0s6: (163 frags, 2592 blocks, 0.1% fragmentation)
/dev/rdsk/s0t3d0s6 FILE SYSTEM STATE SET TO OKAY
The System is coming up. Please wait.
checking filesystems
/dev/rdsk/c0t3d0s5: is stable.
/dev/rdsk/c0t3d0s7: is stable.
/dev/rdsk/c0t3d0s7: mounted
/dev/rdsk/c0t3d0s5: mounted
. . .
. . .
. . .
. . .

12-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

Boot messages are displayed as the system references the


/etc/vfstab file. The example boot message uses the
-v (verbose option).

Each file system contains a superblock clean flag that is examined


during the booting cycle. If a file system is not marked clean or stable,
the fsck program is run on that file system.

Flag States
There are three flag states:

1. Clean—No change in healthy file system

2. Stable—Correction made to previous state of the file system

3. Dirty—Corruption detected
■ Before the file systems are mounted at boot time, the system
checks to see if the file systems are considered stable by
checking the clean flag in each file system‘s superblock.

Note – If the file systems are not stable, fsck proceeds to run on the
suspect corrupt file system and makes an attempt to fix it.

■ In the example, the /usr file system was checked by fsck


because its clean flag was not set in its superblock.
■ The other file systems were not checked by fsck. Their
superblocks indicated that they were clean.

■ Once fsck is finished, the file systems are mounted.

vfstab and vi 12-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

The vi Text Editor

■ Interactive

■ Visual display editor

■ Performs screen management functions

■ Uses an edit buffer concept

12-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

Note – vi (visual editor) is a sophisticated editor available in UNIX. vi


is introduced in this module because it is used to edit the vfstab file.
Note, however, that the vi editor is not window based, and can be
used to edit just about any ASCII file in the UNIX operating system.

The vi text editor has the following traits:

■ vi is interactive.
✓ The system immediately translates user requests into actions. This provides users
immediate response to edit commands.

■ vi is a visual display editor.


✓ The results of character, word, and line edits are immediately displayed on the screen.

✓ vi is not a word processor; function keys cannot be programmed to execute editor


commands.

■ vi performs screen management.


✓ vi keeps track of all activity on the screen, efficiently displaying the results of text edits.
Screen activities are managed efficiently to reduce user response time in an edit session.

■ vi uses an edit-buffer concept.


✓ At the start of a vi session, vi reads the contents of the file into a temporary file. All
changes the user makes are made to this copy of the file. The original is kept intact until
the command is issued to write the file to disk. The advantage of this method is that it is
possible to effectively cancel major edits and restore the file to its initial state.

Caution – Make a backup copy of the file you plan to edit, as follows.
!
Command format:

cp<sp>source_file_name<sp>destination_file_name

Example:

# cp /etc/format.dat /tmp/new_format.dat
✓ Although vi edits occur to the temporary file, copying the original and then editing the
copy lets you delete a file that was saved and start over.

vfstab and vi 12-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Editing and Writing Files

Command format:

# vi filename

Use vi to create or edit an existing file as follows:

# vi /tmp/new_format.dat

The screen clears all text before beginning the new editing session and
the cursor is positioned at the top left of the file, as shown in the
example,

#
# @(#)format.dat 1.31 92/07/21 SMI
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
# Data file for the ‘format’ program. This file defines the known
# disks, disk types, and partition maps.
#

#
# This is the search path for ‘format’. It contains all the disks that
# will be searched for if no disk list is given on the command line.
#
search_path = xd0, xd1, xd2, xd3, xd4, xd5, xd6, xd7, xd8, xd9, xd10, xd11, \
xd12, xd13, xd14, xd15, xy[0-3], sd[0-7], sd8, sd9, sd1[0-9], \
sd20, id0[0-4][0-7]

#
# This is the list of supported disks for the Xylogics 450/451 controller.
#
disk_type = “Fujitsu-M2312K” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 587 : acyl = 2 : pcyl = 589 : nhead = 7 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 1
“/tmp/new_format.dat” 424 lines, 14127 characters

12-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ The standard SunOS text editor is vi.


✓ vi stands for visual display editor. Since vi is not window-based, it can be used on any
kind of terminal.

✓ When the sessions begin, the cursor position is at the top left of the file.

■ The example below indicates a new file.

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
“myfile” [New file]

✓ The tildes flowing down the left margin indicate null areas; these are replaced by text as it
is entered.

✓ The message in the lower-left of the page shows the name of the file and that it is a new
file.

vfstab and vi 12-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Modes of Operation and Cursor Movement

■ The arrow keys move the cursor in the direction of the arrow.

Up

Left Right

Down

■ The unshifted H, J, K, and L keys also move the cursor.

H J K L

12-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

The vi text editor has two modes of operation:

■ Input mode—In this mode, the keys that you type are
interpreted as text input to the file.
■ Command mode— Sometimes called “edit mode.” In this mode,
the keys that you type are interpreted as commands that let you edit
the file.

Each vi session begins in command mode.

■ Cursor movement is performed in command mode.

■ The arrow keys are found on the right side of the keyboard. The
direction of the arrow determines the direction of cursor
movement.

■ You can also use the lowercase h, j, k, and l to position the cursor.
✓ The arrow keys cannot be defined on various non-Sun keyboards and in certain SunOS
environments. The lower case characters h, j, k, and l are always defined.

■ Most vi commands are case-sensitive: The same command typed


in lowercase versus uppercase has different effects.
✓ On the newer keyboards, a light illuminates when the Caps Lock key is pressed; however,
the F1 key can also be a Caps Lock key and there is no way to tell it is on except that the
text is in caps.

vfstab and vi 12-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Entering Text

Three keyboard commands that allow text input are:

a i o
Append Insert Open

■ The a key allows entering text after the cursor:

Press #ident “@(#)format.dat 1.11 92/08/13 SMI”


#
a # Copyright (c) 1991 by Sun Microsystems, Inc.
#

■ The i key allows entering text before the cursor:

Press #ident “@(#)format.dat 1.11 92/08/13 SMI”


#
i # Copyright (c) 1991 by Sun Microsystems, Inc.
#

■ The o key opens a line for text entry below the cursor:

Press #ident “@(#)format.dat 1.11 92/08/13 SMI”

o #
# Copyright (c) 1991 by Sun Microsystems, Inc.

■ The Shift-o key opens a line for text entry above the cursor:

Press
Shift #ident “@(#)format.dat 1.11 92/08/13 SMI”
#
o # Copyright (c) 1991 by Sun Microsystems, Inc.

12-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

To enter text in a vi file, you must be in input mode. Four keyboard


commands that put vi into input mode are:

■ a—To enter text when there is existing text, use the append
command.
✓ The a command enters text immediately following the cursor’s position. It is especially
useful at the end of a paragraph or page of text, when another word or sentence needs to
be added.

■ i—To enter text when you begin a new session in vi, use the
insert command.
✓ The i command allows entering text in the first position of a file when that file is new. If
the file was created earlier and there is text already in it, the i insert the text one position
before the cursor’s position. It is especially useful at the beginning of a paragraph or page
of text, when another word or sentence needs to be added.

■ o—To enter text when you need to add another paragraph below
the existing paragraph, use the open command.
✓ The o command allows you to enter a new line in the file by opening a new line below the
present cursor position. The line is now open for new text. It is especially useful at the
end of a paragraph or page of text, when another line needs to be added.

■ (Shift-o)—To enter text when you need to add another paragraph


below the existing paragraph, use the (Shift-open) command.
✓ The [Shift-o] command allows you to enter a new line wherever required in the file by
opening a new line above the present cursor position. The line is now open for new text.
It is especially useful at the beginning of a paragraph or page of text, when another line
needs to be added.

vfstab and vi 12-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Exiting Input Mode

The following keyboard command terminates text input:

Esc

Escape

#
# @(#)format.dat 1.31 92/07/21 SMI
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
# The following entries signify that this file was updated
# on 1 June 1990.
#
# No existing data was changed; these six extra lines were added
# by Zun Wducation.
#
# Data file for the ‘format’ program. This file defines the known
# disks, disk types, and partition maps.
#
#
# This is the search path for ‘format’. It contains all the disks that
# will be searched for if no disk list is given on the command line.
#
search_path = xd0, xd1, xd2, xd3, xd4, xd5, xd6, xd7, xd8, xd9, xd10, xd11, \
xd12, xd13, xd14, xd15, xy[0-3], sd[0-7], sd8, sd9, sd1[0-9], \
sd20, id0[0-4][0-7]

#
# This is the list of supported disks for the Xylogics 450/451 controller.
#
disk_type = “Fujitsu-M2312K” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 587 : acyl = 2 : pcyl = 589 : nhead = 7 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 1

Esc

12-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

To return to command mode from input mode, press the Escape key.
✓ The only way to exit the Input mode is with the Escape key.

✓ Whenever you are in doubt if you are in input mode or not, press the Escape key. If you
are not in input mode, the display flashes and gives an audible tone—signifying that the
Escape key has already been pressed.

vfstab and vi 12-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Deleting Text

■ Delete one character at a time with the lowercase x.

#
# @(#)format.dat 1.31 92/07/21 SMI
# Copyright (c) 1991 by Sun Microsystems, Inc.#
#
# The following entries signify that this file was updated
# on 1 June 1990.
# No existing data was changed; these six extra lines were added
# by Zun Wducation.
#
x

■ Delete one line at a time with the lowercase dd.

#
# @(#)format.dat 1.31 92/07/21 SMI
# Copyright (c) 1991 by Sun Microsystems, Inc.#
#
# The following entries signify that this file was updated
# on 1 June 1990.
# No existing data was changed; these six extra lines were added
# by Zun Wducation.
#

d + d

12-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

In input mode, you can delete text in only one way, by backspacing.
✓ The backspace key deletes a single character each time it is pressed.

In command mode, you can delete texts in two ways:

■ The lowercase x deletes a single character.


✓ Position the cursor over the character to be deleted and press the lowercase x. The
Escape key does not need to be pressed after this command function. The x does not
display on the screen.

✓ You can enter a numeral before the lowercase x to delete more than one character. For
example, typing 5x would delete five characters.

✓ In the example, the year 1990 is incorrect; you would use the lowercase x to delete the
incorrect character (in this case the 0 [zero]) then insert the correct character (3).

■ The lowercase dd deletes a single line.


✓ Position the cursor anywhere in the line to be deleted and press the lowercase dd. The
Escape key does not need to be pressed after this command function. The dd does not
display on the screen.

✓ You can enter a numeral then lowercase dd to delete more than one line. For example,
typing 10dd would delete ten lines.

✓ In the example, the line “#by Zun Wducation.” is incorrect; you would use the
lowercase dd to delete the complete line and then insert the correct line
(#by Sun Education.).

vfstab and vi 12-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Undoing a Change

■ A line is deleted:

#
# @(#)format.dat 1.31 92/07/21 SMI
# Copyright (c) 1991 by Sun Microsystems, Inc.#
#
# The following entries signify that this file was updated
# on 1 June 1990.
# No existing data was changed; these six extra lines were added
# by Zun Wducation.
#

d + d

■ Oh, no! Wrong line!

#
# @(#)format.dat 1.31 92/07/21 SMI
# Copyright (c) 1991 by Sun Microsystems, Inc.#
#
# The following entries signify that this file was updated
# on 1 June 1990.
# by Zun Wducation.
#

■ Use a lowercase u to reverse the change:

#
# @(#)format.dat 1.31 92/07/21 SMI
# Copyright (c) 1991 by Sun Microsystems, Inc.#
#
# The following entries signify that this file was updated
# on 1 June 1990.
# No existing data was changed; these six extra lines were added
# by Zun Wducation.
# u

12-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ The “undo” key is the lowercase u when in command mode.

■ The lowercase u reverses any text change done just prior to using
the u.
✓ After making any change to the text, using the lowercase u by itself restores the file to the
state it was before the change was made.

vfstab and vi 12-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Exiting vi

To exit the vi editing session, use the colon and lowercase q.

Shift : then type Q


+ ; lowercase

#
# @(#)format.dat 1.31 92/07/21 SMI
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
# The following entries signify that this file was updated
# on 1 June 1993.
#
# No existing data was changed; these six extra lines were added
# by Sun Education.
#
# Data file for the ‘format’ program. This file defines the known
# disks, disk types, and partition maps.
#

#
# This is the search path for ‘format’. It contains all the disks that
# will be searched for if no disk list is given on the command line.
#
search_path = xd0, xd1, xd2, xd3, xd4, xd5, xd6, xd7, xd8, xd9, xd10, xd11, \
xd12, xd13, xd14, xd15, xy[0-3], sd[0-7], sd8, sd9, sd1[0-9], \
sd20, id0[0-4][0-7]

#
# This is the list of supported disks for the Xylogics 450/451 controller.
#
disk_type = “Fujitsu-M2312K” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 587 : acyl = 2 : pcyl = 589 : nhead = 7 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 1

:q

No write since last change (:quit! overrides)

12-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ Pressing the :q does not write to disk before exiting vi.


✓ With the key stroke example:

- The shift is pressed and then the colon key

- Once the colon is inserted, the lowercase q can be added

✓ Look at the lower-left of the screen and note the :q.

✓ If the disk is not updated with the changes and additions, vi complains.

■ Use Control-G to see if the file has been modified.


✓ Control-G displays the following message if the file has been modified:

- “/tmp/new_format.dat” [Modified] line 431 of 431 --100%--

- The phrase “modified” does not appear if no edits have occurred

■ If the changes are not wanted, use :q!.


✓ The exclamation point tells vi not to save any of the modifications to the file since the
last write. If it is a new file, the file is not saved.

✓ The exclamation point functions only since the last write was made.

vfstab and vi 12-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Saving Text

Use the colon and lowercase w to save to disk:

Shift : W
then type
+ ; lowercase

#
# @(#)format.dat 1.31 92/07/21 SMI
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
# The following entries signify that this file was updated
# on 1 June 1993.
#
# No existing data was changed; these six extra lines were added
# by Sun Education.
#
# Data file for the ‘format’ program. This file defines the known
# disks, disk types, and partition maps.
#

#
# This is the search path for ‘format’. It contains all the disks that
# will be searched for if no disk list is given on the command line.
#
search_path = xd0, xd1, xd2, xd3, xd4, xd5, xd6, xd7, xd8, xd9, xd10, xd11, \
xd12, xd13, xd14, xd15, xy[0-3], sd[0-7], sd8, sd9, sd1[0-9], \
sd20, id0[0-4][0-7]

#
# This is the list of supported disks for the Xylogics 450/451 controller.
#
disk_type = “Fujitsu-M2312K” \
: ctlr = XY450 : fmt_time = 4 \
: ncyl = 587 : acyl = 2 : pcyl = 589 : nhead = 7 : nsect = 32 \
: rpm = 3600 : bpt = 20480 : bps = 621 : drive_type = 1

:w

“/tmp/new_format.dat” 431 lines, 14294 characters

12-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ Always escape the input mode before trying to save your file.

■ Just press Return after saving with :w to go back to your file.


✓ With the key stroke example:

- The shift is pressed and then the colon key

- Once the colon is inserted, the lowercase w can be added

✓ Look at the lower-left of the screen and note the :w.

✓ Saving your work writes the temporary file over the original file and any changes you have
made to it. The cursor stays positioned after the w until the Return key is pressed.

There are two ways to use the :w command to save a file.

■ The file can be written to a new name with the command:

:w new_file_name
✓ The file new_file_name is created and saved, but you are still in the original file.
■ The file can be written and quit at the same time with :wq.
✓ To save time, couple the two commands before leaving vi.

vfstab and vi 12-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Removing Files

Command format: # rm filename

■ Use rm to remove a file:

# rm myfile

■ Use rm to remove more than one file:

# rm myfile /tmp/new_format.dat

12-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Notes

■ The rm command removes one or more files.


✓ You can only remove files that you create. To remove many files at once, just add their
names consecutively, separated by a space.

✓ There is no limit to the number of files removed at one time; however, the character limit
of a line is 255.

vfstab and vi 12-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Lab—vfstab and vi

Objectives
The purpose of this lab is to learn to:

■ Divide a disk drive into three partitions (“a,” “g,” and “h”).

■ Initialize all partitions using newfs.

■ Create three mount point directories in root.

■ Manually mount each of the new file systems.

■ Edit the /etc/vfstab file and add the new file system.

■ Reboot the system and verify the correct operation of


/etc/vfstab.

■ Undo all previous activity.

Tools and Equipment


To complete this lab, you will need:

■ One Sun SPARCstation, a pen or pencil, and this module,


“vfstab and vi.”
■ A spare disk drive on your system.

■ A “floater” disk drive available.

■ A system that can boot the operating system.

12-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Lab—Finding Your Practice Disk

Lab Exercise
1. Use the mount command to show all disks with mounted file
systems.

The output indicates that two


disk drives are in use; t3 and t1.

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - no rw,suid
/dev/dsk/c0t3d0s6 - /usr - - no rw,suid
swap - /tmp tmpfs - no rw
/dev/dsk/c0t1d0s5 - /opt ufs - no suid,rw

2. Record the “t” numbers from your mount command:

__________

__________

__________

__________

__________

Caution – These numbers represent disk drives that are in use. Avoid
! using these disks in the following lab exercises.

vfstab and vi 12-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Lab—Partitioning Your Practice Disk into Three Partitions

Important – During this lab do not repartition the system disks.


Refer to previous lecture material as needed.

1. Start up the format utility and select the spare disk.

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t3d0 <SUN0207 cyl 1254 alt 2 hd 9 sec 36>
/sbus@1,f8000000/esp@0,800000/sd@3,0
1. c0t1d0 <SUN0669 cyl 1614 alt 2 hd 15 sec 54>
/sbus@1,f8000000/esp@0,800000/sd@3,0
2. c0t2d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80> Select only
/sbus@1,f8000000/esp@0,800000/sd@2,0 a disk drive
Specify disk (enter its number): 2 that is not
in use

2. Select the Partition menu.

3. Print the partition listing of your practice disk.

4. Make Partition 0 equal to 20 Mbytes.

5. Make Partition 1 equal to 40 Mbytes.

6. Make Partition 3 the rest of the disk.

7. Zero partitions 4, 5, 6, and 7. Remember, don’t change Partition 2;


it represents the whole disk.

8. Check your values carefully.

9. Write the new label (partition> label).

10. Exit the Partition menu, and then exit the format utility.

Note – If you are having any problems, ask the Instructor for
assistance.

12-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Lab—Using newfs to Initialize the File Systems

Warning – Using newfs destroys any data so be careful to choose


your practice disk.

1. Run newfs on all three of your partitions (you must initialize each
partition separately).

# newfs /dev/rdsk/c0t2d0s0
newfs: construct a new file system /dev/rdsk/c0t2d0s0: (y/n)? y
/dev/rdsk/c0t2d0s0:28188 sectors in 87 cylinders of 9 tracks, 36 sectors
15.5MB in 3 cyl groups (16 c/g, 5.90MB/g, 2688 i/g)
super-block backups (for fsck -F ufs -o b= #) at:
32, 11632, 23232,

Choose your practice disk!


# newfs /dev/rdsk/c0t2d0s1
...

# newfs /dev/rdsk/c0t2d0s3
...

2. Make mount points for your three new file systems.

# mkdir /mnt1 /mnt2 /mnt3

vfstab and vi 12-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Lab—Editing the vfstab File With vi

To make the new partitions mount automatically at boot time, you


have to make three entries in the vfstab file in the /etc directory.

1. Change directory to the /etc directory by typing cd /etc.

2. Copy vfstab to vfstab.orig by typing


cp vfstab vfstab.orig.

3. Edit the vfstab file with the vi editor by typing vi vfstab.

4. Move the cursor to the last line of the file.

5. Open a new line by typing o. You are now in input mode.

6. Type in one line as shown below, press Return, and type the
second entry, press Return, and add the third entry.

#device device mount FS fsck mount mount


#to mount to fsck point type pass at boot options
#
/proc - /proc proc - no -
fd - /dev/fd fd - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6/usr ufs 2 no -
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7/home ufs 3 yes -
/dev/dsk/c0t3d0s5 /dev/rdsk/c0t3d0s5/opt ufs 6 yes -
/dev/dsk/c0t3d0s1 - - swap - no -
/dev/dsk/c0t2d0s0 /dev/rdsk/c0t2d0s0/mnt1 ufs 7 yes -
/dev/dek/c0t2d0s1 /dev/rdsk/c0t2d0s1/mnt2 ufs 8 yes -
/dev/dsk/c0t2d0s3 /dev/rdsk/c0t2d0s3/mnt3 ufs 9 yes -
~
~
~

Substitute your practice disk’s t number here.

12-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Lab—Editing the vfstab File With vi

7. What vi mode are you in? (circle one)

Input mode Command mode

8. Double check your entries! An incorrect entry in this file can


prevent your system from completely booting.

9. Save your new vfstab file as follows:

Press the Escape key (to enter command mode)

Type :wq (to write and quit)

vfstab and vi 12-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Lab—Testing the vfstab Entries

Verify that the vfstab changes work before re-booting your system
using the following procedure.

1. Use the mount command to verify current mounts.

# mount (This shows all currently mounted file systems.)

2. Did the new partitions you set up appear with the mount
command?

Yes ___ No ___

3. Use the mount command to mount any unmounted vfstab


entries.

# mountall

Note – The mountall command causes the system to mount


everything that is listed in the vfstab file.

4. Use the mount command to verify current mounts.

# mount (This shows all currently mounted file systems.)

5. Did the new partitions you set up appear with the mount
command?

Yes ___ No ___

12-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Lab—Testing the vfstab Entries

6. Reboot the operating system with the reboot command.

# reboot

7. Did the new partitions show up while the file system checks were
being done?

Yes ___ No ___

vfstab and vi 12-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

Lab—Finishing Up

You must undo everything you have done so far in this lab so the next
person will be able to complete this procedure.

1. Manually unmount your three new file systems.

# umount /mnt1
# umount /mnt1
# umount /mnt2

2. Use the vi editor to remove the three lines you added to vfstab in
/etc.

■ Use the H, J, K, and L keys to move the cursor.

■ Use the Escape key to exit Insert mode.

■ Press o to open a new line.

■ Press dd to delete an entire line from any point on the line.

■ Type a colon, to enter the write and quit commands (:wq).

3. Remove the mount points by typing:

# rm -r /mnt1 /mnt2 /mnt3

4. Reboot the system by typing:


# reboot

5. If the /etc/vfstab file has a problem, the system fails to boot


completely.

Note – If your system will not complete the boot operation, call your
instructor.

12-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1212 12

Lab—Creating a New File With vi (Optional)

Completing this optional exercise will give you more practice in vi.

■ Create a new file using the following material—name it


whatever you want.

RECIPE FOR A HAPPY DAY

1 cup of friendly words

2 heaping cups of understanding

4 heaping teaspoons of time and patience

1 pinch of warm personality

1 dash of humor

MEASURE WORDS CAREFULLY. ADD HEAPING

CUPS OF UNDERSTANDING: USE GENEROUS

AMOUNTS OF TIME AND PATIENCE. COOK WITH

GAS ON FRONT BURNER. KEEP TEMPERATURE

LOW; DO NOT BOIL. ADD DASH OF HUMOR AND

PINCH OF WARM PERSONALITY. SEASON TO

TASTE WITH SPICE OF LIFE.

This concludes the vstab and vi lab.

vfstab and vi 12-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
12

12-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Kernel Configuration 13

Objectives

Upon completion of this module, you will be able to:

■ Describe the relationship between the device directories and the


kernel.

■ Describe the relationship between loadable kernel modules and


autoconfiguration.

■ State at least one benefit of the autoconfiguration process.

■ Boot the system using the reconfigure option.

Evaluation

Complete the lab at the end of this module.

References

SunOS 5.1 Routine System Administration Guide, Chapter 13,


“Understanding the Boot Process”

SunOS 5.1 Administering Security, Performance, and Accounting,


Appendix A, “Tuning Kernel Parameters”

UNIX System Administration Handbook by Nemeth, Snyder, and Seebass


(Prentice Hall Inc., 1989)

13-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Kernel Connections

Let me see,
I will use the
mouse . . .

/dev/mouse

/devices/pseudo/consms:mouse

Device tables

KERNEL

Device driver:
pseudo-device ms # mouse support

13-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

■ A device driver for a device must be included in the kernel in


order for the Solaris software to recognize the device.
✓ When the kernel is generated, computer programs called device drivers must be included
in the kernel, which contain detailed information on how the system can communicate
with devices like disk drives, tape drives, and bus and network interfaces. Device drivers
have a standard interface to the kernel. Each driver has routines for performing certain
functions. Inside the kernel, the names of these functions are stored in device tables.

■ Solaris software communicates with hardware devices through


special types of files found in the /dev directory.

■ The files located in /dev refer to device names in the /devices


directory, which references device tables, which points to device
drivers.
✓ There are two device tables for Solaris software—the block device switch table (bdevsw)
and the character device switch table (cdevsw). The block device switch table contains
pointers to drivers for the devices using buffer caches, like disks. The character device
switch table contains pointers to all the devices using either character buffers or
unbuffered I/O, like tape drives and network interfaces.

When a program references a device file, the kernel automatically traps the reference,
looks up the appropriate function name in the table, and transfers control to it.

✓ In the example:
- the /dev directory has a device file called mouse
- the /dev/mouse file has pointers to the /device/pseudo/consms:mouse file.
- the /devices/pseudo/consms:mouse file has pointers to the device tables stored in
the memory resident kernel
- the device tables contain pointers to ms
- ms is the device driver for the mouse that was included in the kernel when it was
compiled

■ The kernel, which is generated at boot time, always resides in


memory while the machine is booted.
✓ When the system boots with the reconfigure option, the system matches the devices it
finds during a poll with a list of device drivers. These drivers are then loaded into memory
and into the new kernel for use at the next boot.

■ The name of the kernel is /kernel/unix.

Kernel Configuration 13-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Autoconfiguration Process

/kernel /usr/kernel

nfs module
streams module
ufs module
/kernel/unix
driver module
static core

Kernel modules Memory

13-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

■ The Solaris 2.x operating system kernel consists of a small static


core and a series of modules that are loaded on demand.
✓ A kernel module is a hardware or software component that is used to perform a specific
task within the system. An example of a loadable kernel module is a device driver that is
loaded when the device is accessed.

■ At boot time, the system does a self-test and checks for all devices
that are attached to it (as described in the previous lesson).
✓ The kernel then configures itself dynamically, loading its modules, as needed, into
memory. Then, a device driver is loaded when a device is accessed, such as the tape
device. This process is called autoconfiguration because all kernel modules are loaded
automatically when needed.

There are several benefits to the autoconfiguration process:

■ Modules are loaded when they are needed, resulting in a more


efficient use of main memory.
■ Time is not spent reconfiguring the kernel when new devices were
added to the system, as in previous SunOS operating system
releases.

■ Drivers can be loaded without having to rebuild the kernel and


reboot the system.
✓ System administrators use the autoconfiguration process when adding a new device (and
driver) to the system by using the boot -r command, which performs a reconfiguration
boot so that the system will recognize the new device. (The steps for this procedure are
described in later in this module.)

Kernel Configuration 13-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

The /kernel Directory

Default loadable kernel modules are found in the /kernel directory.

drv

exec

fs

kernel misc

sched

strmod

sys

unix

13-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

■ Each subdirectory contains a particular type of module.


✓ /kernel/drv – Contains device drivers and pseudo device drivers.

✓ /kernel/exec – Contains modules used to run various executable files.

✓ /kernel/fs – Contains file system modules such as ufs, nfs, and proc.

✓ /kernel/misc – Contains miscellaneous modules needed for virtual memory operation


and interprocess communication.

✓ /kernel/sched – Contains scheduling classes and corresponding dispatch tables


modules.

✓ /kernel/strmod – Contains STREAMS modules.

✓ /kernel/sys – Contains loadable system calls, such as those involved with semaphore
operation.

■ The /usr/kernel directory is also used to store loadable kernel


modules.
✓ This directory contains additional modules that are not needed to complete the boot
process, such as the system accounting module.

✓ Modules that can be shared across platforms, such as the audio driver.

✓ Both the /kernel and /usr/kernel directories are used to load modules during the boot
procedure.

■ If a module is not loaded at boot time, you can load it later when a
service is requested.

Kernel Configuration 13-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Reconfiguring Devices

To Reconfigure the Kernel

ok boot -rv

13-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

■ During a standard boot, the kernel matches existing devices


with the list of devices in the /devices directory.
✓ If a device is not in the list of devices in /devices, the kernel does not attach that device
to the system.

■ To reconfigure the kernel, boot the system using the


-rv options.
✓ The -r option forces the system to probe all devices and to regenerate the list of devices
in the /devices directory.

✓ The -v option is for verbose messages.

Kernel Configuration 13-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Displaying System Configuration With dmesg

# dmesg
Jul 13 23:59
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1993, Sun Microsystems, Inc.
mem = 24576K (0x1800000)
avail mem = 22458368
Ethernet address = 8:0:20:a:83:c2
root nexus = Sun 4_65
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd1 at esp0: target 1 lun 0
sd1 is /sbus@1,f8000000/esp@0,800000/sd@1,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd2 at esp0: target 2 lun 0
sd2 is /sbus@1,f8000000/esp@0,800000/sd@2,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
cgthree0 at sbus0: SBus slot 3 0x0 SBus level 5 sparc ipl 7
cgthree0 is /sbus@1,f8000000/cgthree@3,0
cgthree0: resolution 1152 x 900
dump on /dev/dsk/c0t3d0s1 size 40648K
Jul 13 21:01:49 sendmail[152]: network daemon starting
pseudo-device: vol0
vol0 is /pseudo/vol
fd0 at root: obio 0xf7200000 sparc ipl 11
fd0 is /fd@1,f7200000
st4 at esp0: target 4 lun 0
st4 is /sbus@1,f8000000/esp@0,800000/st@4,0
st4:<Archive QIC-150>
#

13-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

■ When the Solaris software boots, the kernel locates all existing
hardware devices and interfaces.
■ Unless you use the -v option at boot time, none of the device
configuration process is shown.

■ You can use the dmesg command to examine the boot


configuration information that is recorded in a system file named
/var/adm/msgbuf.

Kernel Configuration 13-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Displaying System Configuration With prtconfig


# prtconf
System Configuration: Sun Microsystems sun4c
Memory size: 32 Megabytes
System Peripherals (Software Nodes):
SUNW,SPARCstation-2
packages (driver not attached)
disk-label (driver not attached)
deblocker (driver not attached)
obp-tftp (driver not attached)
options, instance #0
aliases (driver not attached)
openprom (driver not attached)
sbus, instance #0
dma, instance #0
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1 (driver not attached)
sd, instance #2 (driver not attached)
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
sd, instance #6
le, instance #0
cgsix, instance #0
obio, instance #0
zs, instance #0
zs, instance #1
eeprom (driver not attached)
counter (driver not attached)
interrupt (driver not attached)
SUNW,fd, instance #0
auxio (driver not attached)
power (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
eccmemctl (driver not attached)
TI,TMS390Z50 (driver not attached)
pseudo, instance #0

13-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Notes

Command format: # prtconf

■ The prtconf command displays a system’s configuration


information, including memory and peripheral configurations.
✓ Note the use of device instance names to distinguish the possible devices that can be
connected to the same interface. For example, the devices connected to the SCSI bus
(SBus) are listed immediately underneath the sbus device listing.

✓ The disk and tape device instance names correspond to possible address locations on the
SCSI host adapter, which are called target addresses. Assigning target address locations
is how the system distinguishes different devices connected to the same interface.

✓ The driver not attached message means that no driver for that device is in use at the
time the prtconf command is issued, or there is no driver for that device instance.

Kernel Configuration 13-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Lab—Kernel Configuration

Overview

The purpose of this lab is to correctly:

■ Verify the kernel contents.

■ Reconfigure the kernel using the dmesg and prtconf commands.

■ Reset and boot up your system.

■ Describe the relationship between the device directory and the


kernel.

■ Define the reasons to configure a kernel.

■ Correctly create and boot up using the newly configured kernel.

Tools and Equipment

To complete this lab, you will need one Sun SPARCstations, a pen or
pencil, and this module, “Kernel Configuration.”

13-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Lab—Using dmesg to Verify the Kernel

Lab Exercise

1. Log into your system as root.

2. Halt your system by typing # halt.

Note – Although it is tedious and time-consuming to halt and boot the


system, doing so guarantees certain status commands to give you the
correct information.

3. Verify that all peripheral enclosures are powered on. If you find
any powered off, power them on.

4. Boot your system by typing >b -rv or ok boot -rv.

5. Log into your system as root.

6. Type in the command dmesg.

Kernel Configuration 13-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Lab—Using dmesg to Verify the Kernel

You should see an output similar to the following:

# dmesg

Jul 13 23:59
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1993, Sun Microsystems, Inc.
mem = 24576K (0x1800000)
avail mem = 22458368
Ethernet address = 8:0:20:a:83:c2
root nexus = Sun 4_65
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd1 at esp0: target 1 lun 0
sd1 is /sbus@1,f8000000/esp@0,800000/sd@1,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd2 at esp0: target 2 lun 0
sd2 is /sbus@1,f8000000/esp@0,800000/sd@2,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
cgthree0 at sbus0: SBus slot 3 0x0 SBus level 5 sparc ipl 7
cgthree0 is /sbus@1,f8000000/cgthree@3,0
cgthree0: resolution 1152 x 900
dump on /dev/dsk/c0t3d0s1 size 40648K
Jul 13 21:01:49 sendmail[152]: network daemon starting
pseudo-device: vol0
vol0 is /pseudo/vol
fd0 at root: obio 0xf7200000 sparc ipl 11
fd0 is /fd@1,f7200000
st4 at esp0: target 4 lun 0
st4 is /sbus@1,f8000000/esp@0,800000/st@4,0
st4:<Archive QIC-150>
#

13-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Lab—Using dmesg to Verify the Kernel

7. Verify that at least one of the following devices is listed in the


dmesg output (circle all appropriate devices):

sd6 st4 st5

Note – This output displays devices the system polled at boot time.

Kernel Configuration 13-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Lab—Using prtconf to Verify the Kernel

1. Type the command prtconf. You should see an output similar to


the following:

# prtconf
System Configuration: Sun Microsystems sun4c
Memory size: 24 Megabytes
System Peripherals (Software Nodes):

Sun 4_65
options, instance #0
zs, instance #0
zs, instance #1
fd, instance #0
audio (driver not attached)
sbus, instance #0
dma, instance #0
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1
sd, instance #2
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
sd, instance #6
st, instance #0 (driver not attached)
st, instance #1 (driver not attached)
st, instance #2 (driver not attached)
st, instance #3 (driver not attached)
st, instance #4
st, instance #5 (driver not attached)
st, instance #6 (driver not attached)
le (driver not attached)
cgthree, instance #0
auxiliary-io (driver not attached)
interrupt-enable (driver not attached)
memory-error (driver not attached)
counter-timer (driver not attached)
eeprom (driver not attached)
pseudo, instance #0
#

13-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Lab—Using prtconf to Verify the Kernel

2. Verify that at least one of the following is listed in the prtconf


output (circle all appropriate devices):

sd, instance #6 for sd6

st, instance #4 for st4

st, instance #5 for st5

Note – The prtconf command displays a system’s configuration


information, including memory and peripheral configurations. The
driver not attached message means that no driver for that device
is in use at the time the prtconf command is issued, or there is no
driver for that device.

3. Halt your system by typing # halt.

Kernel Configuration 13-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

Lab—Un-configuring Devices

1. Now power off all CD-ROMs and SCSI tape devices that are in
lunch boxes.

! Caution – Do not power off your disk drives!

2. Reset your system by typing ok reset.

3. Boot your system by typing >b -rv or ok boot -rv.

This action reconfigures the kernel.

4. Log into your system as root.

5. Using the dmesg command, compare the current listing with the
listing you did for the previous exercise.

a. Did anything change? Yes No

b. If so, why? ______________________________________________

________________________________________________________

6. Using the prtconf command, compare the current listing with the
one you did several pages back.

a. Did anything change? Yes No

b. If so, why? ______________________________________________

________________________________________________________

7. Halt your system by typing # halt.

13-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1313 13

Lab—Reconfiguring Devices

1. Now, power on all CD-ROMs and SCSI tape devices that are in
lunch boxes.

2. Reset your system by typing ok reset.

3. Boot your system by typing >b -rv or ok boot -rv.

4. Log into your system as root.

5. Using the dmesg command, compare the current listing with the
one you did in the previous exercise.

a. Did anything change? Yes No

b. If so, why? ______________________________________________

________________________________________________________

6. Using the prtconf command, compare the current listing with the
listing you did in the previous exercise.

a. Did anything change? Yes No

b. If so, why? ______________________________________________

________________________________________________________

c. How do these command outputs dmesg and prtconf compare


with the ones you saw at the beginning of this lab?
________________________________________________________

________________________________________________________

This concludes the Kernel Configuration lab.

Kernel Configuration 13-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
13

13-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Device Nodes 14

Objectives
Upon completion of this module, you will be able to:

■ Identify generic boot messages.

■ Identify device node listings.

■ Trace device node communication.

Evaluation
Complete the lab at end of this module.

References
UNIX System Administration Handbook by Nemeth, Snyder, and Seebass
(Prentice Hall Inc., 1989)

14-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

System Boot Sequence Overview

Reset Reset

Boot PROM POST

Boot PROM loads boot block from disk

Location of /ufsboot file

Boot block Boot block instructions load the /ufsboot program

/ufsboot /ufsboot loads /kernel/unix (the kernel)


program

The kernel performs the following:


Identifies itself (release, name, date)
Sizes memory
/kernel/unix Memory available
Probes NVRAM (Ethernet address, CPU type)
(the kernel) Checks for existing devices and attaches drivers
Identifies root, swap, dump
Starts up the /sbin/init Program

init program starts rc script files in /etc

Script files

Login

14-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ The system output during a boot operation is the result of


several distinctly different stages.
✓ Each stage is unique and can easily be identified with a little experience.

■ A general understanding is more important than knowing all of


the detailed steps in a maintenance environment.
✓ The step-by-step understanding is the result of time spent working in the field and
studying system files over a period of time.

■ The block diagram shows all of the major components that are
involved during a system boot.
✓ This lecture focuses on each of the general areas and explains them in more detail.

Device Nodes 14-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

POST, Banner, and Boot Device Selection

Resulting Output

Selftest Completed

SPARCstation IPX, Type-4 Keyboard


ROM Rev 2.3, 16MB Memory, Serial # 10879
Ethernet address 8:0:22:9:1D:4A, Host Id 57002A7F

Testing 16 Megabytes of memory \

Boot device: /sbus/esp@0,800000/sd@3,0

14-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ The boot PROM provides program instructions that execute a


series of power-on self-tests (POSTs).
✓ If no errors are detected during the POST diagnostics, booting is enabled, Boot PROM
device drivers are loaded, banner is displayed, and memory is tested.

■ The Banner is displayed on the output device specified in the


NVRAM.
✓ Amount of memory tested is read from NVRAM.

✓ Memory integrity is tested.

■ Default boot device is determined.


✓ The EEPROM or NVRAM is then interrogated to determine from which device to boot the
operating system.

Device Nodes 14-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Loading the Boot Block and /ufsboot Program

Boot Block Location

bootblk
Next 15 sectors

Boot program Boot block


/ufsboot

Disk label
first sector

Slice 0 (root)

14-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ The boot block is completely transparent to the user. You


cannot find any evidence of its existance.
■ Boot block loading is initiated.
✓ The boot block, bootblk, normally resides in Partition 0 but it can be placed in other
partitions although this is difficult to do and is only recommended for troubleshooting
purposes.

■ The primary purpose of the boot block is to identify the absolute


location of the /ufsboot program.
✓ The boot block contains a list of the absolute block numbers where the /ufsboot program
resides.

✓ This list is created by the installboot program during the boot block installation process.

■ The /ufsboot program is loaded into main memory.


✓ The primary purpose of the /ufsboot program is to locate and load /kernel/unix into
the main system memory.

Device Nodes 14-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

/kernel/unix Loading and Kernel Device Probing

Resulting Output (Boot with the -v flag)

Rebooting with command: -v

Boot device: /sbus/esp@0,800000/sd@3,0 File and args: -v


Size: 626692+119328+71840 Bytes
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1993, Sun Microsystems, Inc.
mem = 32768K (0x2000000)
avail mem = 30367744
Ethernet address = 8:0:20:10:e4:9a
root nexus = SUNW,Sun 4_75
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd0 at esp0: target 0 lun 0
sd0 is /sbus@1,f8000000/esp@0,800000/sd@0,0
<SUN1.G cyl 1965 alt 2 hd 17 sec 80>
sd3 t esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0424 cyl 1151 alt 2 hd 9 sec 80>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
configuring network interfaces:
le0 at sbus0: SBus slot 0 0xc00000 SBus level 4 sparc ipl 5
le0 is /sbus@1,f8000000/le@0,c00000
le0.
Hostname: kathmandu
dump on /dev/dsk/c0t3d0s1 size 65868K

14-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ The /ufsboot program locates the /kernel/unix (the kernel)


and begins loading.
✓ The /ufsboot program loads UNIX one block at a time.

■ The kernel first identifies the system type and available memory.
✓ The size: numbers are program information and represent the number of instructions
loaded, assigned data, and un-assigned data.

✓ They have nothing to do with the size of the UNIX file.

■ The kernel loads device drivers and probes for system devices.

■ The kernel must have been configured to expect certain devices.

■ There must also be an entry in the /dev directory for each device
expected.
✓ Each expected device must be enabled in the kernel configuration file when the kernel is
initially built.

✓ There must also be an entry for each device in the /devices directory. If the entries are
not there, the device will be seen during a boot but cannot be used.

✓ If an entry for a device is missing in the /dev or /devices directory, reboot with the -r
option.

✓ Only devices that are present in the /devices directory show additional information at
boot time.

✓ The only disks that are present in the example shown are:

- One SCSI disk drive (sd0)

Device Nodes 14-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Starting Up the Run Control (rc) Script File

Resulting Output

The system is coming up. Please wait.


checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast:add net 224.0.0.0: gateway sparc
Print services started.
volume management starting
syslog service starting.
The system is ready.
Pseudo-device: vol0
vol0 is /pseude/vol

sparc console login:

14-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ After the kernel probes the system for devices, a series of script
files are executed that start up additional system software that
may be required.
✓ All of the script files reside in the /etc directory.

Device Nodes 14-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Device Nodes and Kernel Connections

SunOS operating system

Command requiring
device access

/dev
Logical device pointers

/devices
Physical device pointers

Kernel

Device drivers
for the system

Device

Disk, tape

14-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

A device connection has four components:

■ Device access
✓ A device is a piece of hardware that performs a specific function.

■ Device drivers
✓ The operating system communicates to devices by way of device drivers, which are
program modules in the kernel.

■ Kernel
✓ The kernel is the master program of system software that manages all the physical
resources of a workstation.

■ Device files
✓ Users access hardware devices by using device files. A device file is a special type of file
that allows Solaris software programs to read from and write to devices.

✓ A character (or “raw”) device file is an interface for devices that transfer individual
characters rather than blocks of characters. Devices like terminals and printers use the
character device file interface.

✓ A block device file is an interface for devices that transfer blocks of characters. Disk and
CD-ROM devices use a block device interface.

✓ Both character and block disk device pointers are stored in the /dev directory.

- The character device files are stored in the /dev/rdsk subdirectory.

- The block device files are stored in the /dev/dsk subdirectory

✓ All device drivers are stored in the /devices directory.

Device Nodes 14-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Identifying Devices Names

There are three types of device names:

■ Logical device names

■ Physical device names

■ Instance names

14-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ Logical device names


✓ Logical device names are referenced when performing backups or accessing a disk
device. Logical names are located in the /dev directory.

■ Physical device names


✓ Physical device names are displayed when you issue the dmesg command. Physical device
names are created when the kernel finds the devices for the first time—when the system
is booted for the first time or when a new device is added to the system. Physical device
names are located in the /devices directory.

■ Instance names
✓ Instance names are abbreviations for the physical device names, and are also created
when the kernel identifies the device for the first time.

Device Nodes 14-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Logical Disk Device Names

Bus-Oriented Controllers

/dev/[r]dsk/cwtxdysz

Controller number
Target number
Disk number
Slice or partition number

Examples for Disk and Tape

# ls -l /dev/dsk/c0t3d0s0
/dev/dsk/c0t3d0s0 ->

/devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0:a

Disk

# ls -l /dev/rmt/0
/dev/rmt/0 ->

/devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/[email protected]

Tape

14-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

The logical disk device name is specified by system administrators and


users when using disk and file system-related commands.

Bus-Oriented Controllers
Sun systems use the following naming convention to describe the
logical device name for a disk device connected to a bus-oriented
controller (SCSI and IPI):
✓ Logical device names are located in the /dev directory and are symbolically linked to their
corresponding physical device names in the /devices directory.

■ Controller number
✓ Controller (or interface) numbers, such as c0, c1, and c3, are automatically assigned in
sequential order to each interface card.

✓ If your system has a built-in SCSI interface, the operating system automatically assigns a
0 (zero) to that card. Therefore, any disk drive that is connected to the built-in SCSI card
will have a device address that starts with c0. Controller number c1 would correspond to
a second SCSI host adapter (or esp@1) which is explained under the Physical Disk Device
Names Review section of this lesson.

■ Target address
✓ Target addresses such as t0, t1, and t3 correspond to the address switch setting that is
selected for each device. An external disk drive has an address switch located on the rear
panel.

■ Disk number
✓ The disk number is always set to d0 for any embedded SCSI device or IPI disk.

■ Slice (partition) number


✓ Slice numbers range from 0 to 7. To specify an entire disk, use slice 2.

✓ Disk devices are accessed by their logical device names, and this name must include the
slice number. Disks cannot be accessed by just their controller/disk/target
designation.

✓ Note the contents of the /dev/dsk directory contains the logical device names of the
system’s disk devices and partitions.

Direct Controllers

✓ Disks connected to direct (or non-bus oriented) controllers such as the Xylogics™ 451 or
7053, do not have a target number in their logical device name.

Device Nodes 14-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Device Information Tree

■ Example of SPARCstation 2 device information tree:

SS2

sbus obio

cgsix le0 audio fd zs0 zs1


esp

sd0 sd1

14-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ When the system is booted, a device hierarchy (or tree


structure) is created that represents all devices attached to the
system.
✓ For example, a SPARCstation 2 can have the device information tree structure. (Not all
devices are included in the diagram.)

■ Each box in the diagram represents a different device on the


system.
✓ For example, the cgsix object represents the cgsix color frame buffer and the sbus object
represents the peripheral bus that is used to connect many other devices to the system.

■ The topmost object in the hierarchy is called the root node of the
device information tree.
✓ An intermediate object below the root node has a device driver associated with it, and is
called a leaf or bus nexus node.

✓ The kernel uses the information in this device tree to associate drivers with their
appropriate devices, and provides a set of pointers to the nodes (or drivers) that perform
specific operations.

Device Nodes 14-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Physical Device Names

■ Example of SPARCstation 2 physical device name:

/devices/sbus@1,.../esp@0,.../sd@3,0:a

First SBus controller


First SCSI host adapter
SCSI target address
SCSI lun (logical unit number)
Partition or slice

14-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ A physical device name represents the full device path name in


the device information hierarchy (or tree) as described
previously.
✓ Physical device files are found in the /devices directory and correspond to the device
names used at the PROM level.

✓ The ellipses (...) represent the virtual memory address of the corresponding device.

✓ The above example describes the first SCSI disk (target address 3) connected to the first
SCSI host adapter.

Device Nodes 14-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Instance Device Names

Examples of Instance Names


■ sdn—Where s=SCSI, d=disk, n=logical disk number, such as
sd0, for the first SCSI disk device.

■ stn—Where s=SCSI, t=tape, n=logical tape number, such as


st0, for the first SCSI tape device.

14-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

■ An instance disk device name is the kernel’s abbreviation for the


physical device name.
✓ An instance name is the kernel’s abbreviation for the physical device name. Instance
names are allocated when the kernel finds an instance of a device for the first time.

✓ In the Solaris 2.x computing environment, the instance name is bound to the physical
name by references in the /etc/path_to_inst file.

Device Nodes 14-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Displaying System Configuration—prtconf


# prtconf
System Configuration: Sun Microsystems sun4c
Memory size: 32 Megabytes
System Peripherals (Software Nodes):
SUNW,SPARCstation-2
packages (driver not attached)
disk-label (driver not attached)
deblocker (driver not attached)
obp-tftp (driver not attached)
options, instance #0
aliases (driver not attached)
openprom (driver not attached)
sbus, instance #0
dma, instance #0
esp, instance #0
sd (driver not attached)
st (driver not attached)
sd, instance #0 (driver not attached)
sd, instance #1 (driver not attached)
sd, instance #2 (driver not attached)
sd, instance #3
sd, instance #4 (driver not attached)
sd, instance #5 (driver not attached)
sd, instance #6
le, instance #0
cgsix, instance #0
obio, instance #0
zs, instance #0
zs, instance #1
eeprom (driver not attached)
counter (driver not attached)
interrupt (driver not attached)
SUNW,fd, instance #0
auxio (driver not attached)
power (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
eccmemctl (driver not attached)
TI,TMS390Z50 (driver not attached)
pseudo, instance #0

14-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

Command format:

# prtconf

■ The prtconf command displays a system’s configuration


information, including memory and peripheral configurations.
✓ Note the use of device instance names to distinguish the possible devices that can be
connected to the same interface. For example, the devices connected to the SCSI bus
(SBus) are listed immediately underneath the Sbus device listing.

✓ The disk and tape device instance names correspond to possible address locations on the
SCSI host adapter, which are called target addresses. Assigning target address locations
is how the system distinguishes different devices connected to the same interface.

✓ The driver not attached message means that no driver for that device is in use at the time
the prtconf command is issued, or there is no driver for that device instance.

Device Nodes 14-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Putting It All Together


# dmesg | more
SunOS Release 5.2 Version [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1992, Sun Microsystems, Inc.
mem = 32768K (0x2000000)
avail mem = 31002624
Ethernet address = 8:0:20:8:4:69
root nexus = Sun 4_60
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd1 at esp0: target 1 lun 0
sd1 is /sbus@1,f8000000/esp@0,800000/sd@1,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<CD-ROM Disc for SunOS Solaris_2.1 Installation >

Controller ID [c0]
Target ID [t3] Logical name
Disk ID [d0]

sd3 at esp0: target 3 lun 0


sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>

Instance name Physical name

14-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

Command format: # dmesg

■ The dmesg command identifies the devices connected to the


system using the instance names and physical device names.
✓ The dmesg command displays system diagnostic messages that can include information
about the devices attached to the system. It also displays the operating system revision
number, physical memory size, and other information.

■ An instance name is the kernel’s abbreviation for the physical


device name.
✓ Instance names are allocated when the kernel finds an instance of a device for the first
time. The kernel uses these names to identify every possible device instance on the
system.

■ Device instance names are displayed in the dmesg output to the


left of the physical device name.
✓ In the above example, the three lines of output for each disk device identify the following
disk information:

- The disk’s instance name (Ex. sd3)

- The disk’s physical device name (Ex. /sbus.../esp.../sd@3,0)

- The disk’s logical device name is implied (Ex. esp0 [c0] target 3 [t3] lun 0
[d0] = c0t3d0).

- The disk’s marketing name and details about the disk’s geometry.

✓ The Solaris 2.2 software dmesg command is okay to use to display device information
unless the sendmail daemon is active. In that case, the output displays sendmail
daemon messages and has no device information to display.

Device Nodes 14-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Device Nodes—System Names

[mount -p]
# cd /data2/list /dev/dsk/c0t2d0s6 - /data2 ufs - no suid rw

lrwxrwxrwx 1 root root 51 Jun 30 00:12 /dev/dsk/c0t2d0s6


-> ../../devices/sbus@1,f8000000/esp@0,800000/sd@2,0:g

brw-r----- 1 root sys 32, 24 Jun 29 23:32


/devices/sbus@1,f8000000/esp@0,800000/sd@2,0:g

Kernel—device drivers for the system

c0t2d0
s0
s1
s3
s4 superblock, cylinder group(s), inode tables
s5 and inodes for file system sd2g [data2]
s6
s7

# pwd
/data2/list

14-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Notes

The following system procedure tracks the device node


communication between the superblock(s), the cylinder group(s), the
inode table(s), and the inode.

Assuming that /dev/dsk/c0t2d0s6 is mounted at /data2:

1. The system examines the mount table and finds that /data2 is
located at /dev/dsk/c0t2d0s6.

2. The system examines the /dev directory and finds that


/dev/dsk/c0t2d0s6 is linked to
/devices/sbus@1,f8000000/esp@0,800000/sd@2,0:g.

3. The system examines the /dev directory and finds that


/devices/sbus@1,f8000000/esp@0,800000/sd@3,0:a has the
device driver identifiers of 32, 24.

4. The kernel interprets the 32 as a SCSI disk block device and


assigns the proper driver component in kernel memory.

5. The number 24 tells the driver that the particular device is the first
partition (a), on the third possible SCSI disk (sd2).

6. /devices/sbus@1,f8000000/esp@0,800000/sd@2,0:g
is a block device, so there is a superblock in memory for /data2.

7. The system then uses the file system background structures to


identify the exact location the user initially specified,
/data2/list, and gives you a system prompt.
✓ Review: These structures are the superblock(s), the cylinder group(s), the inode table(s)
and the inode.

8. When you execute the pwd command, the desired directory path is
given.

Device Nodes 14-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Lab—Device Nodes

Overview

The purpose of this lab is to:

■ Verify the presence of devices.

■ Examine some device related errors.

■ Examine device links.

■ Use physical device names.

Note – For the purpose of this lab, manipulate only the tape drive
entries.

Tools and Equipment

To complete this lab, you will need:

■ One Sun SPARCstation running Solaris software, a pen or


pencil and this module, “Device Nodes.”
■ A tape drive and a blank (scratch) tape.

14-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Lab—Using dmesg to Identify Your Tape Drive

Lab Exercise

1. Log into the system as superuser.

2. Insert a blank tape into the tape drive.

3. Type in the following command: # dmesg

Note – dmesg shows you which devices that the kernel communicated
with are available at boot time.

The dmesg output should look something like this:

SunOS Release 5.2 Version [UNIX(R) System V Release 4.0]


Copyright (c) 1983-1992, Sun Microsystems, Inc.
mem = 32768K (0x2000000)
avail mem = 31002624
Ethernet address = 8:0:20:8:4:69
root nexus = Sun 4_60
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd1 at esp0: target 1 lun 0
sd1 is /sbus@1,f8000000/esp@0,800000/sd@1,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<Quantum ProDrive 105S cyl 974 alt 2 hd 6 sec 35>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<CD-ROM Disc for SunOS Solaris_2.1 Installation >

4. Which tape drive is it? (best guess)

st4 st5

Device Nodes 14-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Lab—Verifying Your Tape Drive With the mt Command

The mt status command requests a status message from the specified


/dev/rmt/tape_drive entry. Use man mt for more information.

1. Verify the tape drive you inserted the tape into by typing the
following: (st4 is /dev/rmt/0 and st5 is /dev/rmt/1)

# mt -f /dev/rmt/0 status (substitute your tape drive


number)

2. There are four possible responses for this command:

[Device Name] tape drive:


sense key(0x2)= not ready residual= 0 retries= 0
file no= 0 block no= 0

This response implies that the device link, device node, device
driver, and a tape drive with a tape loaded all communicate.

/dev/rmt/X: no tape loaded or drive off-line

This response implies that the device link, device node, device
driver, and a tape drive without a tape loaded all communicated
or that there is no tape drive available.

/dev/rmt/X: No such device or address

This response implies that only the device link and device node
were available; no device driver was available in kernel memory.

/dev/rmt/X: No such file or directory

This response implies that no device link was available in /dev.

14-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Lab—Device Links

1. Now that we know which tape drive we are using, let’s look at the
various tape device links.

2. Enter the following commands to move to the tape device


directory:
#cd /dev/rmt
#ls -l

You should see something like this:

lrwxrwxrwx 1 root root 50 Jun 5 15:03 0 ->


../../devices/sbus@1,f8000000/esp@0,800000/st@4,0:
lrwxrwxrwx 1 root root 51 Jun 5 15:03 0b ->
../../devices/sbus@1,f8000000/esp@0,800000/st@4,0:b
lrwxrwxrwx 1 root root 52 Jun 5 15:03 0bn ->
../../devices/sbus@1,f8000000/esp@0,800000/st@4,0:bn
lrwxrwxrwx 1 root root 51 Jun 5 15:03 0c ->
../../devices/sbus@1,f8000000/esp@0,800000/st@4,0:c

3. Remove the device links for all tape units:

#rm /dev/rmt/*

4. Now look for any st devices.

#ls -l

5. Compare the listing in step 4 with the listing in step 2.

6. What’s missing? _____________________________

_________________________________________

Device Nodes 14-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Lab—Device Links

7. Verify if deleting the st device links affect their operation by


typing the following:

# mt -f /dev/rmt/0 status

8. What was the output from the mt command.

________________________________________________________

________________________________________________________

________________________________________________________

9. Does this indicate the /dev entry is communicating with the


device driver in kernel memory? ________ (Refer to page 14–32.)

Why? __________________________________________________

________________________________________________________

________________________________________________________

10. Use the prtconf command. Does it show that the device drivers
are loaded for st4? Yes No

11. To re-create the device links for tape drive st4, type:

# halt

ok boot -rv

12. Login as root and cd to /dev/rmt.

13. List the directory. Are all of the device links back? Yes No

14-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Lab—Physical Device Names

1. Where does 0 (zero) link up? (Hint – ls -l 0 (zero))

2. What st device does 0 (zero) link with?


/devices/sbus@1,f8000000/esp@0,800000/st@__,0

3. Change directories to where the link points to.

(Should be /devices/sbus@1,f8000000/esp@0,800000)

4. Now that you know which tape drive you are using, type the
following to look at the various tape device nodes:

# ls -l *st*

Your response should look something like this:

crw-rw-rw- 1 root sys 33,136 Jun 5 15:02 st@4,0:


crw-rw-rw- 1 root sys 33,200 Jun 5 15:02 st@4,0:b
crw-rw-rw- 1 root sys 33,204 Jun 5 15:02 st@4,0:bn
crw-rw-rw- 1 root sys 33,152 Jun 5 15:02 st@4,0:c
crw-rw-rw- 1 root sys 33,216 Jun 5 15:02 st@4,0:cb

5. Remove the device nodes for all tape units by typing:

# rm *st*

6. Now look for any st devices by typing:

# ls -l *st*

7. Compare the listing in Step 4 with the listing in Step 6.

What’s missing? _________________________________________

Device Nodes 14-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

Lab—Physical Device Names

8. Verify whether deleting the st device nodes affects their operation


by typing the following:

# mt -f /dev/rmt/0 status

a. What was the output from the mt command?

________________________________________________________

________________________________________________________

________________________________________________________

b. Does this indicate the /devices entry is communicating with


the device driver in kernel memory? _______ (Refer to page 14–
32.)

c. Why? __________________________________________________

________________________________________________________

________________________________________________________

9. Use the prtconf command. Does it show that the device drivers
are loaded for st4? Yes No

10. To re-create the device nodes for tape drive st4, type:

# halt

ok boot -rv

11. Log in as root and cd to /dev/rmt.

12. List the directory with ls -l.

Are all of the device links back? Yes No

14-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1414 14

Lab—Physical Device Names

13. If you booted the system with certain devices powered off, what
would the prtconf file tell you about the device drivers?

________________________________________________________

________________________________________________________

________________________________________________________

14. Remove the tape and return it to its protective case.

This concludes the Device Nodes lab.

Device Nodes 14-37

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
14

14-38 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Run Control (rc) Scripts 15

Objectives
Upon completion of this module, you will be able to:

■ Describe the function of the rc scripts in the boot up process.

■ Correctly execute system interrupt and shutdown commands.

■ Correctly recover from an aborted system using the Monitor


program and the Forth Toolkit.

Evaluation
Complete the lab at the end of this module.

References
SunOS Reference Manual, Part Number 800-3827-10

15-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

System Startup

Resulting Output
ok boot -v

Rebooting with command: -v


Boot device: /sbus/esp@0,800000/sd@3,0 File and args: -v
Size: 618912+118756+45904 Bytes
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1992, Sun Microsystems, Inc.
mem = 16384K (0x1000000)
avail mem = 14077952
Ethernet address = 8:0:20:c:10:d3
root nexus = SUNW,Sun 4_50
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
swap on swapfs fstype swapfs size 13420K
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
Hostname: SUNIPX
dump on /dev/dsk/c0t3d0s1 size 32872K

*** init starts ***

15-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

Review of Initial System Start Up


The system startup procedure is as follows:

1. After power-up or system reset, POST runs.

2. When POST completes, the boot configuration from the NVRAM


is read and directs the system to read a specific driver from the
boot PROM.

3. The boot PROM directs the system to the location of the boot
blocks.

4. The boot blocks call in the boot file /ufsboot for sd0a.

5. The boot file calls in the kernel /kernel/unix for sd0a.

6. The kernel is loaded and known devices are polled.

7. Existing devices are attached to the system.

8. The kernel then describes the location of the root file system, the
swap partition, and the dump device.
✓ The first process started is the swapper, which handles the transactions between RAM
and swap.

9. The init process begins as soon as the dump device is described.


✓ init (/sbin/init) is the base process that UNIX relies on to start up; /sbin/init goes
into the background to run continuously while the system is up. /sbin/init is the
system’s initialization script that starts the rc scripts. init’s role is so critical that if it
dies, the system reboots itself automatically. If, at bootstrap time, the init program
cannot be located, the system prints an error message.

Run Control (rc) Scripts 15-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Starting Up the rc Script File

Resulting output (normal error-free output):

The system is coming up. Please wait.


checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast: add net 224.0.0.0: gateway
sparc
Print services started.
volume management starting
syslog service starting.
The system is ready.
Pseudo-device: vol0
vol0 is /pseude/vol

sparc console login:

15-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ A series of script files is executed that starts up any additional


system software that may be required.
■ For certain option boards, device drivers and/or microcode are
downloaded into memory.

■ The various boot messages are output by the script files.

■ A series of script files in the /sbin directory is executed that starts


up any additional system software that may be required.

Script files:

rc0 rc5

rc1 rc6

rc2 rcS

rc3

Run Control (rc) Scripts 15-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

System Boot Procedure

The /sbin/init Phase


The /sbin/init program has two main roles:

■ Create processes, which brings the system up to the default run


level.
■ Control transitions between run states by re-reading the
/etc/inittab file.

15-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

The /sbin/init Phase


■ The kernel creates a user process and starts the /sbin/init
program. The /sbin/init program starts processes by using
information in the /etc/inittab file.
■ The init process executes an rc script, or scripts, that executes a
series of other scripts.

■ These rc scripts in /sbin perform the following functions:

■ Check file systems

■ Mount file systems

■ Start various processes

■ Perform housekeeping tasks

Run Control (rc) Scripts 15-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

System Operation Levels

■ There are eight levels of system operation in the Solaris 2.x


computing environment, five of which are covered in this
lesson:

Reboot 6
Interactive reboot 5
Unused 4
Full multiuser mode 3
Multiuser mode without resources 2
Single-user mode S, s
Single-user mode without /export/home 1
Power-down mode 0

15-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

Run Level 3
Run level 3 is also known as full multiuser mode.
✓ It is a system’s default run level, which is the default state of the system.

✓ All system processes are running, file resources are available for mounting (if the
machine is a server), and users can log in.

Run Level 2
Run level 2 is a multiuser mode without remote resources available.
✓ All daemons are running except for remote file-sharing daemons.

Run Level s, S
Run level S is single-user mode.
✓ Run level S is a special level where:

- The operating system is running, but all users are logged out, and most system
processes, such as print and mail, are not running.

- Only one user (the superuser) is logged into the system.

✓ Run level S is convenient for doing backups, because all data is stable since no users are
logged in.

✓ The system is brought to run level S with the shutdown command.

✓ Run level 1 is different in Solaris 2.2 software. It is exactly the same as run level S, except
that /export/home is not mounted.

Run Level 0
Run level 0 shuts down the system so that it is safe to turn off the
power.

Run Level 6
Run level 6 is used to halt the system to run level 0 and then reboot it
to run level 3.

Run Control (rc) Scripts 15-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

The Run Control Scripts

Boot Sequence

/etc/inittab initdefault

/sbin/autopush

/sbin/rcS /etc/rcS.d/S*

/sbin/rc2 /etc/rc2.d/K*,S

/sbin/rc3 /etc/rc3.d/K*,S*

/usr/lib/saf/sac

/usr/lib/saf/ttymon

15-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

The boot sequence is as follows:

1. The init process looks in the inittab file for the initdefault
entry, which is set to run level 3.

2. The init process executes the commands (or scripts) for entries
that have sysinit in the action fields, such as /sbin/autopush
and /sbin/rcS.

Then, it executes the scripts for any entry that has a 3 in the
rstate field, such as the /sbin/rc2, /sbin/rc3,
/usr/lib/saf/sac, and /usr/lib/saf/ttymon executables.
✓ The sac and ttymon processes are used to provide login services for the console and
other TTY devices.

3. The /sbin/rc2 and /sbin/rc3 scripts invoke scripts under the


/etc/rc2.d and /etc/rc3.d directories, respectively, that
begin with the letters K and S.

Run Control (rc) Scripts 15-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Run Control Script File Locations

rcS

rc0

rc1

/sbin rc2

rc3 rcS

rc5 rcS.d

rc6 rc0

rc0.d

rc1

rc1.d
/etc
rc2

rc2.d

rc3 S15nfs.server

rc3.d
S21rfs
rc5

rc6 nfs.server

init.d rfs

15-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ The run control, or “rc” scripts, are contained in the /sbin


directory, with symbolic links in the /etc directory.
■ The run control files that are used to start up or kill specific
processes are actually stored in the /etc/init.d directory, with
hard links in the /etc/rc*.d directories.

■ The advantage of having the actual run control files in the


/etc/init.d directory is that you can start and stop individual
services or processes without changing run levels.

Run Control (rc) Scripts 15-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Run Control Script Summary

The following table summarizes the purpose of each rc script:

Script name Purpose


/sbin/rcS Sets up minimal network plumbing for diskless/dataless client
support, and check and mount / (root) and /usr file systems
during all run level changes. Device entries are created, if
necessary.
/sbin/rc0 Brings the system down to the PROM level. System services
and all running processes are stopped. All file systems are
unmounted.
/sbin/rc1 Brings the system down to run level 1. All system services and
daemons and running processes are stopped. Most file systems
are unmounted except / (root), /usr, /proc, and /dev/fd.
/sbin/rc2 Brings the system to run level 2—multiuser state. All file
systems are mounted and all network services are configured
except for sharing file systems.
/sbin/rc3 Brings the system to run level 3—multiuser state with shared
file resources. The syslogd daemon is started, and nfs and
rfs server process are started.
/sbin/rc5 Halts the machine and performs an interactive boot. All system
processes and services are stopped and all file systems are
unmounted.
/sbin/rc6 Halts and reboots the system. The /etc/rc0.d/K* scripts are
executed. All system services and processes are stopped and all
file systems are unmounted. Then the initdefault entry in
/etc/inittab is executed.

15-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

Run Control (rc) Scripts 15-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Single-User Versus Multiuser

Single-User

root fs /dev/dsk/c0t3d0s0

usr fs
/dev/dsk/c0t3d0s6

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - no rw
/dev/dsk/c0t3d0s6 - /usr ufs - no rw
/proc - /proc proc - no rw
fd - /dev/fd fd - no rw
swap - /tmp tmpfs - no rw

Multiuser

root fs /dev/dsk/c0t3d0s0

usr fs other fs another fs home fs


c0t3d0s6 c0t3d0s4 c0t3d0s7
c0t3d0s5

# mount -p
/dev/dsk/c0t3d0s0 - / ufs - - no rw
/dev/dsk/c0t3d0s6 - /usr ufs - no rw
/proc - /proc proc - no rw
fd - /dev/fd fd - no rw
swap - /tmp tmpfs - no rw
/dev/dsk/c0t3d0s4 - /home ufs - no rw
/dev/dsk/c0t3d0s5 - /usr2 ufs - no rw

15-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ All Sun computers have two booting levels.


✓ There are two levels of booting to allow certain administrative and maintenance functions
to be performed while the operating system is quiet.

■ Root is presumed to be using the system when the system is at


single-user level.
✓ To accomplish the various administrative and maintenance functions, a powerful user,
root, must be able to have access. Directories and files owned by the system may need
work and the only user able to do this is root.

✓ By default, no password is asked for when going to single-user.

■ The root (/) and superuser (/usr) file systems are mounted at
single-user level.
✓ The other file systems are not automatically mounted at single-user. File systems are
easier to work on when they are not mounted and no activity is taking place on them, this
is the reason for all file systems being unmounted except / and /usr.

✓ All commands and utilities that only require the / and /usr file systems are available.

■ All file systems are mounted and ready for use at multiuser level.
✓ Any authorized user can log onto the machine when it is at multiuser level.

■ The single-user environment is a complete SunOS computing


environment without most of the processes thatrun in the
multiuser environment.
✓ These are the processes that are started in the rc scripts.

✓ Environments that are not available include networking and OpenWindows.

■ The vi text editor is functional in single-user; however, the arrow


keys are not defined and the editor cannot enter a full page mode.
✓ Not having full page mode means that the vi editor can only display one line of the file at
a time. However, this doesn’t inhibit any of the vi features.

Run Control (rc) Scripts 15-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Booting Single-User

Using the Monitor Programs


> b -s

or . . .

Type b (boot), c (continue), or n (new command mode)


> b -s

Using the Forth Toolkit

ok boot -s

15-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ Booting to single-user mode is a manual boot PROM command.

■ The boot command by default boots the system to multiuser.

■ The -s is the universal option for the boot command that forces
the system to boot in single-user mode.
✓ Example: ‘>b -s’ is equivalent to ‘ok boot -s.’

✓ The init process reads the -s and puts the system in single-user mode.

Run Control (rc) Scripts 15-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Single-User Bootup Flow

Resulting Output

ok boot -sv
Rebooting with command: -sv
Boot device: /sbus/esp@0,800000/sd@3,0 File and args: -sv
Size: 618912+118756+45904 Bytes
SunOS Release 5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1992, Sun Microsystems, Inc.
mem = 16384K (0x1000000)
avail mem = 14077952
Ethernet address = 8:0:20:c:10:d3
root nexus = SUNW,Sun 4_50
sbus0 at root: obio 0xf8000000
dma0 at sbus0: SBus slot 0 0x400000
esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 sparc ipl 3
sd3 at esp0: target 3 lun 0
sd3 is /sbus@1,f8000000/esp@0,800000/sd@3,0
<SUN0207 cyl 1254 alt 2 hd 9 sec 36>
sd6 at esp0: target 6 lun 0
sd6 is /sbus@1,f8000000/esp@0,800000/sd@6,0
<>
root on /sbus@1,f8000000/esp@0,800000/sd@3,0:a fstype ufs
swap on swapfs fstype swapfs size 13420K
zs0 at root: obio 0xf1000000 sparc ipl 12
zs0 is /zs@1,f1000000
zs1 at root: obio 0xf0000000 sparc ipl 12
zs1 is /zs@1,f0000000
Hostname: SUNIPX
dump on /dev/dsk/c0t3d0s1 size 32872K
INIT: Single user mode
Type ctrl-d to proceed with normal startup
(or give root password for system maintenance): <cr>
Entering system maintenance mode
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]

15-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ Initially, a single-user boot looks like a multiuser boot.


✓ This includes the boot blocks, the kernel load, and the kernel device pollint.

■ fsck runs to check the file systems for internal consistency.


✓ Typically, the inconsistencies discovered by fsck are harmless enough that the system
can come up eventually without intervention.

■ The /sbin/init looks to see if the -s option was used in the boot
command.

■ If the -s option was not used, the system boots to multiuser.


✓ Only the root and usr file system are checked.

✓ The loadkeys function determines the correct function of such keys as the: Shift, Caps
Lock, Control, and Num Lock, among others.

✓ The single-user environment uses the ‘#’ prompt.

Run Control (rc) Scripts 15-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Changing from Single-User to Multiuser

Resulting Output

#
# exit
INIT: New run level: 3
The system is coming up. Please wait.
checking filesystems
/dev/rdsk/c0t3d0s5: is clean.
/dev/rdsk/c0t3d0s7: is clean.
/dev/dsk/c0t3d0s7 mounted
/dev/dsk/c0t3d0s5 mounted
starting routing daemon.
starting rpc services: rpcbind keyserv kerbd done.
Setting default interface for multicast: add net 224.0.0.0: gateway
sparc
Print services started.
volume management starting
syslog service starting.
The system is ready.
Pseudo-device: vol0
vol0 is /pseude/vol

sparc console login:

15-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ To change from single-user to multiuser mode, type exit at


the single-user prompt (#).
✓ Control-d (^d) also works.

■ This action takes the system out of single-user and continues


booting to multiuser.
✓ By exiting single-user, the system initiates the /sbin/rc scripts.

■ This totally bypasses any remaining file systems left to be checked


by fsck.
✓ It is presumed that by entering single-user the remaining file systems were checked
manually (fsck’device name’).

✓ Always run fsck manually on all remaining file system prior to exiting single-user.

✓ The halt and reboot commands are available if needed.

Run Control (rc) Scripts 15-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Changing from Multiuser to Single-User

Resulting Output

# shutdown

Shutdown started. Thu Jul 29 21:39:29 PDT 1993


Broadcast Message from root (console) on sparc Thu Jul 29 21:39:31
THE SYSTEM IS BEING SHUT DOWN NOW!!!
Log off now or risk you files being damaged.

Do you want to continue? (y or n): y

The system is coming down...


The system is down
Changing to init state s - please wait
#
#
INIT: New run level: S
INIT: SINGLE USER MODE

Type ctrl-d to proceed with normal startup


(or give root password for system maintenance): <cr>
Entering system maintenance mode
SunOS Release 5.2 Version Generic [UNIX(R) System V Release 4.0]

15-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

To change the system to single-user mode from multiuser, use the


shutdown command.

Command format:

# shutdown
✓ The characteristics of the shutdown command are:

- It brings the system to run level S by default.

- It notifies logged-in users and hosts mounting remote resources with a warning
message to logout. It also sends a final message that a shutdown is coming.
- It asks for confirmation before it starts shutting the system down, unless the -y option
is used.

✓ shutdown signifies an immediate shutdown—no delay.

■ To leave single user, type in exit, then answer 0 (PROM level),


3 (multiuser) or 6 (reboot to multiuser) to the
“ENTER RUN LEVEL (0-6, s of S):” question.
✓ Note – Do not use the shutdown command to change from run level S to run level 0.
Instead, press Control-d, type 0, and press Return.

■ To cancel the shutdown command, answer no (N) to the


continue? question. The following message is returned:

Do you want to continue? (y or n): N


Broadcast Message from root (console) on sparc Thu Jul 29 21:39:31
False Alarm: The system will not be brought down.
Shut down aborted;
#

Run Control (rc) Scripts 15-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Stopping the Processor

■ To halt the processor with auto-sync of the superblock, type

# halt

■ To reboot the processor with auto-sync of the superblock, type

# reboot

■ To manually run the sync command, type

# sync

■ To sync the file systems after a system crash, type

ok sync

■ To sync the file systems after a L1-A [Stop-A], type

ok sync

15-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ The commands halt and reboot automatically synchronize the


superblocks.
✓ halt puts the system at the PROM level while reboot reboots the system to multiuser.

✓ You must be logged in as root to execute these commands.

■ Any user can synchronize the superblocks when logged in by


typing sync at the system prompt.

■ While booted, if the system crashes or the keys “Stop-A” are used,
you can synchronize the superblock from the PROM level.
✓ This only works if the operating system was booted.

✓ On ASCII terminals the break key is used.

✓ For VME systems the command is:


> g0

✓ For all other system the command is:


ok sync

■ If synchronizing is done at the PROM level, the system reboots


automatically.

Run Control (rc) Scripts 15-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Aborting the Processor

To abort the processor, use the L1-A key sequence.

Stop A
+
L1

To continue after an abort, use the following command sequence:

■ Uniprocessor desksides/datacenters

Abort at PC 0xFFE9585C
> c <<cr>><<cr>>

■ Desktops and multiprocessor system


Type b (boot), c (continue), or n (new command mode)
> c <<cr>><<cr>>
or
Type ’go’ to resume
Type help for more information
ok go <<cr>><<cr>>

To sync the superblock and avoid corruption after an abort, use the
following commands:

■ Uniprocessor desksides/datacenters
Abort at PC 0xFFE9585C
> g0

■ Desktops and multiprocessor systems


Type ’go’ to resume
Type help for more information
ok sync <<cr>><<cr>>

15-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Notes

■ The L1-A key combination (also called Stop-A) is a system


abort command.
✓ This key combination sends an abort sequence to the CPU to terminate the boot.

✓ L1-A places the system into the monitor mode.

■ The L1-A is used to abruptly terminate processing and bring the


system to the PROM level.

■ Indiscriminate use of L1-A can corrupt the file system.

■ L1-A does not synchronize the disks.


✓ Sun machines with bit-mapped displays and keyboards accept the L1-A key combination
to abruptly terminate current processing. This can cause the Sun operating system file
system checking procedures (fsck) to correct the problem by removing data. Always halt
the system to synchronize the disks first. The abort function does not synchronize the
disks before bringing it to the PROM level.

✓ The BREAK key is used on systems with an ASCII terminal as the console.

■ The c and the g0 allow you to return to the program you left
when the system was abruptly halted.
✓ c and go resume execution of a program at the same point you left it. They are executed
at the PROM level.

■ Both the g0 and sync help avoid file system corruption after an
abort.
✓ When the monitor level environment is running as a result of the system being
interrupted, these commands force a panic and produce a sync. They are executed at the
PROM level.

Run Control (rc) Scripts 15-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Lab—Software Boot

Overview
The purpose of this lab is to:

■ Correctly power cycle a Sun machine.

■ Describe the sequence of the boot process.

■ Explain the functions of the rc scripts command.

■ Boot up and shut down a Sun computer correctly.

Tools and Equipment


To complete this lab, you will need one Sun SPARCstation, a pen or
pencil, and this module, “Run Control (rc) Scripts.”

15-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Lab—Using halt and reboot

Lab Exercise
1. Log in as root. Execute a reboot on the system. Record your
command line below:

Command line: # ___________________

System response:

________________________________________________________

________________________________________________________

________________________________________________________

________________________________________________________

2. What actions did the Solaris software take in response to the


reboot command? (Circle all that apply.)

a. It took the system to single-user level and stayed there.

b. It took the system to the PROM level and stayed there.

c. It took the system to multiuser level and stayed there.

d. It did not synchronize the disks.

e. It did synchronize the disks.

Run Control (rc) Scripts 15-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Lab—Using halt and reboot

3. When the system responded to the reboot, what did the reboot
command do?

a. File systems were checked.

b. File systems were not checked.

c. System echoed: (hostname) login:

d. System echoed: #

4. Which file systems, if any, were checked?

___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________

5. Log in as root. Execute a halt to shut down the system. Record


your command line below:

Command line: # __________________

System response:
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________

6. What did the halt command cause (or not cause) to happen when
it was executed (circle all that apply)?

a. It took the system to single-user mode and stayed there.

b. It took the system to the PROM level and stayed there.

c. The system did not synchronize the disks.

d. The system did synchronize the disks.

7. I know I was at the PROM level because I had the:

a. # prompt b. (hostname) login: c. ok or > prompt

15-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Lab—Changing Run Levels

1. Boot your machine to single-user mode. Record your command line


below:

Command line: # ___________________

2. What file systems, if any, were checked?

________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________

3. When the system booted to single-user mode:

a. All file systems were checked.

b. Only root and /usr file systems were checked.

c. The system gave me a login prompt.

d. The system echoed: #

4. Type a mount to see what file systems are mounted. Record your
command line and the system responses below:

Command line: # ___________________

System response:
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________

Run Control (rc) Scripts 15-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Lab—Changing Run Levels

5. Go to single-user mode and then to multiuser (without rebooting


or halting).

Command to leave single-user: # __________________

6. Log in as superuser and type mount. Record your command line


and the system responses below:

Command line: # ____________________

System response to the mount command:


______________________________________
______________________________________
______________________________________
______________________________________

7.
Type the shutdown command. Record your command line and
system responses below:

Command line: # _____________________

System response:
______________________________________
______________________________________
______________________________________
______________________________________

8. What did the shutdown command cause (or not cause) to happen
when it was executed (circle all that apply)?

a. It took the system to single-user and stayed there.

b. It took the system to the PROM and stayed there.

c. The system did not synchronize the disks.

d. The system did synchronize the disks.

15-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1515 15

Lab—Changing Run Levels

9. Bring your machine to multiuser mode without rebooting. Record


your command line below:

Prompt and command line: ____________________

10. The following took place (circle all that apply):

a. The superblock flags were checked.

b. The system echoed: (hostname) login:

c. The system echoed: #

d. It took the system to the PROM mode and stayed there.

11. Match the following three commmands to the descriptions (circle


all that apply).

a. reboot b. halt c. shutdown

_____ An fsck (file system check) is run upon booting.

_____ The system goes to the PROM and stays there until
rebooted.

_____ The system shuts down to single-user mode and stays


there.

_____ The system shuts down, then automatically boots to


multiuser mode.

_____ init 0

_____ init s

_____ init 6

Run Control (rc) Scripts 15-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
15

Lab—System Aborts

1. Execute a system abort and a continue command. Record the


commands below:

Abort command used (not visible): ________________________

Prompt and the continue command used: _________________

2. The command you used to abort:

a. Performed a sync on the disks.

b. Did not perform a sync on the disks.

c. Left you at the PROM mode.

d. Left you at the single-user mode.

3. The continue command:

a. Required one carriage return to display the prompt.

b. Required two carriage returns to display the prompt.

c. Required three carriage returns to display the prompt.

4. Execute another system abort and force a sync. Record the


commands below:

Abort command used (not visible): ________________________

Prompt and the sync command used: ______________________

5. When I executed a sync on my machine (circle all that apply):

a. A panic message occurred d. The disks are synchronized.

b. There are dump messages e. The system reboots.

c. The file systems are not checked.

This concludes the Run Contol Scripts lab.

15-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Network Terminology 16

Objectives
Upon completion of this module, you will be able to:

■ Describe network types.

■ List the hardware used in a network.

■ Identify the difference between Ethernet and Internet addresses.

■ Display your machine’s Ethernet address.

■ Determine where the Ethernet address is stored.

■ Determine where the Internet address is stored.

■ Describe the Internet address format.

■ Define the network address.

Evaluation
Complete the lab at the end of this module.

References
System and Network Administration, Part Number 800-3805

16-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Network Terminology and Concepts

Network
■ Local area network (LAN)

■ Remote network

■ Wide area network (WAN)

Media
■ Coaxial cable (Sun Ethernet)

■ Twisted-pair cable

■ Fiber-optic cable

16-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

A network is a group of machines connected together so they can


transmit information to one another. There are three types of networks:

■ Local area network


✓ A LAN is a network connecting machines within some limited range, such as a school
campus, industrial park, or high-rise building.

■ Remote network
✓ A network consisting of a group of machines geographically some distance away from the
LAN.

■ Wide area network


✓ A network consisting of a LAN and a remote network. WANs are connected by using some
data-link method such as a leased line, microwave link, or dial-up line.

Media is the material used to connect networks and comes in several


types.
✓ Choice of media usually depends on the size of the network, the bandwidth (raw speed)
desired for the network, and the cost of the media. For example, twisted-pair cable is less
expensive, but doesn’t allow the distances of coaxial cable.

■ Coaxial cable
✓ Coaxial cable is stiff, hard to bend around corners, gives good noise resistance, and
provides fairly long distances. Connecting to the cable is fairly easy.

■ Twisted-pair cable
✓ Twisted-pair cable is inexpensive, bends easily, is susceptible to noise, and provides
fairly short distances. Connection to the cable is usually done in a wiring closet, using a
hub or concentrator.

■ Fiber-optic cable
✓ Fiber-optic cable is expensive but it is extremely noise-resistant and provides very high
speeds.

Network Terminology 16-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

What Is the Ethernet?

■ Bus
■ Broadcast

■ Best-effort

■ Distributed access control

■ Packet-switching

16-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Ethernet
✓ Ethernet is a name given to a popular local area, packet-switching network invented by
Xerox in 1973. It is a 10-megabit per second (megabits/s) broadcast bus technology with
best-effort delivery and distributed access control.

✓ The Ethernet built into Sun Workstations adheres to the IEEE 802.3 standard.

■ Bus
✓ All stations share a single wire.

✓ Advantages are:

- distributed intelligence

- ease of installation

- ease of configuration

■ Broadcast
✓ All stations see every transmission.

■ Best-effort
✓ Sender is not notified when a frame is received; however, frames are not arbitrarily
discarded.

■ Distributed access control


✓ When a workstation wants to transmit a frame, it listens to the cable.

✓ If the Ethernet is quiescent, it transmits the frame immediately, otherwise it waits until the
cable is idle.
✓ If two or more workstations simultaneously begin transmitting, a collision results.

✓ All stations terminate transmission, wait a random amount of time, and try again.

✓ Stations use a binary exponential backoff algorithm to prevent multiple collisions. After 16
attempts to deliver a frame, the station reports failure with an “Ethernet jammed”
message.

■ Packet-switching
✓ All transmissions on the Ethernet are divided into packets (called frames) that are
multiplexed onto the network cable. Each frame contains identification that enables the
hosts connected to the Ether to determine the source and destination.

✓ If a workstation has a number of frames to transmit, it must wait 9 microseconds between


frames in order to prevent any one workstation from monopolizing the network.

Network Terminology 16-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Ethernet Interface

Coaxial cable

Transceiver box
Transceiver
cable

SPARC CPU board


Encoder/decoder

Ethernet
control
logic

Ethernet data
link controller

ID PROM/
NVRAM

Byte-swapped

DVMA Main memory


MMU
arbiter

SPARC

16-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

There are several standard network interfaces:

■ The Intel Ethernet interface (ie)


✓ The Intel Ethernet interface [ie] provides access to a 10 megabits/s Ethernet network
through a controller using the Intel 82586 LAN coprocessor chip.

■ The Lance Ethernet interface (le)


✓ The Lance Ethernet interface [le] provides access to a 10 megabits/s Ethernet network
through a controller using the AMD® LANCE (Local Area Network Controller for Ethernet)
AM7990 chip.

■ The Ethernet Serial Interface (ESI)


✓ The ESI provides the Manchester encoding and decoding of the Ethernet packets. The
ESI uses an analog phase-lock-loop (PLL) technique to extract the received clock from the
data. This module is called the front end to the Ethernet controller.

■ The Ethernet Data Link Controller (EDLC) chip


✓ The EDLC controls Ethernet packets to and from memory and signaling the front end to
receive or transmit packets. The EDLC is a high performance local area network
processor which utilizes CSMA/CD.

■ The loop device (lo)


✓ The loop device, lo, is a software loopback network interface. It is used for performance
analysis and software testing, and to provide guaranteed access to Internet protocols on
machines with no local network interfaces.

Network Terminology 16-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Network Hardware

Node

50-ohm coax Ethernet cable


Maximum length all segments = 1500 meters
Transceiver box

Transceiver cable
Maximum length = 50 meters

Node
Node

Node
Multiplexor
(Mux) box
Node

Minimum length = 2.5 meters Node


between nodes

Node Node

50-ohm terminator 50-ohm terminator

16-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Coaxial cable
✓ Forms the backbone of the Ethernet system.

■ Thicknet
✓ Ethernet traditionally uses “Thicknet,” coaxial cable, which is a modified version of RG-8
coaxial cable. Frequently referred to as “yellow cable,” there is a teflon version for use in
plenums. Recent developments include use of Thinnet and twisted pair.

✓ The signal on Ethernet is digital. Bits are transmitted in order, left to right, and appear as
a 5MHz periodic waveform on the cable.
- Marked in 2.5-meter segments for taps to obtain the clearest signal.

- 50-ohm cable with multiple shields.

- 500 meter maximum segment length (1639.3 feet).

- 100 nodes maximum per segment (total of 300 nodes).

- Ends are terminated with 50-ohm terminators to prevent signal reflection and provide
a balanced electrical load.

■ Transceiver box
✓ Provides electrical isolation between the coaxial cable and the transceiver cable. Also
called a Media Access Unit (MAU).

■ Transceiver cable
✓ Connects the controller to the transceiver tap on the coaxial cable or to a multiplexor
(MUX) box. The transceiver cable is also called an Access Unit Interface (AUI) cable or
drop cable.

- 50 meters maximum length (163.9 ft).

■ Multiplexor (MUX) box


✓ Enables the attachment of multiple transceiver cables to a single transceiver tap into your
coaxial cable.

✓ Can be an economical alternative to Ethernet cable for small networks.

✓ Also a way of expanding beyond the 300 node limit. 1 MUX = 1 node.

Network Terminology 16-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Standard Ethernet Connection

DB 15 Thicknet Connector

16-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Fused

Caution – Some precaution should be taken when connecting your


! transceiver cable to the standard Ethernet connection. System power
should be off. This connection is fused. You can check for the
presence of power by looking at a transceiver connected on the other
end of the cable (most of the new transceivers have lights on them),
and if you see a light on, the fuse on the system board is functional.

■ Sliding retaining clip

Warning – When the cable is on, you should secure the sliding clip to
the locking position. When trying to remove the cable, you should
make sure the sliding clip is in the open position, otherwise you will
pull on the cable and damage can occur to the sliding clip, as well as
to the cable itself.

Network Terminology 16-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Thinnet

Thick-to-thin
adapter box
50-ohm BNC terminator

Sun 4/490
workstation
Standard
BNC T adapter Thicknet
drop cable

SPARCstation 2
workstation

SBus adapter board

Thinnet SBus
adapter board

SPARCserver 690MP
50-ohm BNC terminator workstation

16-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Thinnet
✓ Thin, low-cost coaxial cable. Thinnet is a network where up to 90 devices on a series of
thin coaxial cable segments are interconnected.

■ Thin cable
✓ 50-ohm cable with 50-ohm terminator at end.

✓ Maximum segment length is 185 meters.

✓ Maximum 30 machines per segment, for a total of (30 * 3) 90 machines.

✓ Minimum 0.5 meters between machines.

✓ Less shielding than standard Ethernet cable.

✓ BNC connector—permits connecting or terminating sections of coaxial cable in a Thinnet


network (male).

✓ BNC T adapter—connects the thin cable transceiver to the thin coaxial cable in a Thinnet
network (female-male-female).

✓ Adapter, thick-to-thin—standard Ethernet connector (female) on one end and a type BNC
series coaxial connector (female) on the other. Used to connect systems Thicknet to
Thinnet.

Network Terminology 16-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Ethernet Address

Ethernet Addresses are 48 bits


■ They are expressed as 12 hexadecimal digits.
■ The first 6 digits are assigned to the manufacturer by the
IEEE.
■ The last 6 digits are assigned by the manufacturer.

■ Sun has the series 080020.

■ Sun displays the address as 6 hexadecimal bytes, separated by


colons:

8:0:20:9:2a:f0

The Ethernet Address is the System’s Hardware Address


■ It is burned into the ID-PROM.

■ On newer systems, it is maintained in NVRAM.

16-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ The Ethernet address


✓ The Ethernet address is also called the hardware address. It is guaranteed by the
manufacturer to be unique, and forms the basis of a network addressing scheme.

■ The Ethernet address is a 48-bit number. For example:

8:0:20:9:4e:cc
✓ It is represented by hexadecimal digits and is subdivided into six 2-digit fields (12
hexadecimal digits) separated by colons.

✓ The first 6 digits are assigned to the manufacturer by the IEEE.

✓ The last 6 digits are assigned by the manufacturer.

✓ Sun has the series 080020.

■ All Sun workstations have an Ethernet address stored in the


system ID PROM or NVRAM.
✓ Your system boots up with the removal of the ID PROM or the NVRAM. It uses the default
values stored in the boot PROM.

Network Terminology 16-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

ISDN

ISDN Bundled into the System Board

ISDN connectors

NT
TE

RJ45 modular connector

16-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Sun is the first in the industry to bundle basic-rate Integrated


Services Digital Network (ISDN).
✓ ISDN is integrated into the motherboard (SPARCstation 10, LX and Classic) or as an
optional SBus card. ISDN is the telecommunication’s industry standard for worldwide
digital telephone service. This enables Sun workstations that support ISDN to be
connected to the ISDN telephone network. Basic-rate ISDN provides guaranteed
bandwidth of up to 128 KB/sec.

■ ISDN enables you to extend LAN functionality to include anyone


you can reach over a public ISDN telephone line.
✓ The higher bandwidths enable access to more data for customers running a windowing
system, holding a video conference or sharing documents (fax) over telephone lines. ISDN
enables integration of the telephone and the workstation. This could provide a desktop
dialer and answerer functionality with an easy-to-use GUI. Customers could use an
integrated Rolodex to dial the telephone from another application. Customers can call in
from the road and receive information using a text-to-speech application.

✓ Because ISDN provides a guaranteed bandwidth (unlike Ethernet), it is more appropriate


for time-critical data like audio and video. Ethernet performance is affected by network
traffic. ISDN provides a dedicated channel with guaranteed bandwidth.

■ The RJ-45 connector is an 8-pin modular cable connector standard,


utilized with consumer telecommunications equipment.

■ Two RJ-45 connectors are provided on Sun systems.


✓ One RJ-45 for TE connection and the other for NT connections. The NT is an interface
designation indicating Network Termination capabilities. These capabilities are
responsible for the physical and electrical termination functions of ISDN on user
premises.

✓ The TE supports devices in the standard ISDN interface, including digital phones, digital
facsimile, integrated voice/data terminal devices, as well as non-ISDN devices including
serial (RS-232) communication devices, such as computers, workstations, and terminals.

Note – Initial software support for the ISDN on SPARCstations


addresses the TE interface only.

✓ The Sun ISDN connections also provide power across the interface, such as that required
for robust support of basic telephony, in the event that an attached workstation is down.

Network Terminology 16-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

The FDDI Standard

16-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ FDDI (Fiber Distributed Data Interface)


✓ FDDI (Fiber Distributed Data Interface) is a local area network (LAN) standard developed
by the American National Standards Institute (ANSI). FDDI is defined as a fiber distributed
data interface connecting to a fiber optic, token ring type network. It is designed with two
counter-rotating rings that give network users fault-recovery capabilities. It also offers an
industry-standard solution for organizations that need flexible, high performance
networks.

The FDDI provides:

■ Ten times the speed over Ethernet and Token Ring

■ Three times the data over Ethernet


- 100 megabits

- Up to 2 km between nodes

- 100 km total network length

- Up to 500 nodes on one ring

✓ The Ethernet in contrast, allows up to 2.5 km total network length and 500 meters between
nodes.

- Immune to radio and electrical interference

- Greater distances between nodes

- Higher security than copper cable

✓ Sun provides two distinct fiber rings that enable an optical bypass if the system is not
working. The optical bypass is used by the system if power failure occurs, and alleviates
problems of ring segmentation that can occur if there are multiple faults on a dual ring
FDDI network.

✓ FDDI/S is used in SBus-based systems that require an FDDI concentrator to become


connected to a dual ring backbone. This provides capability for desktop systems.

✓ FDDI/DX interface (Dual Attach) for VME-based systems provides a dual attachment
connection that supports two fiber optic rings for fault recovery.

✓ The boards Sun provides in their workstations enable built-in test, power-up, and
extended diagnostics.

✓ Any Sun server, desktop, or deskside workstation that supports FDDI can act as a router
between an Ethernet or Token Ring environment.

Network Terminology 16-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Internet Address and the /etc/hosts File

# more /etc/hosts
[The /etc/hosts file on the “monterey” machine]
#
# Internet host table
#
127.0.0.1 localhost loghost
#
192.9.200.1 monterey
192.9.200.2 carmel
192.9.200.3 pacifica

Host
Network number
number

16-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ Each host on a network must have a unique host number.


✓ To communicate with another host, there must be an entry for that host in your
/etc/hosts file. No entry means no network communication.

■ The /etc/hosts file lists all of the hosts and their Internet
addresses, often called IP addresses.
✓ An Internet address encodes the identification of the network as well as the identification
of a unique host on that network. This is accomplished by dividing the address into
components.

■ The Internet address scheme provides a hardware-independent


method of addressing other hosts on any network. It makes hosts
independent of hardware upgrades and other changes to the
physical network.
✓ The Internet address contains the network number and the host number.

- Network number—is the portion of the Internet address that describes the network.
The number of bytes that comprises the network number is determined by the class of
the address.

- Host number—is the portion of the Internet address that describes the host.

- Supported values are 1 through 254.

✓ Each group is 1 byte or octet.

✓ Because it contains both the network number and the host number, the Internet address
enables efficient routing.

■ The localhost entry enables the machine to communicate with


itself.
✓ Do not remove or change the localhost entry or the machine will have difficulty
processing internal data. If localhost does not exist, the monterey machine sends all
data out to the network.

✓ The localhost entry also enables software logins for diagnostic purposes.

✓ Be careful to add the addresses to the hosts file correctly, without extra spaces and
characters.

✓ You cannot use just any number for the Internet address or the network can begin to have
problems and can even stop functioning.

■ The loghost entry allows NIS message logging.


✓ This allows electronic mail messages (email) to be routed on the network.

Network Terminology 16-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

The Loopback Address

Datagram addressed to
127.0.0.1

16-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ The Loopback address


✓ The Loopback address is designed for testing and interprocess communications on the
local machine.

✓ Reserved address is 127.0.0.1 on SunOS operating systems.

✓ A message sent by a higher-level protocol to a network address of 127 should loop back
inside the host.

✓ No message “sent” to a network address of 127 should ever appear on any network
anywhere.

✓ The loopback address is used to diagnose network problems that may be caused by
internal software corruption.

Network Terminology 16-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

The /etc/hostname.xx0 File

This file identifies a machine’s Ethernet interface and its host name.

■ Created during suninstall.

■ Used in conjunction with /etc/hosts to set up the host‘s IP


address in memory.

16-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Notes

■ The /etc/hostname.xx# file is created during suninstall, and


it contains the name of the local machine.
✓ The Ethernet interface is identified by the xx# suffix.

✓ For example, a machine with a Lance Ethernet interface (le0) will have a file in the /etc
directory called hostname.le0; whereas a machine with an Intel Ethernet interface (ie0)
will have a file called hostname.ie0.

✓ A machine with two network interfaces, such as ie0 and ie1, will have two files in /etc
called hostname.ie0 and hostname.ie1, respectively.

✓ Changing the host name involves editing the /etc/hostname.xx# file, and changing the
old host name to the new host name. To do this, the machine must be rebooted.

Network Terminology 16-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Lab—Network Terminology

Overview
The purpose of this lab is to answer questions about the Ethernet, the
Internet, and network terms in general. You will also be interrogating
your system for some answers.

Lab Exercise

True or False
T F Coaxial cable forms the backbone of Sun’s Ethernet
system.

T F Ethernet uses the CSMA/CD access method.

T F An Ethernet address is stored in the NVRAM/ID-PROM


when the system is manufactured.

T F An Internet address is usually represented as a 48-bit,


hexadecimal number.

Fill In
1. The maximum length of one Thicknet cable segment is:
___________________________________________________________

2. The minimum Thinnet cable length between two nodes is:


___________________________________________________________

3. The address 127.0.0.1 is a ____________________________

4. Identify the network hardware that enables attachment of up to


eight transceiver cables to a single transceiver tap on your coaxial
cable. _____________________________________________________

5. /etc/hostname.XX0 (where XX=le or ie) contains


___________________________________________________________

16-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1616 16

Lab—Network Terminology

Network Configuration
1. Use the command ifconfig -a or dmesg to obtain the interface
address.

# ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
inet 127.0.0.1 netmask ff000000
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 129.150.28.90 netmask ffffff00 broadcast 129.150.28.255
ether 8:0:20:d:bd:79

ifconfig -a displays several pieces of information, two of which are


the Ethernet and Internet addresses. The ifconfig command is
discussed further in a later module.

2. Record the Ethernet number for your machine below.

Ethernet number: ________________________________________

3. The Ethernet address is stored in the ________ or in the


___________.

4. Record the Internet number for your machine below.

Internet number: ________________________________________

5. The Internet address is stored in the ___________ file.

6. What is your system’s Ethernet interface designation? ___________

7. Log into your machine and display the /etc/hosts file. There are
two columns in this file. Answer the questions below and
fill-in the blanks where necessary.

a. The /etc/hosts file contains entries for ____________________


addresses and ________________ names.

b. The ________ address is composed of two parts:

the _________ number and the __________ number.

Network Terminology 16-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
16

Lab—Network Terminology

8. Every machine on the local network must have a unique


___________ number.

9. The localhost entry enables the machine to (circle all that apply):

a. Communicate with other machines.

b. Communicate with itself.

c. Send electronic mail.

d. Answer requests from other machines.

10. You add entries to the hosts file when (circle all that apply):

a. Your host needs to communicate only with system on the local


network.

b. Other hosts need to communicate only with the local network.

c. Other hosts need to communicate only with your host.

d. Your host needs to communicate with any host of any network.

11. The loghost entry enables the machine to (circle all that apply):

a. Communicate with other machines.

b. Communicate with itself.

c. Send electronic mail.

d. Answer requests from other machines.

This completes the Network Terminology lab.

16-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Basic Network Troubleshooting 17

Objectives

Upon completion of this module, you will be able to:

■ Use the infconfig command to determine local network


parameters.

■ Use the rup command to determine available network host


systems.

■ Use the ping command to determine network host functionality.

■ Describe problem isolation procedures to resolve basic network


error messages.

Evaluation

Complete the lab at the end of this module.

References

System and Network Administration, Part Number 800-3805

17-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

The ifconfig Command

The ifconfig command sets or examines the network interface


parameters.

Example:

# ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232

inet 127.0.0.1 netmask ff000000

le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500

inet 129.150.28.90 netmask ffffff00 broadcast 129.150.28.255

ether 8:0:20:d:bd:79

17-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Notes

Command format: # ifconfig -a

■ The output of ifconfig -a gives the status of all Internet


devices found on the system.
✓ The -a option enables ifconfig to poll all Internetwork interfaces in the system.

✓ The interface can be a physical device, such as an Ethernet interface (le0 in the example),
or a pseudo-device such as the loopback device (lo0).

■ The second line for each interface lists the Internet address (inet),
the netmask, and if applicable, the broadcast or destination
address and the Ethernet address (ether).
✓ These are called flags. Flags indicate the state of the interface:

- UP—The interface is enabled to send or receive data.

- BROADCAST—This interface supports broadcasts and has had a broadcast address


assigned.

- NOTRAILERS —This interface does not require trailer encapsulation.

- RUNNING—Kernel resources have been allocated to the interface to enable it to


handle data.

- LOOPBACK—Frames sent on this interface are immediately placed on a receive queue


for other processes on the local host.

- MTU—Sets the maximum transmission unit of the interface to n. Many types of


networks have an upper limit.

Basic Network Troubleshooting 17-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Basic Network Commands—rup

■ The rup command shows a list of systems on the network.

# rup
venus up 18 days,21:55, load average: 0.10, 0.16, 0.00
mars up 3 days,9mins, load average: 0.12, 0.02, 0.01
192.9.200.16 up 3:24, load average: 0.08, 0.02, 0.01
mercury up 3:23, load average: 0.09, 0.02, 0.01
saturn up 19 days,21:22, load average: 0.21, 0.04, 0.02
orion up 19 days,21:12, load average: 0.42, 0.23, 0.02
#

17-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Notes

Command format: # rup

Command output:

# rup
venusup18 days,21:55,load average: 0.10, 0.16, 0.00

# rup
venus up 18 days,21:55, load average: 0.10, 0.16, 0.00

1 5 15
Minutes
Time system has been up

✓ The rup command shows how long network machines have been up since their last
reboot. The load average of the CPU is calculated over the last minute, 5 minutes, and 15
minutes.

Note – Systems that display only an Internet address without a


hostname do not have an entry in your /etc/hosts file. The rup
command can not convert them to a hostname.

Basic Network Troubleshooting 17-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Basic Network Commands—ping

■ The ping command enables a quick check of a network.

# ping elvis
elvis is alive

# ping houdini
no answer from houdini

# ping galatica
“NETWORK IS UNREACHABLE”

# ping elvira
ping: unknown host

17-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Notes

Command format: # ping hostname

■ /usr/sbin/ping

The ping command sends an echo packet to the named host and
reports whether a reply is received. ping keeps trying until a
timeout of 20 seconds or an answer is received.

■ The ping command can report four network statuses:

■ Alive
✓ The remote host is up and running network processes.

■ No answer
✓ The remote host is not up or is not running network processes.

■ Network unreachable
✓ The remote host is not on the local network

- To be connected to the local network, the network part of the Internet address must
match that of the host system.

■ Unknown host
✓ The remote host is not in the /etc/hosts file.

Basic Network Troubleshooting 17-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Basic Network Commands—ping -s

■ The ping -s command enables a concentrated check of a


network.

# ping -s sunshine
PING micro3: 56 data bytes
64 bytes from sunshine (192.9.227.44): icmp_seq=0. time=24. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=1. time=2. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=2. time=2. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=3. time=2. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=4. time=2. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=5. time=2. ms
64 bytes from sunshine (192.9.227.44): icmp_seq=6. time=2. ms
^C
----sunshine PING Statistics----
6 packets transmitted, 6 packets received, 0% packet loss
round-trip (ms) min/avg/max = 2/2/2

17-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Notes

Command format: # ping [-s] hostname

■ When the -s option is specified, ping sends one request per


second until it is interrupted with a Control-C. The command
then displays a summary.

Output format:

■ The default datagram packet size is 64 bytes.

■ The Internet address of the host under test is displayed.

■ icmp_seg specifies the packet sequence number.

■ time specifies the roundtrip time in milliseconds for each


datagram packet to be echoed back from the host under test.

■ Once interrupted, the final statistics are displayed. The number of


packets transmitted and received, and percent packet loss are
shown.

Basic Network Troubleshooting 17-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Troubleshooting

Network Error Messages and Symptoms

interface no carrier (solution 1, 2)

interface Ethernet jammed (solution 2, 3)

Ethernet transmission error (solution 3)

host_name not in hosts database (solution 4)

Connection timed out (solution 1, 5)

network is unreachable (solution 6)

17-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Notes

Possible Solutions

■ Check whether the transceiver cable is properly connected to


the machine. Also check the connections at the MUX box, if
applicable.
■ Swap transceiver boxes to determine if the existing one is
defective. Swap MUX boxes to determine if the existing one is
defective.

■ Check that the Ethernet cable is terminated at both ends with a


50-ohm terminator.

■ Check the /etc/hosts file to see if the host name is properly


listed along with its complete Internet address.

■ The remote host has crashed or is currently rebooting.

■ The network number of the Internet address is incorrect.

Basic Network Troubleshooting 17-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Troubleshooting—Error Messages
ie: cannot initialize

Something has gone wrong with the board.

ie%d: Ethernet jammed

Network activity has become so intense that 16 successive transmission


attempts failed, causing the 82586 to give up on the current packet. Another
possible cause of this message is a noise source somewhere in the network,
such as a loose transceiver connection.

ie%d: no carrier

The 82586 has lost input to its carries detect pin while trying to transmit a
packet causing the packet to be dropped. Possible cause include an open
circuit somewhere in the network and noise on the carrier detect line from
the transceiver.

ie%d: lost interrupt: resetting

The driver and 82586 chip have lost synchronization with each other. The
driver recovers by resetting itself and the chip.

ie%d: iebark reset

The 82586 failed to complete a watchdog time-out command in the allotted


time. The driver recovers by resetting itself and the chip.

ie%d: WARNING: requeueing

The driver has run out of resources while getting a packet ready to transmit.
The packet is put back on the output queue for retransmission after more
resources become available.

17-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Troubleshooting—Error Messages

ie%d: panic scb overwritten

The driver has discovered that memory that should remain unchanged after
initialization has become corrupted. This error usually is a symptom of a
bad 82586 chip.

le%d transmitter frozen

A bug in the LANCE chip has caused the chip’s transmitter section to stop.
The driver has detected this condition and reinitialized the chip.

le%d: out of mbufs: output packet dropped

The driver has run out of memory to use to buffer packets on output. The
packet being transmitted at the time of occurrence is lost.This error is usually
symptomatic of trouble elsewhere in the kernel.

le%d: stray transmitter interrupt

The LANCE chip has signaled that it finished transmitting a packet but the
driver has sent no such packets.

le%d: LANCE Rev C/D Extra Byte(s) bug; Packet dropped

The LANCE chip’s internal silo pointers have become misaligned. This error
arises from a chip bug.

le%d: trailer error

An incoming packet claimed to have a trailing header but did not.

Basic Network Troubleshooting 17-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Troubleshooting—Error Messages

le%d: runt packet

An incoming packet’s size was below the Ethernet minimum transmission size.

le%d: Receive buffer error - BUFF bit set in rmd

Occurs only in conjunction with a LANCE feature that the driver does not use.

le%d: Received packet with STP bit in rmd cleared

Occurs only in conjunction with a LANCE feature that the driver does not use.

le%d: Transmit buffer error - BUFF bit set in tmd

Excessive bus contention has prevented the LANCE chip from gathering
packet contents quickly enough to sustain the packet’s transmission over
the Ethernet. The affected packet is lost.

le%d: Transmit late collision - Net problem?

A packet collision has occurred after the channel’s slot time has elapsed.
This error usually indicates faulty hardware elsewhere on the net.

le%d: No carrier - transceiver cable problem?

The LANCE chip has lost input to its carrier detect pin while trying to
transmit a packet.

17-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Troubleshooting—Error Messages

le%d: Transmit retried more than 16 times - net jammed?

Network activity has become so intense that 16 successive transmission


attempts failed, causing the LANCE chip to give up on the current packet.

le%d: missed packet

The driver has dropped an incoming packet because it had no buffer space
for it.

le%d: Babble error-sent a packet longer than the maximum length

While transmitting a packet, the LANCE chip has noticed that the packet’s
length exceeds the maximum allowed for Ethernet. This error indicates a
kernel bug.

le%d: Memory Error! Ethernet chip memory access timed out

The LANCE chip timed out while trying to acquire the bus for a DVMA
transfer.

le%d: Reception stopped

Because of some other error, the receive section of the LANCE chip shut down
and had to be restarted.

le%d: Transmission stopped

Because of some other error, the transmit section of the LANCE chip shut
down and had to be restarted.

Basic Network Troubleshooting 17-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Lab—Basic Network Troubleshooting

Overview

The purpose of this lab is to correctly use the following network


troubleshooting commands:

■ ping
■ ifconfig

■ rup

Lab Exercises

Using ping
1. Invoke ping on your system.

What message did you receive? ___________________________

Why?___________________________________________________

2. Now ping the system named localhost.

What message did you receive?____________________________

Why? __________________________________________________

3. How do these names differ? _________________________________

________________________________________________________

________________________________________________________

4. Use more on the file /etc/hosts and record the systems included
below.

________________________________________________________

________________________________________________________

17-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Lab—Using ping

5. ping a system in the lab (your choice of system) that is not


currently in /etc/hosts.

What message did you receive? ___________________________

Why? __________________________________________________

6. vi the /etc/hosts file and add the IP address and the host name
of the system you pinged above.

7. ping the system you just entered in the /etc/hosts file.

What message did you receive? ___________________________

Why?___________________________________________________

8. vi the /etc/hosts file and add the following system:

192.9.200.200 sparcie

9. ping sparcie (the system you just entered into /etc/hosts).

What message did you receive? ___________________________

Why? __________________________________________________

10. ping -s a system in the lab (use either a system currently in


/etc/hosts or enter a new system into /etc/hosts). After
several seconds, abort the command (Control-C).

a. How many packets were sent to the remote system?__________

b. How many packets were received by the remote system?______

c. How many packets were dropped by the remote system?_____

d. What was the percentage of error?_________________________

11. If you sent 100 packets to the remote system and all but one packet
was dropped, what would that tell you about your network?

________________________________________________________

Basic Network Troubleshooting 17-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

Lab—Using the ifconfig Command

1. vi the /etc/hosts file and change the following:

From: 192.9.200.200 sparcie

To: 129.9.200.200 sparcie

2. ping sparcie again (the sparcie with the new IP address you
just entered into /etc/hosts).

What message did you receive. ____________________________

Why? __________________________________________________

The ping command only work on systems that share the same
network address. In the example above, the network address for the
system sparcie is 129.9.200.XXX.

3. Type ifconfig -a.

4. What is your network address (look under the le0 heading; look
for the number following the word inet)?

inet: __________________________________________________

The number should be 192.9.200.XXX. Since the network address


for sparcie doesn't match your network address, the system returns
the network unreachable message. The only way to find sparcie
(in addition to having a real system named sparcie on the network)
is to have a router installed in the network connected to
192.9.200.XXX and to 129.9.200.XXX. A router is a system with
two or more Ethernet interfaces installed with multiple IP networks
identified, one of which is 192.9.200.XXX, another which is
129.9.200.XXX.

17-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1717 17

Lab—Using the rup Command

1. Use the more command on the /etc/hosts file.

How many system are listed (not counting localhost)?______

2. Type in the command rup.

How many hosts are listed?_____________________________

Are there any system names you recognize?_________________

If so, how many?_________________________________________

Where do you recognize them from? _______________________

3. Are there any system names you don't recognize?_______________

If so, how many?_________________________________________

The numbers are systems that are using IP addresses that are not in
your /etc/hosts file. As you add systems to /etc/hosts, the amount
of systems that show only IP addresses decreases, while system names
increase.

4. Now add one system from the lab to the /etc/hosts file (a
system name you didn't see in the rup listing).

5. Type rup again.

Do you see the newly added system?_______________________

Why do you see it now? __________________________________

6. Log out of your system.

This concludes the Basic Network Troubleshooting lab.

Basic Network Troubleshooting 17-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
17

17-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Sun NFS Service 18

Objectives
Upon completion of this module, you will be able to:

■ Describe the differences between local file system mounting and


the Sun NFS distributed computing file system mounting.

■ Describe the function of the NFS system server.

■ Describe the function of the NFS system client.

■ List the NFS system server’s files, and describe how they are used.

■ List the NFS system client’s files, and describe how they are used.

■ Correctly use the share and mount commands.

■ Explain the fields and use of the dfstab, mnttab, and sharetab
files.

■ Correctly execute the dfshares command.

Evaluation
Complete the lab at the end of this module.

References
System and Network Administration, Part Number 800-3805-10

18-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Characteristics of the NFS System

■ Shares files and directories across the network.

■ Uses machine-independent protocol.

■ Licensed to many vendors.

■ Provides consistent and reliable use of databases because all users


can read the same set of files.

18-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

✓ The Sun NFS distributed computing file system was one of the first solutions to the
problem of remote file-sharing and has become the most successful solution. Sun created
a licencing policy for the NFS system and offered it to the industry for a very reasonable
fee.

■ Shares files and directories across the network.


✓ The NFS system is a machine-independent protocol that allows systems to share files and
directories across the network. One of the original design aims was to make this sharing
transparent to both the user and any applications.

■ Uses machine-independent protocol.


✓ The NFS system is operating-system independent, although the SunOS operating system
version of the NFS system is part of the kernel. You can find versions of the NFS system
that work with proprietary operating systems running on minicomputers and mainframes.

■ Licensed to many vendors.


✓ Many vendors have purchased a license and have incorporated the NFS system into their
product offerings.

■ Provides consistent and reliable use of databases—all users can


read the same set of files.

Sun NFS Service 18-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Types of Clients

■ NFS Standalone client

■ Dataless NFS client

■ Diskless NFS client

18-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

The NFS system enables a client to ask for a particular file (or some
part of a file) across the network as if the client had a local disk.
✓ All CPU processing is on the client, not the server.

Types of NFS clients include:

■ NFS system stand-alone client


✓ Has local disk space for its own use [root, swap, and usr].

✓ Mounts one or more directories from an NFS system server across the network.

■ Dataless NFS system client


✓ Has local disk space for root and swap.

✓ Mounts their /usr directory, /home directory, manual pages and other applications from
an NFS system server.

■ Diskless NFS system client


✓ Mounts all file systems from NFS system server (especially root, swap, and usr).

✓ Usually has no local disks attached.

Sun NFS Service 18-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Background

server=monterey

mount /usr

mount /usr

mount /usr client=carmel

18-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The NFS system enables multiple machines to share files across


a network.
✓ In conjunction with other services, such as mount, the NFS system enables you to access
remote files and hierarchies transparently, as if they were local to your machine. To the
user, all files accessed through the NFS system look just like local files.

✓ Using the same files means data is accessible to any machine on a network. Storage
costs can be reduced by having machines share large programs. Database consistency
can also be achieved by having all users read the same set of files.

■ Use of remote procedure calls (RPC) enables the NFS system to


share files.
✓ To access remote files and hierarchies, special network routines, called remote procedure
calls (RPC), are used. These RPC routines make procedure calls on other machines
across the network. The NFS system software must use RPC to function on the network.
RPC routines provide a service function for the NFS system by establishing the network
connection. For more information, look at the man page RPC (3N).

Sun NFS Service 18-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

How Does the NFS System Work?

■ The NFS system file server shares directories to make them


available for remote sharing.
■ The NFS system client mounts the exported directories.

■ The server reads or writes files in response to client requests.

■ A server can serve clients of other server, and can be itself an NFS
system client.

18-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The NFS system file server shares directories to make them


available for remote sharing.
✓ An NFS system file server designates directories in the local (UFS) file systems that it
shares with the other machines on the network. A process called sharing makes the
directories available and handles all references to the shared directories from the
network. Any machine with a local file system can be an NFS file server.

■ The NFS system client mounts the exported directories.


✓ The NFS system client mounts the exported directories and treats them as if they were
local file systems. Any machine can be an NFS system client. All diskless clients are NFS
system clients.

■ The server reads or writes files in response to client requests.


✓ The server maintains no information about the state of the client’s open files. A process
on the server can remove a file that is being edited on the client. The NFS client is
responsible for maintaining the state of its open files.

✓ The NFS file server is required by the NFS system protocol to immediately perform any
NFS write requests. This can slow the server down if it has many clients who are actively
writing files. The marketplace has developed various strategies for dealing with this
problem. One of the simplest strategies is to install an NFS accelerator board, such as
Prestoserve™, in your file server.

■ A server can serve clients of other servers and can be itself an NFS
client.
✓ An NFS system file server can also be an NFS system client. The server, however, cannot
serve directories that it has mounted as a client. For example, assume jupiter gets the
/usr/local directory from earth. If venus tries to mount it the output is:

- # mount jupiter:/usr/local /usr/local


mount: jupiter:/usr/local: Too many levels of remote in path
mount: giving up on:
/usr/local

Sun NFS Service 18-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Background for a Client

■ Mounting a local file system

Host = monterey /
. . . . . .

etc usr var

ucb man etc kvm lib

■ NFS mounting

Server = monterey
/
. . . . . .
Client = carmel
etc usr var
/
. . . . . .
ucb man etc kvm lib
. . . . . . etc usr var

man4 man5 man6


ucb man etc kvm lib

Server shares gray area

18-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ Through the NFS system you are not constrained to do the


mounting starting at the root of the file system.
■ The NFS system enables mounting a file system anywhere in the
NFS clients’s directory hierarchy.
✓ Remember that when you mount a file system from a local disk onto a mount point, you
mount the entire file system, starting at its root. For example, / (slash) is the root of the
root file system; /usr is the root of the usr file system, and so on. When you mount the
usr file system on the /usr directory of the root file system, you access the root of the
usr partition. The root of the usr partition is accessed through the /usr directory.
However, in NFS when you want to have access to the /usr/share/man directory, you do
not have to mount the entire usr file system from the NFS system file server. You can
simply mount the NFS system file server’s /usr/share/man directory.

■ The file system containing the directory you want must exist on
the local disk of the machine from which you want to NFS mount
it.
✓ You cannot NFS-mount a directory or file system from a machine that is currently NFS-
mounting the wanted directory or file system from another machine. The NFS system does
not allow you to do that.

■ An empty directory must exist on the NFS client to use as a mount


point.
✓ Just as in mounting from a local disk, there must be an existent mount point or you will
receive an error message from the mount command. If you try to NFS mount to a directory
that has contents, the mount will cover the contents. NFS mounting over prior contents
makes those contents inaccessible until the mount is removed. It will not harm the prior
contents.

■ A network can support an unlimited number of NFS servers.


✓ There are no limits as to the amount of NFS system file servers a network can support.

■ The machine that is borrowing the NFS server’s file system is the
NFS client.
✓ The client mounts shared file systems or directories exported by the NFS server.

Sun NFS Service 18-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Background for a Server

OK, I will “share”


the /usr file system.

NFS system file server = monterey


/
. . . . . .

etc usr var

ucb man etc kvm lib


. . . . . .
man4 man5 man6

Now, I have to make the


man directory and then NFS client = carmel
execute the NFS mount.
/
. . . . . .

etc usr var

ucb man etc kvm lib


. . . . . .
man4 man5 man6

18-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The machine that is sharing its file system’s contents or is


providing a network service is the NFS system file server.
✓ The NFS system file server provides a service by making the contents of a file system
available to specific machines or to all machines. It is a decision made on the basis of
need or security of the file system being shared. For example, a group of programmers
may require that an application program is available at all times. To keep unwanted users
out of the program, it can be made available only to the machines used by those
programmers.

■ The NFS system file server must allow access to the NFS client.
✓ The NFS system client makes the decision whether to NFS mount the file system or
directory once the NFS system file server enables access. The NFS system client must do
all the work to get the wanted file system or directory to its machine by making the mount
point directory and executing the mount command.

■ The NFS system file server can simultaneously be an NFS client.


✓ Often in the NFS environment, an NFS server contains a software program that another
NFS server needs to do its job. In this circumstance, one NFS system file server becomes
an NFS system client of another NFS system file server.

The NFS system server also:

■ Defines mount points for file systems accessed from network.

■ Reads or writes files via requests made to the NFS server.

Sun NFS Service 18-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

The /etc/hosts File

■ Each host on a network must have a unique host number.

■ To communicate with another host, there must be an entry for that


host in your /etc/hosts file.

The /etc/hosts file on the machine called monterey:

#
# Internet host table
#
# If the NIS is running, this file is only
# consulted when booting
127.0.0.1 localhost loghost
#
192.9.200.1 monterey
192.9.200.2 carmel
192.9.200.3 pacifica

Network
number Host
number

18-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The NFS server and the NFS client must know each other exists.
✓ The sharing and mounting of NFS file systems and directories can take place only when
each machine is aware of the other machine. Example: When you visit a friend, you must
know where that friend lives. Without the friend’s address, you might never find your
friend. It is the same with machines; each has a unique address on the network.

■ The /etc/hosts file lists all of the hosts and their Internet
addresses, often called IP addresses.
✓ Each machine has its name listed with its corresponding address. The addresses are
called Internet addresses.

✓ the loghost entry allows monterey to send and receive electronic mail messages.

■ The localhost entry allows the machine to communicate with


itself.
✓ Do not remove or change the localhost entry or the machine will have difficulty
processing internal data.

✓ if localhost does not exist, monterey sends all data out to the network.

■ All Internet addresses are defined by the Network Information


Center.

■ The registration and fee process is usually handled by the network


administrator or the system administrator at the site.
✓ Internet addresses are defined by the Network Information Center. There is a registration
process and a fee involved in attaining an Internet address.

■ The Internet address contains the network number and the host
number.

■ Be careful to add the addresses to the hosts file correctly, without


extra spaces or characters.
✓ You cannot use just any number for the Internet address because the network begins to
have problems and can even stop functioning.

Sun NFS Service 18-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Client/Server Interaction

■ /etc/dfs/dfstab

■ /usr/bin/share

■ /etc/dfs/sharetab

■ /usr/sbin/mount

■ /etc/vfstab

■ /etc/mnttab

18-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

Files used by the NFS system client or server include:

■ /etc/dfs/dfstab
✓ The server uses /etc/dfs/dfstab to determine which file systems to share.

■ /usr/bin/share
✓ The server uses share to make file systems available.

■ /etc/dfs/sharetab
✓ The /etc/dfs/sharetab file contains the names of the file systems that are actually
shared.

■ /usr/sbin/mount
✓ Client issues NFS mount request (/usr/sbin/mount).

■ /etc/vfstab
✓ Servers and Clients both have a /etc/vfstab file that reflects particular mounts that are
referred to when they boot up.

■ /etc/mnttab
✓ Servers and Clients both have a /etc/mnttab file that contain the names of the file
systems that are actually mounted.

✓ The client maintains communication with the server without a login or connection.

Sun NFS Service 18-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Server Files—dfstab and sharetab

The /etc/dfs/dfstab and /etc/dfs/sharetab files are on the NFS


server.

■ Options used with -o

Default - read/write all systems


ro - Export the directory read-only
rw - Export the directory read-write to carmel but
read-only to all others

■ Option -d allows description of resources being shared

# more /etc/dfs/dfstab
# Place share (1M) commands here for automatic execution
# on placing init state 3
#
# share [-F fstype] [-o options] [-d “<text>”] <pathname> [resources]
# .e.g.
# share -F nfs -o rw=engineering -d ”home dirs” /export/home2
share -F nfs -o rw=pound -d ”games” /usr/games

# more /etc/dfs/sharetab
/usr/games - nfs rw=pound games

18-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The /etc/dfs/dfstab file contains entries for directories that


can be exported to NFS clients.
✓ After bootup, share can be run at anytime to make a directory or file system available for
mounting, share must be run by root.

■ The /etc/dfs/dfstab file is found only on the NFS server


machine.

■ The /etc/dfs/dfstab file is a static file.


✓ This file is read automatically by the share command. The only way to change
/etc/dfs/dfstab is by editing it. If you change /etc/dfs/dfstab, you must run share
for the changes to affect the daemon’s operation. Only when this file is present at boot
time does the rc scripts execute share and start the NFS file system services.

■ The /etc/dfs/sharetab file is found only on the NFS server


machine.
✓ It contains the names of the directories that are currently exported

✓ This file is initialized at bootup from the /etc/dfs/dfstab file.

■ The /etc/dfs/sharetab file is a dynamic file.


✓ The /etc/dfs/sharetab file is created by one the rc files. The rc files runs share to
export all file systems found in the /etc/dfs/dfstab file and initialize the
/etc/dfs/sharetab file. /etc/dfs/sharetab is changed by exporting and un-exporting
file systems from the command line. It can differ from the /etc/dfs/dfstab file once the
system has been up and running for awhile because the system administrator can change
what is exported from the NFS server; so there can be more entries in the exports than in
the dfstab or the opposite can be true.

A directory cannot be exported if:

■ It is within the same file system (on the same disk partition).
- Example: The /usr/local could not be exported if the /usr file system is currently
exported.

■ It is the parent directory of a previously exported directory.


- Example: /usr could not be exported if the /usr/local directory is currently
exported.

✓ BOTH /usr and /usr/local could be exported if both were separate file systems.

✓ The /etc/dfs/dfstab file specifies the directories you want to make available to the
network and any options you want applied to those directories.

Sun NFS Service 18-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Export Options

Export Options Can be Applied to Directories:


■ ro – read only

ro=client1[:client2]...

■ rw – listed hosts have read/write access. All others have read


only.

rw=client1[:client2]...

18-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ Options

■ Default
✓ The default for the /etc/dfs/dfstab file is read/write all systems.

■ ro
✓ Export this directory read only.

■ rw=host1[:host2]...
✓ Export this directory read mostly; listed hosts have read/write access, all others have read
only.

■ In the /etc/dfs/dfstab file, the first option is prefaced with


™™- (dash).

Example:

-rw=hostA:hostB

Sun NFS Service 18-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

The share Command

■ Export all directories listed in the /etc/dfs/dfstab file.

# shareall

■ List the export table.

# share
- /usr/games rw=pound “games”

■ Unsharing a specified directory.

# unshare /var/spool/mail

■ Unexport all the directories.

# unshareall

18-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The /usr/sbin/share command is run only on the NFS server.

■ The /usr/sbin/share command makes a local directory or file


system available for mounting over the network by NFS clients.
✓ The share command is normally invoked at boot time by the rc scripts, and uses
information contained in the /etc/dfs/dfstab file. Once share is executed and it reads
the shared file, the file systems listed in the dfstab file are shared. The
/etc/dfs/sharetab file is then populated with the currently exported file systems and
directories.

- After bootup, share can be run at any time to make a directory or file system available
for mounting. share must be run by root.

✓ Under the “Command Examples”:

- shareall tells share to read the exports file and export all that is found there

- share without an option lists the currently exported file systems and directories

- unshare /var/spool/mail tells share to unexport the /var/spool/mail directory;


again any NFS clients currently mounting this directory is not affected until they
reboot

- unshareall is saying to remove all file systems and directories from being exported;
this does not affect any NFS clients that are using the exported file systems and
directories until they reboot; at that time, they will not be able to NFS mount what they
had previously mounted.

✓ - More information can be obtained by using the man command on share.

■ The /etc/dfs/sharetab file contains the names of the directories


that are currently being exported.

Sun NFS Service 18-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

The /usr/sbin/dfshares Command

■ List all machines that are mounting directories from an NFS


server.

grob% dfshares grissom

RESOURCE SERVER ACCESS TRANSPORT


grissom:/usr grissom - -
grissom:/usr/dist grissom - -
grissom:/var/tmp/medusa grissom - -
grissom:/export/exec/kvm grissom - -
grissom:/home/techsprt grissom - -
grissom:/var/mail/techsprt grissom - -
grissom:/home/malachite grissom - -
grissom:/var/mail/malachite grissom - -

grob%

18-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The dfshares command looks at the NFS server.


✓ The dfshares command enables you to look at the NFS system server to determine which
file system or directories are currently shared and who has access.

✓ The dfshares command also returns information that tells you who is NFS mounting the
file system/directory.

✓ - dfshares uses the /etc/mnttab file to gather its information

✓ - Every time an NFS client mounts a file system or directory, an entry is made in the
mnttab file

■ The dfshares command gives information about the shared files


systems of an NFS server.

Command format: # dfshares


✓ The dfshares command without options on your own machine shows what systems have
mounted files from your machine.

■ dfshares server_name
✓ dfsharesserver_name dentifies which files are exported and to whom they are available.

Example of a machine that may not be a server:

% dfshares mars
mars: RPC: Program not registered

Sun NFS Service 18-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

The /usr/sbin/mount Command

Mount examples:

# mount monterey:/usr/share/man /usr/man


#
# mount monterey:/usr/local /usr/local
#

18-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

Command format:

# mount [options] [NFS server]:[path] [mt. point]


✓ The server name followed by the colon as a delimiter indicates to the mount command
that this is an NFS mount.

■ The mount command allows an NFS client machine to


actively borrow a file system or directory from an NFS
server.
✓ An NFS client mounts a directory exported by an NFS server. In order for the mount to
succeed, the client must be able to reach the NFS server over the network, the client must
be a known host to the server, and the client must be one of the named hosts in the
/etc/dfs/dfstab file if the server has a restricted list of machines. The mount point directory
must exist.

■ mount uses an empty directory called a mount point.


✓ The /usr/sbin/mount command is used to attach a file system to the existing hierarchy
at a specified directory location or a mount point that is an empty directory. If a directory
contains files when it is used as a mount point, the files are hidden until the file system is
unmounted. Originally, mount only worked with UNIX File systems (UFS).

■ The mount point does not have to be the same path as the
server’s path to the file system.
✓ However, some software programs require default paths and may not function if the path
is different

- The man directories can only be mounted on /usr/man or /usr/share/man

■ By default the file system/directory is mounted read-write.


✓ When the options of read-only and soft are not specified, the default is used. If the NFS
server goes down with a hard mount, the NFS client machine will hang. If the NFS client is
trying to boot and the NFS server is down, the boot will hang until the server is back up.
If the server goes down with a soft mount (an undiscussed option; for more information,
use the man pages), the client receives a message telling it that the server is not
responding. When files are being written to, or executables are being run from the NFS
mounted software, hard mounts are used. When the hard mount hangs, it is protection
from corruption and core dumps. As soon as the server comes back up, the file is written
to in a normal fashion without data loss.

■ Only root can mount file systems.

Sun NFS Service 18-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

The /usr/sbin/umount Command

umount examples:

# umount /usr/man
#
# umount /usr/local
#

18-28 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

Command format: # umount (mt. point)

■ umount means un-mount. The umount command removes an


NFS mount from the /etc/mnttab file.
✓ A file system cannot be unmounted if you are in it.

✓ To unmount any file system it cannot have any running processes and you must change
directories out of it. When using umount, the mount point directory path is the only
argument needed.

✓ If any processes are executing in the mounted directory hierarchy, you cannot unmount
that file system. For example:

- # umount /usr
nfs umount: /usr is busy

■ Only root can umount file systems.

Sun NFS Service 18-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Client Files—/etc/vfstab

The /etc/vfstab file can contain both local and network file systems:

■ Local file systems mounted only

# more /etc/vfstab
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 2 no
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s7 /home ufs 3 no

■ Network file system mounted

# more /etc/vfstab
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 2 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s7 /home ufs 3 no
henry:/usr/games /usr/games nfs - yes

18-30 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

Command format: # mountall

■ /etc/vfstab can contain local and network file systems.


✓ The /etc/vfstab file is the static file system mounting table. If a mount point is listed in
this file, you can use the mount command with the following format:
mount /mount_point.

The /etc/vfstab file can have entries for local disks (ufs) and remote (nfs) mounts. The
fsck order should always be 0 for NFS mounted file systems.

■ The mountall command mounts all file systems specified in the


/etc/vfstab file.

Sun NFS Service 18-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Client Files—/etc/vfstab and /etc/mnttab

The /etc/vfstab and /etc/mnttab files exist on all hosts, and help
help to determine permanent and temporary mounts.

# more /etc/vfstab
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 2 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s7 /home ufs 3 no

# more /etc/mnttab
/dev/dsk/c0t1d0s0 / ufs rw,suid 724141033
/dev/dsk/c0t1d0s6 /usr ufs rw,suid 724141033
/dev/dsk/c0t1d0s6 /home ufs suid,rw,dev=80000 42141047
topstuff:/usr/dist /usr/dist nfs ro,dev=21c0000 742141095

18-32 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

■ The /etc/vfstab and /etc/mnttab files help to determine


permanent and temporary mounts.
■ The /etc/vfstab file is a static file; the /etc/mnttab file is a
dynamic file.
✓ You can determine if mounts are permanent by looking at the vfstab file. You can see if
they are temporary by looking at the mnttab file and comparing it with vfstab.

■ The /etc/mnttab file is initialized at bootup from the


/etc/vfstab file’s contents.

■ Both NFS and UFS mounts are listed in the /etc/mnttab file.
✓ At bootup, the rc files create the /etc/mnttab file. The rc files mounts all ufs file
systems that are found in the /etc/vfstab file, causing the mount information to be
loaded into the /etc/mnttab file. Later, the rc files mount the NFS file systems, causing
this data to be appended to the /etc/mnttab file.

■ The /etc/mnttab file does not always contain the same


information as the /etc/vfstab file.
✓ It is possible to have mounts listed in the /etc/mnttab file that are not contained in the
/etc/vfstab file. The opposite can also occur where there are more entries in the
/etc/vfstab file than in the /etc/mnttab file.

■ Only the /etc/vfstab file can be edited.


✓ Editing of the /etc/mnttab file can cause problems because it would be altering the
system’s current information table.

- In both files, the server name is followed by a colon

- After the colon, the path of the file system/directory being borrowed is listed

- Following the server’s path is the absolute path to the directory being used as the
mount point

- You must always begin at root for both the server’s path and the path to the client’s
mount point directory

- The /etc/mnttab file differs from the /etc/vfstab with the dev=xxxx entry

- The dev=xxxx defines the device being used for the mount, SCSI=80xx; network=21xx

- NFS mounts have zeros (02) for the last two digits

- The zeros mean the file system or directory belongs to someone else and you are not
allowed to make tape backups of it or fsck it

Sun NFS Service 18-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

NFS Client Mounts at Boot—/etc/vfstab

The /etc/vfstab can contain both local and network file systems.

■ Before NFS:

# more /etc/vfstab
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 2 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s7 /home ufs 3 no

■ After NFS:

# more /etc/vfstab
/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 2 no
/dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s7 /home ufs 3 no
henry:/usr/games /usr/games nfs - yes

18-34 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Notes

✓ The /etc/vfstab file is the static file system mounting table.

✓ If a mount point is listed in this file, you can use the mount command with the following
format: mount /mount_point.

✓ The /etc/vfstab file can have entries for both local disks (ufs) and remote (nfs)
mounts.

✓ The fsck order should always be 0 for NFS mounted file systems.

To display the contents of /etc/mnttab in /etc/vfstab format, use


mount -p.
✓ The mount -p option displays the contents of /etc/mnttab in a format similar to the one
found in /etc/vfstab. Remember that /etc/mnttab displays currently mounted file
systems.

✓ This provides a way to create an /etc/vfstab file after all desired file systems have been
mounted. An example of the output of a mount -p command is shown below.

- # mount -p
/dev/dsk/c0t1d0s0/ ufs no suid

- /dev/dsk/c0t1d0s6/usr ufs no suid

- /dev/dsk/c0t1d0s7/home ufs no suid

- The easiest way to insert new mounts into the /etc/vfstab is to redirect the
mount -p output.

✓ To create the new vfstab, redirect the output of the mount -p command to overwrite the
current fstab.

- 1) Mount all desired file systems (local and network) and verify operation.

- 2) Copy the current /etc/vfstab to a backup name.

- # cp /etc/vfstab /etc/vfstab.orig
(ALWAYS make a backup copy of /etc/vfstab file first!)
(THE FOLLOWING STEP WILL OVERWRITE THE ORIGINAL!!!)

- 3) Redirect the mount -p output to /etc/vfstab

- # mount -p > /etc/vfstab


(This step redirects the output of mount -p to the file name /etc/vfstab)

To mount or remount all file systems in /etc/vfstab, use the


mountall command.
✓ The mountall command mounts all file systems specified in the /etc/vfstab file.

Sun NFS Service 18-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Lab—NFS Service

Overview
The purpose of this lab is to determine the functioning of the NFS
server, correctly export and unexport an NFS file system, and correctly
execute an NFS mount.

Tools and Equipment


To complete this lab, you will need: one or two Sun SPARCstations for
every two students with a functioning SunOS operating system file
system, a pen or pencil, and this module, “Sun NFS Service.”

Lab Exercise

NFS Background
1. Log into your machine and more the /etc/hosts file. There are
two columns in this file.

Answer the questions below, filling in the blanks where necessary.

a. The /etc/hosts file contains entries for addresses


and names.

b. The address is comprised of two parts:


the number and the number.

c. Every machine on the local network must have a


unique number.

2. The localhost entry allows the machine to (circle all that apply):

a. Communicate with other machines.

b. Communicate with itself.

c. Send electronic mail.

d. Answer requests from other machines.

18-36 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Lab—NFS Background

3. You add entries to the hosts file when (circle all that apply):

a. The NFS client needs to communicate only with the outside


world.

b. The NFS server needs to communicate only with the outside


world.

c. The NFS server needs to communicate with the NFS clien.

d. The NFS client needs to communicate with the NFS server.

e. Your host wants to communicate with another host.

4. NFS system sharing of files allows (circle all that apply):

a. Machines without disks to be NFS servers.

b. Users to access other users’ confidential files.

c. Multiple machines to use the same files.

d. Machines to share files across a network.

5. NFS allows mounting a file system (circle all that apply):

a. Only starting at the root of the file system.

b. From NFS system servers that do not have disks.

c. Anywhere in the NFS system client’s directory hierarchy.

Sun NFS Service 18-37

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Lab—Partner Exercise

6. The NFS file system containing the wanted directory must (circle
all that apply):

a. Exist on the NFS system server’s local disk.

b. Be exported to the NFS system environment.

c. Be accessible to the NFS system client requesting the file


system.

7. The NFS system server (circle all that apply):

a. Can be an NFS client.

b. Must allow access to the NFS client.

c. Specifies which directory the client must use for the mount
point.

Pick a partner to work with on the next exercise.

Partner Exercise
1. Ask your partner what the hostname and Internet address of
his or her machine is. Add these entries to your /etc/hosts file.
Be very careful not to leave any spaces between the end of the
hostname and the carriage return.

2. Record the lines from your /etc/hosts file below:

Internet address Host name

__________________ ___________________

__________________ ___________________

__________________ ___________________

__________________ ___________________

18-38 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Lab—Partner Exercise

3. Record the part that is the network number and the part that is the
host number from the above data in the spaces below (Omit the
localhost entry in the following data.):

Network number Host number

4. Which machine is the loghost?

my machine my partner’s machine

The loghost entry allows the machine to send and receive


electronic mail messages.

5. Your partner is to act as your NFS server.

■ Have your partner vi the /etc/dfs/dfstab file and enter


/usr as the only exported item.

6. Your partner should type in the following commands:

# /etc/init.d/nfs.server start

This command starts the NFS server daemons.

# shareall

This command exports the contents of /etc/dfs/dfstab and


makes the appropriate entries into /etc/dfs/sharetab.

Sun NFS Service 18-39

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Lab—Informational Commands

1. Your partner is to act as your NFS system server in this exercise.


Determine if your NFS server is exporting the /usr file system
and whether you can mount from his or her machine. Record your
data below:

Command line: # ________________________________________

System response:

18-40 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Lab—Mounting and Exporting

Again you are to work in partners for this exercise. Your lab partner is
assigned by your instructor. One of your machines is assigned as the
NFS system server and remains the NFS server for the entire lab
procedure. The other machine is assigned as the NFS client and
remains the NFS client for the entire lab procedure. The NFS client
machine mounts the /usr/share directory on a directory called
/usr/share1. The /usr/share1 directory is created on the NFS client
machine.

1. Change directories to the /usr directory and create the share1


directory. Record you data below:

Command line: # ________________________________________

Command line: # ________________________________________

NFS Client
2. On the NFS client, execute an NFS mount of the /usr/share
directory from your NFS server. Record the data below:

Command line: # ________________________________________

System response: ________________________________________

3. On the NFS client, list out the share1 directory. Record your data
below:

Command line: #

________________________________________________________

System response (exact entries can vary):

________________________________________________________

________________________________________________________

Sun NFS Service 18-41

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

Lab—Mounting and Exporting

4. On the NFS client, display your /etc/vfstab and /etc/mnttab


files. Record the data below:

/etc/vfstab file entries (exact entries can vary):

________________________________________________________

________________________________________________________

/etc/mnttab file entries (exact entries can vary):

________________________________________________________

________________________________________________________

If the contents of the two files are the same, try to determine what
went wrong. If you cannot, ask your instructor for assistance. If
the vfstab and mnttab files differ on your NFS client machine,
continue.

5. On the NFS client, unmount /usr/share1. Remember you cannot


be in the /usr/share1 directory when you unmount it. Record the
data below:

Command line: # ________________________________________

6. Check to see if the command worked by displaying your


/etc/mnttab file.

7. Is the NFS mount gone? Yes No

18-42 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1818 18

Lab—Mounting and Exporting

To simulate an unexported item on the NFS server, the NFS client will
attempt to mount an item not currently being exported by the NFS
server (/etc, for example).

NFS Server
8. On the NFS server, use the correct command execution to see if
/etc is currently being exported. Record your data below:

Command line: # ________________________________________

System response: ________________________________________

9. Now, from the NFS client machine, try to mount /etc on the same
directory as before. Record your data below:

Command line: # ________________________________________

System response _________________________________________

10. Log out of your machine.

This concludes the NFS System Service lab.

Sun NFS Service 18-43

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
18

18-44 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
SunInstall 19

Objectives

Upon completion of this module, you will be able to:

■ Identify the three phases of the installation process.

■ Write the minimum required disk space, in megabytes, for


specific partitions on a stand-alone system.

■ Verify your system meets the hardware requirements for


installing the Solaris 2.x user environment.

■ Describe the terms “software package” and “software cluster.”

■ List and describe the four software configuration cluster


options.

■ Perform a custom installation of the Solaris 2.x software.

References

Solaris 2.2 System Configuration and Installation Guide

19-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Software Packages and Clusters

Different terms are used to describe software during and after


installation.

■ Software Packages

■ Software Clusters

19-2 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

Software Packages
■ A software package is a group of files and directories, which
describe a software application, such as the High-Sierra File
system or the on-line manual pages.
✓ The Solaris 2.x software release contains approximately 80 software packages, which total
approximately 300 Mbytes of disk space.

✓ Creating a software package is the standard way to deliver bundled and unbundled
software. Packages are administered using the package administration commands, and
are generally identified by a SUNWxxx naming convention.

Software Clusters
■ During installation, the software packages are grouped into
software clusters, which are logical collections of software
packages.
✓ For example, the System and Network Administration cluster includes the following
packages:

- System and Network Administration Applications

- System and Network Administration Framework

- System and Network Administration Root

■ Some clusters include only one package.


✓ For example, the On-line Manual Pages cluster contains one package—the On-Line Manual
Pages.

■ The cluster names used during installation refer to the


logical names in the Sun environment such as System and
Network Administration, and do not use the SUNW prefix.

SunInstall 19-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Software Configuration Clusters

Software Configuration Clusters consist of:


■ Core System Support

■ End User System Support

■ Developer System Support

■ Entire Distribution

Entire Distribution

Developer

End User

Core

19-4 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

Software Configuration Clusters


The SunInstall utility further groups the software packages and
clusters into four configuration clusters to make the software
installation process easier.

■ Core System Support cluster


✓ This cluster contains the software needed to boot and run the Solaris 2.x environment,
which can be used to configure a standalone system, but not a server. It includes some
networking software and the drivers required to run the OpenWindows environment. It
does not include the OpenWindows software or man pages.

■ End User System Support cluster


✓ This cluster contains the software a user needs to run the Solaris 2.x environment. It
includes the OpenWindows version 3.1 software but not the man pages.

■ Developer System Support cluster


✓ This cluster contains the software needed to develop software in the Solaris 2.x
environment. It includes compiler tools, OpenWindows, and the man pages. It does not
include compilers and debuggers.

■ Entire Distribution cluster


✓ This cluster contains the entire Solaris 2.x release and includes all of the clusters.

Note – Once a software configuration cluster is selected, you may


customize it by adding or deleting software clusters and packages.

Configuration Cluster Sizes


The approximate size of each configuration cluster is listed below.

Configuration Cluster Size


Entire Distribution 273.98 Mbytes
Developer System Support 208.46 Mbytes
End User System Support 138.57 Mbytes
Core System Support 43.71 Mbytes

SunInstall 19-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Software Terminology Summary

Software package
(OW V3)

Configuration cluster OW non-essential


(Developer System Support) OW binary compat
OW online
Software cluster OW demo
OW demo images
OW V3 OW V3 Window
OW V3 OW V3 include
OW online man
OW optional fonts
OW online prog
OW required core
OW static libraries
OW sample source

19-6 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

The Developer System Support configuration cluster contains software


clusters, made up of selected packages.

■ This diagram illustrates the difference between a


configuration cluster, a software cluster, and a software
package.
✓ Once the system is installed, refer to the individual software packages by their package
administration names (SUNWxxx).

✓ For example, the OpenWindows software-package names used with the package
administration commands are:

- SUNWowMITSUNWowman

- SUNWowbcpSUNWowoft

- SUNWowbkSUNWowpmn

- SUNWowdemSUNWowrqd

- SUNWowdimSUNWowslib

- SUNWowdvSUNWowsrc

- SUNWowinc

✓ The package administration commands do not recognize the software installation cluster
names.

SunInstall 19-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Disk Partition and Software Requirements

Server disk partitioning considerations


The partition size requirements for a server can vary greatly
depending on:

■ What software is selected during the installation

■ Will there be diskless client support

19-8 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

Server Disk Partitioning Guidelines


The partition size guidelines listed below are approximately based
on selecting the Entire Distribution configuration cluster.

The / (root) file system contains the /var directory which may
need additional space based on your requirements. For example,
spooling space for printing, mail and name service information.

The “Maximum Required” column identifies the highest amount


of disk space you would need if you installed all available system
software.

File Systems Minimum Maximum Required


/ (root) 12-Mbytes 18-Mbytes
swap 32-Mbytes Default is three times memory size
/usr 30-Mbytes 181-Mbytes
/opt Varies Varies based on configuration

✓ The above guidelines refer to installing the entire distribution.

■ Diskless client support

Each Kernel
File System Each Client
Architecture
/export/root 20 Mbytes 10 Mbytes
/export/swap 24 Mbytes Not Applicable
/export/exec Not Applicable 15 Mbytes

SunInstall 19-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Installation Process

The following steps describe the installation process:

■ Boot from the Solaris 2.x software installation CD-ROM.

■ Gather system identification information.

■ Provide SunInstall with system installation information.

■ Select the Custom Install option (for a standalone system)

■ Select the software to be loaded.

■ Configure the disks to support the selected software.

■ Start the installation.

19-10 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

Before starting an installation, you must gather the following


information because you will be prompted for it during the
installation process.

■ Host name

■ IP address

■ Name service (NIS+, NIS, or none).


✓ If you choose NIS+ or NIS, you are prompted for:

- Domain name

- Name server host name

- Name server IP address

■ Subnetwork mask, if necessary

■ Geographic region

■ Time zone and current date and time

■ Installation type: Quick Install for standalone or dataless


systems or Custom Install for servers
✓ If you chose Custom Install, select the system configuration:

- Standalone system

- Server

- Dataless client

■ Number of diskless clients and the client architecture, if


installing a server

■ The desired software configuration cluster


- Entire distribution

- Core System Support

- Developer System Support

- End User System Support

■ System installation disk(s) and whether you will need to re-


partition the disk(s)

SunInstall 19-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Booting the Release Media

This table identifies the commands for booting the Solaris 2.x
software distribution CD-ROM.

System Type Boot Sequence


Sun4/nnn boot sd(0,30,1)
SPARCstation 1 (4/60)
Boot PROM SPARCstation 1+ (4/65)
revision1.x SPARCstation SLC (4/20) boot sd(0,6,2)
SPARCstation IPC (4/40)
SPARCengine 1E boot sd(0,6,5)
SPARCstation ELC (4/25)
SPARCstation IPX (4/50)
SPARCstation 2 (4/75)
SPARCstation 10 boot cdrom
SPARCserver 630 MP
Boot PROM SPARCserver 670 MP
revision2.x SPARCserver 690 MP
SPARCserver 2000 MP
SPARCsystem 1000 MP
SPARCserver LX
SPARCclassic

19-12 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Notes

Booting from the local CD-ROM


1. Insert the Solaris 2.x software distribution CD into a CD caddy,
and place the caddy in the CD-ROM player.

Note – Use the appropriate boot command listed in the table on the
previous page.

2.x Boot PROMs 1.x Boot PROMs

ok boot cdrom ok boot sd(0,6,2)

> b cdrom > b sd(0,6,2)


✓ Once the system has booted successfully, you are prompted automatically for system
identification information.

✓ The system identification phase is covered on approximately 16 screens, if your system is


connected to a network. The screens are described on the following pages.

✓ The example in this next section describes how to install a homogeneous server (with one
disk), selecting the Entire Distribution software configuration cluster.

SunInstall 19-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Defining the Terminal Type

Specify the terminal type you are using and then press Return.

Note – You will not see this screen if you are installing from a Sun
console.

19-14 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Specifying the Host Name

Enter the system’s host name and then press Return.

Note – The host name must start with a lowercase letter, and can
include digits and hyphens.

SunInstall 19-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Configuring the Network

■ To confirm that the system will be connected to a network,


select Yes with the Arrow keys and then press Return.

19-16 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Identifying the Internet Address

Enter your system’s Internet Protocol address and press Return.

SunInstall 19-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Confirming the Network Configuration

To confirm that the information entered so far is correct, select Yes,


continue and then press Return.

Note – Selecting No will allow you to re-enter the machine name,


network connection, and IP address again.

19-18 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Identifying the Name Service

■ This screen prompts you to select the name service.

Select None - use /etc files with the arrow keys and then press Return.

If you had selected the NIS+ client option, you would be prompted to
supply the following information:

■ Name Service Domain name

■ Name Service Location method

■ Locate the server automatically

■ Specify the host name of the server—If this option is


selected, you are prompted for the server’s host name and
IP address.

Note – A reachable NIS+/NIS server must be available to configure a


NIS+/NIS client during installation.

SunInstall 19-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Configuring Sub-networks

■ This screen prompts you whether your network uses sub-


networks.

Select No and then press Return.

A sub-network is a portion of a larger network that is used to define a


group of systems.

If your network uses sub-networks and you answered yes to this


prompt, you are also prompted to supply a sub-network mask, which
is a number used by software applications to separate additional
network information from the host part of the IP address.

19-20 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Confirming Network Information

To verify that the information you have supplied so far is correct,


select Yes, continue and then press Return.

SunInstall 19-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Identifying the Geographic Region

Use the arrow keys to select your geographic region and press Return.

19-22 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Selecting the Time Zone

Use the arrow keys to select your time zone and press Return

SunInstall 19-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Confirming the Date and Time

Press Return to confirm the current date and time.

Note – If you type an incorrect entry in one of the fields, use the
Backspace key to delete it and then re-enter it correctly.

19-24 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Confirming Time Zone and Current Date and Time

To verify that the information you have specified so far is correct,


select Yes, continue and press Return.

SunInstall 19-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Selecting a Custom Installation

Once the system information is configured, the Solaris Installation


menu is displayed.

Use the Tab key to move to the Custom Install option, which allows you
to customize:

■ System type (server, standalone, dataless client)

■ Software package(s) to be installed

■ Disk partitioning and local mount points

■ Remote file systems to be mounted

19-26 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Custom Installation, System Type

■ Each entry on the Custom Installation menu takes you to


one or more submenus.

Note – You will keep returning to this menu until you are satisfied that
the installation is ready to be started.

Select the System Type option and press Return to bring up the
submenu.

SunInstall 19-27

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

System Type Submenu

■ Use the arrow keys to highlight the desired system type


(Standalone) and press Return to select it (the asterisk
moves)

■ Use the Tab key to highlight Apply and press Return to


finish with this submenu.

19-28 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Custom Installation, Software Selection

Use the Tab key to move to the Software Selection option and press
Return to bring up the sub-menu

Note – End User System Support is selected by default.

Standalone

SunInstall 19-29

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Software Selection Sub-menu

The only reason you will need to edit the End User System Support
software configuration is that it does not include frequently used and
important packages such as SunDiag software.

■ Use the Tab key to move to the Default Software Configuration


area.

■ Use the Arrow keys to highlight End User System Support


and a press Return to select it.

■ Use the Tab key to move to the Edit function and press
Return to activate the Edit function

*
( Apply ) ( Edit . . . )

Note – The displayed disk requirements do not include swap space.

19-30 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Editing the End User System Support Configuration

No matter which software configuration package you edit, the entire


distribution will be displayed.

Different items will be indicated as Selected, Required, or Partially


Selected depending on which Software Configuration package you are
editing.

Use the Arrow keys to move through the listing. There is at least
another screenfull. (approximately 43 items in all)

First page of End User System Support selections

SunInstall 19-31

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Editing End User System Support

Use the arrow keys to highlight Online Diagnostics Tool and press
Return to select it.

Second page of End User System Support selections

Note – It is recommended that you use the Tab key to highlight the
Space button and check on disk drive space requirements.

19-32 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

End User System Support Disk Space Requirements

Record the Minimum and Suggested disk space allocations for later use.

Note – SunDiag software added about 16.85 megabytes to the disk


space requirements.

Press Return to dismiss this display and return to editing End User
System Support.

Use the Tab key to select Done and press Return to finish editing End
User System Support.

The File System Space Requirements display

SunInstall 19-33

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Custom Installation, Disks/File Systems

You have finished editing the End User System Support package and
returned to the Custom Install Configuration menu.

Use the Tab key to move to the Disks/File Systems option and then
press Return.

19-34 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Selecting Available Disks

In this example, there is only one disk to configure.

Note – If you have more than one disk to configure, you will be
returned to this menu to select the other disk(s). Additional disks are
selected by using the arrow keys.

Use the arrow keys to highlight the disk to be configured and press
Return. A pop-up menu will appear.

Use the arrow keys to select Configure Disk on the pop-up menu and
press Return.

Local Disks and File Systems Menu

SunInstall 19-35

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Setting Disk Editing Properties

This menu allows you to set up parameters for use while configuring
disks. It also affects how partition sizes are displayed during the
editing sessions. The default values are usually sufficient.

■ The Initial Disk Configuration option is set to Sun Defaults by


default, which will set up default partition sizes.

■ The Size Editing Units is set to Mbytes by default.

Let the Provide Default Size Hints option default to Yes so that partition
size guidelines will be displayed automatically.

Use the arrow keys to highlight Apply and then press Return.

Disk Editing Properties Menu

Note – If Allow Overlapping Slices is set to Yes, then Display Start/End


Cylinders must also be set and you will have to manually configure
starting and ending cylinders. This is seldom needed.

19-36 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Configuring File Systems Menu

The default partition sizes and related mount points are displayed
below.

Note – It may be helpful to view the suggested space requirements


before starting to modify this slice (partition) map.

Use the Tab key to highlight the Space button to view the disk space
requirements and then press Return.

SunInstall 19-37

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

File System Space Requirements

■ Focus on the Minimum and Suggested disk space sizes for


each of the file systems to be configured.

■ The disk space needed for the /usr/openwin directory is


displayed but it is not created as a separate file system
unless you direct SunInstall to create it separately. The
same is true of /var.

SunInstall uses a standard formula to calculate swap space:

- Two time physical memory for stand-alone systems

- Three time physical memory for servers

File System Space Requirements Menu

Note – It is helpful to write down the size of each file system listed
here to help set up the appropriate file system sizes during disk
configuration.

19-38 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Displaying Default Partition Sizes

No partition is currently defined for the /export/home file system.


You must create this if you wish to have your home directory on this
particular disk drive.

■ The Unallocated Space meter identifies the amount of


unclaimed disk space as partition sizes expand and
contract.

■ Use the Tab key to move through the file system mount
points and size descriptions.

■ If you wish to change a highlighted value, just type in new


information. The old information is automatically erased.

Configuring File Systems Menu

In the example above, root, swap, /opt, and /usr have been
configured to a larger size and the cursor is sitting at the slice 7 mount
point waiting for /export/home to be created. Its size will be set to
use up all of the unallocated space that is left (262 Mbytes).

SunInstall 19-39

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Completed Disk Configuration

Use the Tab key to highlight Apply and then press Return to end the
editing session on this disk drive.

Configuring File Systems Menu

Note – Observe that the /export/home mount point has been created
and that Unallocated Space is now zero.

19-40 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Exiting the File System Menu

Notice that a summary of the new file system mount points is now
shown on the display.

Use the Tab key to highlight Done and then press Return to end the
Local Disks & File Systems configuration.

Note – If there were another disk drive, you could start an editing
session on it at this point instead of selecting Done.

Local Disks and File Systems Menu

SunInstall 19-41

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Starting the Installation

Use the Tab key to highlight Begin Install and then press Return.

Use the Tab key to highlight Continue with Install and then press
Return.

19-42 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

During the Installation

While the installation is proceeding you will see the progress display
below

Progress Display

SunInstall 19-43

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Applying root Password

Apply a root password to your system after the installation is


complete and your system has automatically rebooted.

19-44 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Summary

In this lesson you have learned about:

■ The Solaris 2.x software standalone system configuration.

■ The minimal hardware configuration for a custom


installation

■ The relationship between a configuration cluster, software


cluster, and software package

■ Disk partition requirements for a custom installation

■ The sequence of steps to successfully perform a custom


installation of a standalone system.

SunInstall 19-45

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Lab - SunInstall Custom Installation

The purpose of this lab is to install a networked stand-alone system.

Before you start, complete the configuration sheet at the end of this lab
procedure. You may need instructor assistance.

1. Boot from the Solaris 2.x software release CD-ROM.

2. Specify system information according to the following


information:

■ Your terminal type is a Sun workstation.

■ Your host name is to be specified by your instructor.

■ Your system is connected to a network.

■ Your IP address is to be specified by your instructor.

■ Your system is not a client of a name service.

■ Your system’s network does not have sub-networks.

■ Your geographic region, time zone, date, and time is


appropriate to your site location.

3. Specify the system type and the software selection according to the
following:

■ Choose Custom Install.

■ Choose Standalone for the system type

■ Select the End User System Support cluster and edit it to add
the On-Line Diagnostics package.

19-46 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
1919 19

Lab - SunInstall Custom Installation (continued)

4. Configure the disks and file systems according to the following:

■ Select a practice disk to configure.

■ Configure the Disk Editing Properties to enable:

- SunDefaults

- MBytes display units

- No overlapping cylinders

- No Display Start/End Cylinder

- Yes Provide Default Size Hints.

■ Configure slices 0–6 to the minimum recommended size.

■ Configure slice 7 to be /export/home and add any


unallocated space to it.

5. Start the installation by selecting Begin Install and observe the


progress status indicator

6. After your system reboots automatically, enter an alphanumeric


root password as directed by your instructor.

If your system does not boot successfully, call your instructor.

This concludes the SunInstall lab.

SunInstall 19-47

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
19

Lab - Configuration Sheet

Configuration category Your system

System Configuration Type:


(standalone)

Hostname:
example: venus

IP Address
example: 129.150.28.79

No Subnet

Name Service: None

Software Configuration Cluster:


End User System Support

Disk Layout:
slice 0 /
slice 1 swap

slice 5 /opt
slice 6 /usr
slice 7 /export/home

19-48 SM101, Solaris Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
Appendix-SunInstall Quick Install A

Objectives
Upon completion of this lesson, you will be able to:

■ Identify the hardware requirements for installing the Solaris 2.x


software on a standalone workstation.
■ Define the term “software configuration cluster.”

■ Describe how to prepare an existing system for a quick install.

■ Install the Solaris 2.x software on a standalone workstation.

■ Describe basic system administration terms that are essential to


completing a quick install.

Reference Information
Solaris 2.1 System Configuration and Installation Guide, Chapter 6,
“Installing Solaris 2.1 on a Standalone Machine”

Solaris System Administrator’s Guide, Appendix A, “Installation and


Configuration,” pp. 225-226

A-1

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Introduction

This lesson presents the terminology and information that is required


for a successful standalone installation. The Quick Installation option
is straightforward and easy to use, and you will have a newly installed
system in about an hour.

A-2 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Installation Information

Hardware Requirements
To use the Quick Installation option to install and run Solaris 2.x
software locally, the system must:

■ Be a SPARC-based system.

■ Have 200 Mbytes of disk space.

■ Have 16 Mbytes of memory.

■ Have a CD-ROM drive.

System Identification Information


During the first part of the installation process, you are prompted to
supply the system name and basic network information. Later in this
lesson you will fill out an installation worksheet summarizing the
system identification.

Quick Installation Configuration Option


In this lesson, you will use the Quick Installation option to
automatically install the End-User System Support cluster. This cluster
contains the software needed for the Solaris 2.x release, and includes
the OpenWindows 3.2 environment.

A configuration cluster is a logical grouping of software packages that is


used to facilitate installation. Configuration clusters can be thought of
as typical configurations.

A software package is a functional grouping of files. In the Solaris 2.2


computing environment, all software is delivered as packages.

Appendix-SunInstall Quick Install A-3

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Quick Installation Information

Disk Partitions
Quick Install provides default file systems and disk partitions.

/ (root)

swap Disk
drive
/opt

/usr

/export/home

✓ Unformatted disks should be formatted before starting system configuration or


installation. The suninstall installation software assumes that disks are formatted and
labelled.

Note – File systems and disk partitions are discussed elsewhere in this
course.

A-4 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Installation Information Worksheet

Server

Client

Client

Client Printer server

Printer

Client-server environment

You will need to gather the following information prior to performing


your installation:

System configuration type (server, standalone, or dataless): ________

Host name: ___________________________________________________

IP address: ___________________________________________________

Name service (NIS, NIS+, or none): _____________________________

Name server host name: _______________________________________

Name server IP address: _______________________________________

Subnet (yes or no): ____________________________________________

Save install information (Yes or No): ____________________________

Domain name: ________________________________________________

Appendix-SunInstall Quick Install A-5

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Preparing the System

Before an installation is performed, you must prepare the system.

If you are reinstalling an existing system:

1. Have users close all files and log out.

2. Log in as user root.

The root user (also known as superuser) is a privileged user with


unrestricted access to all system files and commands.

a. Enter root at the login prompt and press Return.

b. Enter the root password at the Password: prompt and press


Return.

c. A password is a word unique to a user account; it is a security


feature meant to verify a user’s identity.

3. Back up all user files and store the backups off-line if you are
reinstalling an existing system.

4. Shut down the system to an idle state:

# halt

If you are installing a new system or you are not concerned about the
existing data on the system, press L1-A.

A-6 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Quick Installation

The installation process requires certain preliminary information


before it can be executed.

1. Insert the Solaris 2.x software release CD into a CD caddy.

2. Insert the CD caddy into the CD drive.

3. Display the first pre-installation prompt by booting the release


media in one of three ways, based on the type of hardware
configuration you have.

a. For a Sun-4™ system enter the following:

> b sd(0,30,1)

b. For a SPARCstation, SPARCstation 1+, IPC™, SLC™, and early


versions of an IPX™ system, enter the following:

> b sd(0,6,2)

ok boot sd(0,6,2)

c. For a SPARCstation 2 system or later versions of an IPX


system, enter the following:

> b cdrom

ok boot cdrom

The information that is needed for the installation is copied into


memory from the CD-ROM. Boot messages appear on the screen, the
OpenWindows environment starts, and the Solaris Install window
appears.
✓ FYI - According to the information received during OS Ambassador training, the reason
OpenWindows runs during the install is because it makes localization of the install
screens easier.

Appendix-SunInstall Quick Install A-7

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Name Form

4. Enter the system’s host name.

■ A host is a computer system in a network computing


environment.
■ A host name is a unique name for a system; each system on the
network must have its own host name.

■ Host names are set by the system administrator, who ensures


each host name is unique. The host name can include letters,
digits, and minus signs, but certain characters such as the
slash (/) are not allowed.

Enter the name of the system and press Return. This example uses
a system named sparc.

sparc

A-8 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Network Form

5. Specify that the system will be connected to a network.

■ A network is a group of computers which, in a Sun


environment, are connected via Ethernet.
■ Select Yes and press Return.

Appendix-SunInstall Quick Install A-9

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

IP Address Form

6. Enter the system’s Internet Protocol (IP) address.

■ An IP address, sometimes called an Internet address, is a


number used by networking software to identify machines
attached to the network. IP addresses are written as four
dot-separated decimal numbers.
■ IP addresses must be unique among all connected machines.
All connected machines could mean a LAN, a WAN, or even
the entire internet.

■ Site IP addresses are assigned by the network administrator or


the system administrator.

Enter the IP address and press Return. This sample uses the IP
address 129.150.212.2.

A-10 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Verification Form

7. Verify the information entered so far. If the information is correct,


select Yes, continue, and press Return.

If any of the information is incorrect, select No, re-enter


information, and Quick Installation returns to Step 5, the host
name form. You then have the opportunity to re-enter any of the
information.

sparc
2

Appendix-SunInstall Quick Install A-11

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Name Service Selection Form

8. Configure the system as a client of the Network Information


Services Plus (NIS+) name service.

■ A name service provides a means of identifying and locating


resources available to a network. A single passwd file, for
example, can be maintained for the entire network. System
files are stored on a machine called a server. Machines that
use these files, but do not have their own copies, are called
clients.
■ The name service product available in the SunOS 4.x
environment and the Solaris 2.x environment is NIS. An
enhanced version, available in the Solaris 2.x environment, is
called NIS+.

Select None and press Return.

NIS+ Client
>None-use /etc files

A-12 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Subnetworks Form

9. Specify that the workstation’s network will not have subnetworks.

A subnetwork is a portion of a larger network that is used to


identify a group of systems.

Note – If your network uses subnetworks, select Yes. In the lab


environment, subnetworks are not used.

Appendix-SunInstall Quick Install A-13

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Verification Form

10. Verify that your latest entries are correct.

■ If they are correct, select Yes, continue, and press Return.

■ If any of the entries needs modification, re-enter it by selecting


No, re-enter information, and then press Return.

The entries in the example are correct. Select Yes, continue, and
press Return.

Name service: None


Network is sub-netted: No

A-14 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Geographic Region Form

11. Enter the correct geographic region, using the Arrow keys to
highlight the correct selection, and press Return.

Appendix-SunInstall Quick Install A-15

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Time Zone Form

12. Enter the correct time zone, using the Arrow keys to highlight the
correct selection, and press Return.

A-16 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Current Date and Time Form

13. Verify the current date and time.

If any changes are necessary, use the Tab key or Return to move to
the appropriate field. Press Return to continue.

Appendix-SunInstall Quick Install A-17

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Verification Form

14. Verify that the last set of information entered is correct.

■ If any of it needs modification, select No, re-enter


information, and press Return. You are returned to the
form shown in Step 15.
■ If it is correct, as the example is, select Yes, continue and
press Return.

05/19/93 09:45

The system identification portion of the installation process is


complete. The next series of menus are used to configure the
system.

A-18 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

SunInstall Main Menu

15. When the SunInstall™ utility’s main menu appears, complete the
standalone installation process.

To start the Quick Install process, select the Quick Install option
and press Return.

Appendix-SunInstall Quick Install A-19

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Software Configurations Menu

An asterisk marks the selected cluster. The default is the End User
System Support configuration cluster, which provides all of the
software necessary for a standalone system. Accept the default and
press Return.

A-20 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Disk Selection Menu

Quick Install presents a menu of available disks on which you can


install the Solaris 2.2 software. Pressing Return accepts the disk
marked with an asterisk as the target for the installation.

After pressing Return, you will see the message Auto-Configuring


disk disk_name.

198 MB

Appendix-SunInstall Quick Install A-21

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Software Configuration Form

16. After the disks are configured, you are shown the default
partitioning and file systems that SunInstall has chosen.

a. Verify the default file systems and disk partitions to confirm


the configuration.

b. Press Return to start the installation.

A-22 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Quick Install Configuration Screen

17. Installation begins. A screen displays the status of the installation.

When the install is complete, the system automatically reboots and


prompts you for a root password.

Appendix-SunInstall Quick Install A-23

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Root Password Form

18. Do not apply a root (superuser) password on the newly installed


system.

Press Return twice.

19. When the installation is complete, the system displays the message
The system is ready and displays the login prompt.

The results of the install can be found in


/var/sadm/install_data/install_log.

A-24 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
AA A

Summary

In this lesson, you have learned that:

■ When performing a Quick Install, system administrators must


provide basic system information, such as host name and network
information.

■ Quick Install provides default file systems and disk partitions.

■ Quick Install automatically installs the End-User System Support


cluster, which has the software needed for you to use the Solaris
2.x environment.

Appendix-SunInstall Quick Install A-25

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993
A

Exercise

Record the answers to the following questions:

1. List the four hardware requirements for a successful standalone


installation with the Quick Install tool.
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________

2. What must you do to an existing system before installing Solaris


2.x software?
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________

3. Define the term “software configuration cluster.”


___________________________________________________________
___________________________________________________________

4. Define the following terms: “host name” and “IP address” and
“domain.”
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
___________________________________________________________

5. Name the default cluster that is installed with the Quick Install
tool._______________________________________________________

A-26 Solaris 2.x Essentials for System Maintainers

Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. SunService November 1993

You might also like