How HPUX Works Concepts For The System Administrator
How HPUX Works Concepts For The System Administrator
How HPUX Works Concepts For The System Administrator
HP 9000 Computers
F//]m HEWLETT
�/:a PACKARD
Third Edition
E0892
Legal Notices
The information in this document is subject to change without notice.
Hewlett-Packard makes no warranty of any kind with regard to this manual,
including, but not limited to, the implied warranties of merchantability and
fitness for a particular purpose. Hewlett-Packard shall not be held liable for
errors contained herein or direct, indirect, special, incidental or consequential
damages in connection with the furnishing, performance, or use of this
material.
Warranty. A copy of the specific warranty terms applicable to your
Hewlett-Packard product and replacement parts can be obtained from your
local Sales and Service Office.
Use of this manual and media supplied for this release are restricted
to this product only. Additional copies of the programs may be made for
security and back-up purposes only. Resale of the programs in their present
form or with alterations is expressly prohibited.
@copyright 1980, 1984, 1986 AT&T Technologies, Inc.
UNIX is a registered trademark of Unix System Laboratories Inc. in the USA
and other countries.
@copyright 1979, 1980, 1983, 1985- 1990 Regents of the University of California.
@copyright 1979 Regents of the University of Colorado, A Body Corporate.
@copyright 1986- 1988 Sun Microsystems, Inc.
@copyright 1986 Digital Equipment Corporation.
.
@copyright 1985-86, 1988 Massachusetts Institute of Technology.
X Window System is a trademark of the Massachusetts Institute of Technology.
MS-DOS and Microsoft are U.S. registered trademarks of Microsoft
Corporation.
OSF /Motif is a trademark of the Open Software Foundation, Inc. in the
U.S. and other countries. Certification for conformance with OSF /Motif user
environment pending.
All rights reserved.
Printing History
This edition documents the 9 .0 release of HP-UX, and is intended as a
companion manual to the System Administration Tasks manual.
The printing date and part number indicate the manual's current edition. The
printing date changes with each new edition. Minor changes may be made at
reprint without changing the printing date. The manual part number changes
when extensive editorial changes are made.
Manual updates may be issued between editions to correct errors or document
product changes. To ensure that you receive the updated or new editions, you
should subscribe to the appropriate product support service. See your HP sales
representative for details.
• September 1989-First edition, as HP- UX System Administration Concepts
• January 1991-Second edition, as How HP- UX Works: Concepts for the
System Administrator
• June 1991-Third edition
• August 1992-Fourth edition
This Edition documents the 9.0 release of HP-UX, and is intended as a
companion manual to the System Administration Tasks manual.
iv
Contents
1. Introduction
Typographical Conventions . . . . . . . . 1-2
Chapter Summaries . . . . . . . . . . . 1-3
The System Administration Manager ( SAM ) 1-4
Related System-Administration Manuals 1-5
2. System Startup
Boot ROM Startup Sequence Overview 2-2
Secondary Loader . . . . . . . . . 2-3
Boot ROM Startup Sequence ( Series 300/400 ) 2-4
Boot ROM Finds a System Console . . . . 2-4
Serial Interface Line Control Switch Pack Settings . 2-5
Boot ROM Tests Hardware . . . . . . . . . . 2-5
Boot ROM Finds and Loads an Operating System 2-6
Unattended Mode . . . . . . 2-6
Boot ROM Search Sequence . . . . . . . 2-7
Boot Search Criteria . . . . . . . . . . 2-8
Series 400 Unattended-Mode Boot Variation 2-9
Attended Mode . . . . . . . 2-9
Boot ROM I/O Configuration 2- 1 1
HP-UX Takes Control . . . . 2- 12
Boot ROM Startup Sequence ( Series 700 ) 2- 13
Attended Mode . . . . . . . . . . . 2- 14
Boot Administration Mode . . . . . 2- 15
Boot ROM Startup Sequence ( Series 800 ) 2- 16
System Boot Overview . . . . . . . 2- 17
Boot ROM Search Sequence ( Series 800 ) 2- 17
Autoboot 2- 17
Manual Boot 2- 18
Autosearch . 2- 19
Contents- 1
HP-UX Startup Sequence .. . . . 2-20
HP-UX Finds the Root File System 2-20
HP-UX Starts the init Process . . 2-20
System Initialization File-/etc/inittab 2-21
Default Run Levels-initdefault . . . . 2-22
Boot Check Run Command-/etc/bcheckrc 2-23
Shared Libraries Check-/etc/recoversl 2-24
Additional Boot Tasks-/etc/brc . . 2-24
Initial Customization Script-/etc/rc . 2-24
Powerfail Routines-/etc/powerfail .. 2-27
Terminal Processes Startup-/etc/getty 2-27
For More Information . . . . .. .. 2-29
3. System Shutdown
Halting vs Rebooting 3- 1
Shutdown vs Reboot 3-2
When to Use shutdown 3-2
When to Use reboot . 3-3
Examples . . . .. . . 3-4
4. Login
Overview of Login . . . .. . . . . . . .
. 4-2
The login Process.. . .. . . . . . . . . 4-3
The Shell Environment Initialization Sequence 4-5
Correcting Typing Mistakes during Login 4-7
The /etc/passwd File . . . . 4-8
Syntax of Entries .. . . . . . ... 4-8
Sample /etc/passwd Entries . . ... 4- 11
Login Tracking Files (/etc/btmp and /etc/wtmp) 4- 12
/etc/btmp . ... . 4- 12
/etc/wtmp. .. . .... . . . . 4- 12
Environment Variables ... . . . . . 4- 13
The Command Search Path (PATH) 4- 15
PATH Variable Format . . ... 4- 15
Commonly Used PATH Directories 4- 15
Specification of Terminal Characteristics (TERM) . 4- 16
Selecting a Value for the TERM Variable 4- 16
Setting TERM with the tset Command . . . . 4- 17
Contents-2
Using stty to Modify and Display Terminal Characteristics. 4- 18
Specifying the Working Environment with System Login Scripts 4- 19
/etc/profile ...... 4-20
/etc/csh.login ..... 4-22
Default Local Login Scripts 4-24
/etc/cl.profile 4-24
/etc/cl.login ...... 4-26
/etc/d
.cshrc ...... 4-28
Sample Bourne Shell.profile Script 4-30
Sample C Shell.login Script 4-32
Key Shell-keysh ....... . 4-34
5. Process Management
What Is a Process? . 5-2
Process Relationships .... . 5-2
Process and Parent Process IDs . 5-3
User and Group IDs (Real and Effective) 5-4
Audit ID (Trusted Systems Only) 5-5
Jobs.... 5-6
Job Control 5-6
Process Groups 5-6
Group Access Lists 5- 7
Sessions ..... 5-7
Processes and Terminal Affiliation 5-8
Attempted read by Background Process Group 5-8
Attempted Write by Background Process Group 5-8
Process Creation ..... 5-9
The fork System Call .. 5-9
The vfork System Call. 5- 10
The exec System Call 5- 1 1
Open Files....... 5- 1 1
Process Termination.... 5- 12
Process Management Commands 5- 13
Understanding Process Status-ps 5- 13
Understanding Process Termination-kill 5- 14
Understanding Relative Process Priority-nice and renice 5- 15
Tools for Monitoring Process Management Performance 5- 16
Process Management and the Kernel ......... . 5- 17
Contents-3
Process Modes . 5- 17
Process Priorities 5- 18
Run Queues 5-19
Process Context 5-21
Process States and Transitions 5-22
Interrupts . 5- 24
Signals . . . . . . . . . . 5-25
Multiprocessing . . . . . . . . 5-26
How Multiprocessing Compares to Uniprocessing 5-26
Symmetry . . . . . . . . . . . . . . . . 5-26
Multiprocessor Boot-Up . . . . . . . . . . 5-26
Scheduling Processes using Semaphores and Spinlocks 5-27
Processor Affinity . . . . . . 5-30
Uniprocessor Emulation Issues . . . . . . . . . . 5-30
6. Run-Levels
What Is a Run-Level? 6- 1
Predefined Run-Levels 6-2
Run-Level 2 6-2
Run-Level 0 6-2
Run-Level s 6-2
The init Process 6-2
/ etc/inittab 6-3
Setting the Default Run-Level 6-4
User-Defined Run-Levels 6-5
Changing Run-Levels . . . . 6-5
7. Memory Management
Physical Memory . . . . . . . . . . 7-2
Power and Data Permanence . . . . 7-2
Transactions between RAM and Disk 7-3
Available Memory 7-3
Lockable Memory . . . . . . . . . 7-5
Secondary Storage . . . . . . . . 7-6
HP-UX Demand-Paged Virtual Memory 7-9
Hardware Perspective on Memory Transactions 7-9
Process-to-Page Mapping 7- 12
Pages . . . . . . . . . . . . . . . . .
. 7- 13
Contents-4
Virtual Address Space....... 7- 13
Configuring Virtual Address Space 7- 14
Per-Process Regions (pregions) ... 7- 14
Per-Process Region Layouts 7- 15
Placement of Segments in Address Space ( Series 300/400) 7- 16
Placement of Segments in Address Space (Series 700/800) 7- 18
Regions ............... 7-21
Virtual Nodes ( vnodes) ....... 7-21
Memory-Mapped Files (Series 300/400/ 700) 7-22
Limitations to Memory Mapping .... 7-23
How the Kernel Executes Processes using Demand Paging 7-24
copy-on-write................... 7-24
Maintaining Page Availability-vhand and swapper Daemons. 7-25
Thrashing .... ................... 7-27
How the Memory-Management System Handles Executable Code 7-28
Standard Executable Code (EXEC_MAGIC) 7-30
Shared Code ( SHARE_MAGIC) ........... 7-30
Demand-Loaded Code (DEMAND_MAGIC) ...... 7-31
Benefits and Shortcomings of Shared and Demand-Loaded
Code...................... 7-33
Comparison of Shared and Demand-Loaded Code... 7-33
Shared Code in an HP-UX Cluster ( Series 300/400/700 only). 7-34
Shared Libraries .............. 7-34
How Shared Libraries are Dynamically Loaded 7-36
Shared Libraries vs . Archived Libraries 7-38
Administering Shared Libraries . .. 7-39
HP-UX Memory-Management Features 7-40
Swap Space Management 7-41
Swap Parameters . 7-42
Device Swap Space .. 7-42
File-System Swap... 7-45
Guidelines for Adding Swap Space 7-45
Sample /etc/checklist Entry for Device Swap 7-46
Sample /etc/checklist Entry for File-system Swap 7-46
Comparing Device and File-System Swap 7-48
Swap Space Priorities . ... 7-48
The swapon Command 7-48
Evaluating Swap-Space Needs 7-51
Contents-5
-
Contents-&
System Shutdown and Startup Guidelines . . . . . . . . 8-47
The /lost+found Directory . . . . . . . . . . . . . . . 8-48
Understanding Use of fsck to Detect and Correct File-System
Corruption . . . . . 8-48
Superblock Consistency 8-50
File System Size 8-50
Free-Block Checking . 8-50
Inode Checking . 8-5 1
Inode Consistency . 8-51
Format and Type 8-52
Link Count 8-52
Duplicate Blocks 8-52
B ad Blocks . 8-53
Inode Size . . . 8-53
Block Count . . 8-54
File-System Connectivity 8!55
Uncorrectable File System Corruption 8-55
Transferring Files between HP-UX and Other Systems . 8-55
File Protection . . . . . . . . . . . . . . . . . . 8-58
Protecting Directories . . . . . . . . . . . . . . 8-60
Setting Effective User and Group ID Bits (suid, sgid) 8-61
Access Control Lists . . 8-63
File Sharing and Locking 8-64
Advisory Locks . . 8-64
Enforcement Mode 8-65
Locking Activities . 8-66
Contents-7
Contiguous vs. Non- Contiguous Allocation of LVM Disk Space 9- 18
Understanding Logical Volumes . . . . . . . 9-21
Allocating Disk Space for Logical Volumes . . 9-23
How LVM Maps Extents to Logical Volumes 9-24
LVM Disk Space Allocation Commands . . 9-24
Understanding Physical Volumes (LVM Disks) 9-25
Sector Size of Physical Volumes (LVM Disks) 9-26
Characteristics and Layout of LVM Disks 9-29
Boot Data Reserved Area (BDRA) . . . 9-30
LIF Information . . . . . . . . . . 9-31
Physical Volume Reserved Area (PVRA) . 9-32
Volume Group Reserved Area (VGRA) 9-33
Volume Group Descriptor Area (VGDA) 9-33
Volume Group Status Area (VGSA) 9-34
Mirror Consistency Record (MCR) 9-34
User Data Area . . . . . . 9-35
Bad Block Relocation Policy . . . . 9-35
LVM Overhead . . . . . . . . . . 9-36
Understanding LVM Configuration Maintenance 9-37
Guidelines for Configuring the Root Volume Group 9-37
The /etc/lvmtab File . . . . . . . . . . . . . 9-37
Dealing with Removable Media and Volume Groups 9-39
LVM Maintenance Mode 9-39
Mirroring . . . . . . . . . . . . . . . . 9-40
I/ 0 Channel Separation . . . . . . . . . 9-43
How Mirrored Logical Volumes are Written 9-47
Allocation Policies for Mirroring . . . . 9-4 7
Scheduling Policies for Disk Writes 9-4 7
Synchronization Policies for Recovering Mirrored Data . 9-48
Manual Synchronization 9-49
Backing Up Mirrored Data . . 9-49
Useful Mirroring Commands . 9-49
Internal Representation of LVM . 9-51
Contents-a
10. System Architectures
Architecture of the Series 300 Bus . 10-2
Model 375-a DI0-11 Implementation 10-3
Processor-I/ 0 Board . . . . 10-5
Graphics Interface . . . . . 10-6
Architecture of the Series 400 Bus . 10-7
Addressing on a Series 300 / 400 . 10-8
Series 300 / 400 Select Codes 10-8
Series 300 / 400 Bus Addresses . . 10- 10
Architecture of the Series 700 Bus . 10- 1 1
Series 700 Modules . . . . . . 10- 13
Addressing on a Series 700 . . . 10- 14
Interpreting Series 700 Hardware Paths using ioscan . 10- 14
Architecture of the Series 800 Bus . . . . . . 10- 15
Hardware Modules Connecting to the Buses 10- 1 7
Addressing on Series 800 . . . . . . 10- 19
HP-PB Implementations-Models 8x2 10-20
Addressing on HP-PB Models 10-21
A Model 8x7 Implementation . . . . 10-23
Addressing Models 8x7 . . . . . 10-26
A Mid-Bus/CIO Implementation-Model 845SE 10-27
Addressing on Mid-Bus/CIO Models 10-27
Factory-Floor Communication . . . 10-28
An SMB Implementation-Model 850S 10-30
Addressing on SMB Models . . . . 10-30
Processor-Memory Bus (PMB) Implementation-Model 890 10-33
Physical Layout of the Model 890 10-33
Addressing on a Model 890 . . . . . . . . . . . 10-36
Model 890 Guidelines . . . . . . . . . . . . . 10-37
Finding Out About the Current System Configuration 10-38
Viewing Hardware Configuration Using /etc/dmesg 10-38
Interpreting Hardware Paths on a Series 800 . . 10-41
Viewing Hardware Configuration Using ioscan 10-41
Contents-9
--
Contents-1 o
Sources for Minor Number and other Device Information . 1 1-44
Device File Name Conventions . . . . . 1 1-45
Naming Disk Devices . . . . . . . . . 1 1-45
Naming Magneto- Optical Disk Devices 1 1-47
Naming Nine-Track Magnetic Tape Drives 1 1-47
Naming DDS-Format Tape Drives . 1 1-48
Naming QIC-Format Tape Drives . . . 1 1-48
Naming Cartridge Tape Drives . . . . 1 1-49
Naming HP-IB Devices ( Series 800 only) 1 1-49
Naming Modem Device Files . . . . . 1 1-50
Contents- 1 1
Series 800 Configuration for CDFS 12- 17
HP-UX Usage 12- 17
Optical Technology . . . . . . 12-18
Rewritable Optical . . . . . 12-18
Why Use Rewritable Optical? 12-19
Hewlett-Packard's Rewritable Optical Products 12-20
HP Series 6300 Model 650/ A - Optical Disk Drive . 12-20
Optical Disk Drive Guidelines . . . . . . . . . 12-20
HP Series 6300 Model 20GB /A - Optical Disk Library System 12-21
Optical Disk Library System Guidelines 12-23
Terminals and Modems . . . . . . . 12-25
Terminal Configuration . . . . . . 12-25
Special Considerations for Terminals 12-26
/etc/inittab Entries for Terminals 12-26
HP-IB Guidelines . . . . . . 12-28
HP-IB Electrical Guidelines 12-29
S C SI Device Guidelines 12-30
13. Networking
Network Architecture and the OSI Model 13-2
HP-UX Networking . . . . 13-3
Networking Documentation . . . . . . 13-4
Contents· 1 2
System Accounting Set-up Guidelines . . . . . . . . 14- 10
Administering System Accounting in a Cluster (Series
300/400/700 only) . . . . . . . . 14- 10
How System Accounting is Turned On . 14- 1 1
How System Accounting i s Turned O ff . 14- 12
Logging In for System Accounting . 14- 12
System Accounting Files . . . . . . . . 14- 13
Files in the /usr/adm Directory . . . . 14- 14
Files in the /usr/adm/acct/nite Directory 14- 15
Files in the /usr/adm/acct/sum Directory 14- 16
Files in the /usr/adm/acct/fi.scal Directory . 14- 16
Disk-space Usage Accounting . . . . . . . . 14- 17
Reporting Disk Space Usage . . . . . . . 14- 17
Computing Disk Resource Consumption by Login-acctdusg 14- 18
Generating Disk Accounting Data by User ID-diskusg 14- 18
Comparing acctdusg and diskusg . 14- 19
Creating Total Accounting Records 14-21
Other Disk-related Commands . . 14-22
A Security Note . . . . . . . 14-22
Accounting for Disk-space Usage in a Cluster (Series
300/400/700 only) . . . . . . . . . . . . . . 14-22
Connect-session Accounting . . . . . . . . . . . . . 14-23
The Key Connect-session Accounting File-/etc/wtmp 14-23
Connect-session Accounting Commands . . . 14-24
Writing Records to wtmp - acctwtmp . . . 14-24
Displaying Connect Session Records - fwtmp 14-25
Fixing wtmp Errors - wtmpfi.x
. . . . . . 14-26
Recording Connect-session Statistics . . . . 14-27
Tabulating Output for Connect-session Accounting-
acctconl . . . . . . . . . . . . . . . . . . 14-28
Heading Columns of acctconl Output-prctmp . . . 14-30
Creating Connect-session Total Accounting Records-
acctcon2 . . . . . . . . 14-30
Process Accounting . . . . . . . 14-31
Turning On Process Accounting 14-32
Turning Off Process Accounting 14-33
Managing the Size of the Process Accounting File pacct 14-34
Checking the Size of pacct-ckpacct . . . . . . . . 14-34
Contents- 1 3
Changing Process Accounting Files-turnacct switch 14-35
Displaying Process Accounting Records - acctcom 14-35
Sample Report using acctcom . . . . . . . . 14-36
Definitions of Information Produced by acctcom 14-36
Additional Capabilities of acctcom 14-37
Formating Options of acctcom . . . . . . . . 14-39
Record Selection Options of acctcom . . . . . 14-41
Process-accounting Report of Commands - acctcms 14-42
Producing a Readable Report - the -a option 14-42
Sample Report by acctcms . 14-42
Header Descriptions . . . . . . . . . 14-43
Additional acctcms Options . . . . . 14-45
Creating Total Process-accounting Records 14-46
User Fees - chargefee . . . . . . . . . . 14-48
Accounting Summaries and Reports . . . . 14-49
Displaying Total Accounting Records - prtacct 14-49
Sample Output by prtacct . . . . 14-50
Report Format of prtacct . . . . . . . 14-50
Origin of Columnar Data by prtacct . . . 14-51
Merging Total Accounting Files - acctmerg . 14-51
Command Options for acctmerg . . . . 14-52
Creating Daily Accounting Information - runacct 14-53
Files Processed by runacct 14-54
Safeguards of runacct . . . . . 14-55
States of runacct . . . . . . . 14-55
Recovering from runacct Failure 14-57
Daily and Monthly Reports of runacct 14-57
Daily Line Usage Report of runacct 14-57
Daily Resource Usage Report . . . 14-58
Daily and Monthly Command Summary 14-59
Last Login . . . . . . . . . . . . . 14-59
Creating Daily Summary Reports - prdaily 14-60
Creating Monthly Accounting Reports - monacct 14-61
Disk Quotas . . . . . . . . . . . . . . . . . 14-62
Planning to Set up Disk Quotas . . . . . . . 14-62
Deciding Which File Systems Require Disk Quotas 14-62
Setting Quotas and Limits 14-63
How Disk Quotas Work . . . . . . . . . . . . . 14-63
Contents- 1 4
Disk-Quotas Data File-quotas . 14-64
How Disk Quotas Appear to Users 14-65
Disk Quota Commands . . . . . 14-66
Enabling and Suspending Disk Quotas-quotaon and
quotaoff . . . . . . . . . . . . . . . . . 14-66
Maintaining File-system Consistency-quotacheck . 14-67
Setting and Editing User Quotas-edquota . 14-67
Editing Disk-Quota Time Limits . . . 14-68
Displaying Users' Disk Quotas-quota . . . 14-69
Enforcing Disk Quotas Remotely-rquotad . 14-70
Manipulating Disk Quotas Programmatically-quotactl 14-70
Summarizing Disk Usage and Quotas-repquota 14-70
Glossary
Index
Contents-15
Figures
Contents- 1 6
8-3. File System /dev/dsk/ lsO Mounted to Root File System at
/users . . . . . . . . . . . . 8- 7
8-4. Disk Sections and Relative Sizes . . . . . . 8- 12
8-5. Examples of Valid Sectioning Schemes . . . . 8- 13
8-6. Track, Cylinder, and Cylinder Group on a Disk 8-27
8- 7. Mapping from Inode to File Data Blocks . . . 8-33
8-8. Inode Addressing Example . . . . . . . . . 8-35
8-9. Buffer Cache Holds the a.out Header of Executing Programs 8-39
8- 10. File Permission Bits . . . . . . . . . . . . . . . 8-59
8- 1 1 . File Permission Bits of rwxr-xr-- . . . . . . . . 8-60
8- 12. Permission Bits of an suid/sgid file set to rwsr-sr-- 8-62
9- 1 . Disk Space Apportioned into Logical Volumes 9-3
9-2. Device File for an LVM Disk (physical volume) . . . 9- 10
9-3. Volume Group , Showing Minor Numbers (shaded) . . 9- 10
9-4. Hexadecimal format of LVM Major and Minor Numbers 9- 1 1
9-5. Sample Verbose Output of vgdisplay . . . . . . . . 9- 13
9-6. Root Volume Group . . . . . . . . . . . . . . . . 9- 17
9- 7. Contiguous vs. Non- Contiguous Mapping of Logical to Physical
Extents . . . . . . . . . . . . . . . . . . . . 9- 19
9-8. Sample Output of lvdisplay . . . . . . . . . . . . 9-2 1
9-9. Verbose Output of lvdisplay, Showing Logical Extents 9-22
9- 10. Sample Output of pvdisplay . . . . . . . . . . . . 9-25
9- 1 1 . Verbose Output of pvdisplay , showing Mapping of Physical
and Logical Extents . . . . . . . . . . . . . . . . 9-26
9- 12. Relationship Between Disk Sector Size and DEV _B SIZE. 9-27
9- 13. Bootable and Non-Bootable Physical Volume Layouts, Showing
Organization of Data Structures . . . . . . 9-29
9- 14. Strict Mirroring of Logical Volume lvol2 . . . . 9-41
9- 15. Three LVM Disks with Mirrored Logical Volumes 9-42
9- 16. Three LVM Disks Mirror a Single Logical Volume 9-43
9- 17. I/O Channel Separation via Separate Interface Cards 9-44
9- 18. I/O Channel Separation via Separate Buses, and using Physical
Volume Groups . . . . . . . . . 9-45
9- 19. Architecture of the LVM Subsystem . . 9-51
10- 1 . Backplane of a Model 375 Workstation. 10-3
10-2. Model 375 Workstation Functions . . . 10-4
10-3. HP Apollo 9000 Series 400 Workstations Block Diagram 10-7
10-4. Series 300/400 Addressing . . . . . . . . . . . . . 10-8
Contents- 1 7
10-5. Models 720/730 and 750/7�0 Rear Panels, showing Ports 10- 1 1
10-6. HP Apollo 9000 Series 700 Bus Architecture. 10- 12
10-7. S ample Model 8x2S Card- Cage Layout 10-20
10-8. Model 8x2S bus architecture . . . . . . . . 10-21
10-9. A typical backplane of a high-end Model 8x7S 10-23
10- 10. Model 8x7S Bus Architecture . . . . . . 10-24
10- 1 1 . Addresssing the Modules of a Model 8x7S 10-25
10- 12. Sample Model 845 card-cage layout . . 10-28
10-13. Model 845 Bus Architecture . . . . . 10-29
10- 14. Sample Model 850S Card- Cage Layout . 10-31
10-15. Model 850 bus architecture . . . . 10-32
10-16. Model 890 Card Cage . . . . . . . . 10-34
10- 17. Bus Architecture of the Model 890 10-35
11-1. Kernel in Relation to the User Environment and I/O Devices. 1 1-2
1 1-2. Kernel Configuration Files. . . . . 1 1-3
1 1-3. System Initialization by the Kernel . . . . . . 1 1-18
1 1-4. Series 800 I/O Auto-configuration . . . . . . . 1 1-19
1 1-5. Device Files Contain Major and Minor Numbers. 1 1-30
1 1-6. Series 700 Minor Number Format . 1 1-38
12- 1 . Magnetic Tape Format . . . . . 12-4
12-2. Organization of DDS-Format Tape 12- 10
12-3. Direct Access Secondary Storage . 12-19
12-4. Optical Disk Library System Concept 12-22
14- 1 . System Accounting Overview . . . . 14-7
14-2. How startup Enables System Accounting . 14- 1 1
14-3. System Accounting Directory Structure 14- 13
14-4. Disk-space Usage Accounting 14- 17
14-5. Connect-session Accounting 14-23
14-6. Process Accounting . . . . 14-32
14-7. Charging Fees . . . . . . 14-48
14-8. Displaying Total Accounting Records 14-49
14-9. How runacct Generates Summary Reports 14-53
14-10. Disk Quotas Flow Chart . . . . . . . . 14-64
14- 1 1 . How repquota Generates Disk-quota Reports 14-71
Contents- 1 8
Tables
Contents- 1 9
1
1
Introduction
Introduction 1·1
1
Typographical Conventions
Throughout this manual, the following typographical conventions are used:
1 -2 Introduction
1
Chapter Summaries
Introduction 1 -3
1
1 -4 Introduction
1
Introduction 1 -5
2
2
System Startup
From the time you boot your system to the time you get a login : prompt ,
the system performs several important tasks automatically. The system tests
computer hardware, loads and initializes HP-UX, communicates messages
to users, and runs scheduled routines . When these system startup tasks are
finished, HP-UX is in the initdefault run-level. As shipped, this is run-level 2
or multi-user HP-UX.
Boot Program
LAN
LG200211_013
From the first available source it finds, the boot program also locates another
program, called a secondary loader, and loads it into memory. The secondary
loader then loads /hp-we into memory and starts it up to enable you to use
your system.
Secondary Loader
The boot program contains code to work with a specific hardware architecture.
The secondary loader is a larger program, whose additional code provides
the flexibility to deal with the changes to the booting process from
operating-system release to release. (From the perspective of the boot program,
the terms operating system and secondary loader are synonymous.)
Further, the secondary loader is written in LIF (Logical Interchange Format) ,
code that i s understood by HP 1000, 3000, and 9000 systems.
The boot program finds the secondary loader on the boot media (typically in
the LIF volume of a mass storage media) , loads it into memory, and starts it
running.
When a serial interface card is selected as the system console, the boot ROM
requires that the line control switch pack settings on the card be set to the
same settings as the connected remote terminal. These settings provide the
communications protocol for the console. Assuming an RS 232-C console,
HP-UX resets the following values :
Stop Bits 1
Baud Rate 9600 bps
Parity /Data O 's/7
Bits
Enq/Ack NO
Pace XON/XOFF
(Handshake)
If the serial interface is part of the built-in Human Interface card, these values
are set appropriately and you need not change them. Other configurations
might require different line control switch pack settings on the interface card;
see the documentation that comes with the card or the console for information.
Unattended Mode
Use the unattended mode of booting if you have only one bootable operating
system online, or if you know the operating system you wish to boot is the first
operating system the Boot ROM will find.
The Boot ROM searches for an operating system by a prioritized list of select
codes. This includes LAN cards, disks, and other peripheral devices . The first
operating system found on one of these devices is loaded. If no operating
system is found, the list will be searched again until a system is found. This
means that disks not found at power-up will be found after their initialization
is complete.
To load HP-UX using unattended mode:
• Make sure that HP-UX is the first system found, following the prioritized list
below.
• Make sure the device holding the HP- UX operating system is fully powered
up and has achieved a ready state before booting the computer. If the disk
drive has not completed its power-up sequence ( which may require several
minutes on some disk drives ) , the Boot ROM will not be able to access the
Configuration Control
Keys Mode Class
1 I/O Configuration
2 Auto System Selection
3 Boot Mode Selection
Attended Mode
The Boot ROM of Models 345, 375, and all Series 400 systems allow you to
change the characteristics of some built-in I/O interfaces .
To select the I/O Interface Configuration menu, enter the key sequence
( Ctrl- C I Return ) , instead of using the space bar, to enter attended mode.
The I/ 0 Interface Configuration menu displays a list of configurable interfaces
( depending on which interfaces are installed in your SPU ) . When you make
a selection, a menu specific to the chosen interface appears with appropriate
configuration choices.
Depending on interface, configuration choices include the following kinds of
settings:
Select Code Set value for most interfaces . ( Select code for
standard HP-IB cannot be reconfigured. )
Interrupt Level Set value for most interfaces.
Remote/Local Convert a serial terminal to system console.
Fast/Normal Set data transfer or handshake speed.
Modem Enable modem handshaking for serial ports.
Parity Check parity of data for SCSI transfers .
Bus Address Set value for S C S I controller bus address.
HP-IB System Controller Enable or disable.
DMA Mode Set the width of data transfers.
Once made, the configuration values are stored in EEPROM, reprogrammable
Electrically Eraseable Read-Only Memory. Like the Boot ROM, the contents of
EEPROM are retained even if power is removed from the SPU.
Note that not all settings apply to every interface. For details on reconfiguring
your internal interfaces , consult BootROM Configuration Mode User's Manual
and Installing Peripherals Manual.
Once the operating system is loaded, the Boot ROM passes program control to
the operating system. The operating system then controls the system until you
re-boot the system. A later section in this chapter, entitled "HP-UX Startup
Sequence," describes what HP-UX does between the time it takes control and
the time you see the login : prompt.
2· 1 2 System Startup
2
System Startup 2- 1 3
--
2
For details on the Series 700 boot capabilities, including boot sequences from a
variety of devices , autoboot , and restore, see the manual page hpux_ 700 ( 1M )
in the HP- UX Reference . Also, see the Owner's Guide for your Series 700
system for information on secondary loader enhancements.
Attended Mode
Each time the computer is powered on, you have the opportunity to interact
with it by entering Attended Mode. For example, you might need to interrupt
the boot sequence for either of the following reasons:
• To redirect the boot sequence.
• To perform a boot administration function provided by the Boot Console
User Interface.
Pressing the (ESCaaj key halts the automatic boot sequence and puts you into
Attended Mode. The system searches the S CSI, LAN , and EISA interfaces for
all potential boot devices-devices for which boot I / O code ( IOD C ) exists.
The system then displays a table, such as the following:
Device Select ion Device Path Device Type & Ut ilit ies
Using the a) option of the Boot Console User Interface main menu, you can
enter Boot Administration mode, from which you can alter default behaviors
exhibited at boot-up or obtain useful information about the hardware as
configured. The following commands are available at the Boot Administration
Mode menu:
AUTO Display stat e of Aut oboot /Aut osearch flags
AUTO SE.ARCH Set state of Aut osearch flag
AUTOBOOT Set stat of Aut oboot £lag
BOOT Boot from Primary/Alternat e path or Specified Device
DATE Read/Set the Real-Time Clock
EXIT Return t o previous menu
FASTSIZE Display/Set FASTSIZE memory parameter
HELP <it em> Display Help informat ion for < item>
IIFO Display boot/revis ion informat ion
Lil_ADDR Display LAI Stat ion Address
OS Display/Select Operat ing System
PATH Display/Kodify Path In£ormat ion
Plll_IRFO Display Processor Internal Kemory In£ormat ion
RESET Reset the System
SEARCH Search for boot device
SECURE Display/set secure boot mode
SHOV Display the results of the previous search
For detailed information on using the Boot Administration mode, see the
Owner's Guide for HP- UX Users for your Series 700 system.
System Startup 2- 1 5
2
2- 1 6 System Startup
2
Autoboot
You should use autoboot except for first-time installation and operating system
reconfiguration. The ISL autoboot on command enables autoboot . No reboot
Manual Boot
Manual boot can be entered by pressing any key during the 10-second override
period in the beginning of the autoboot sequence. When manual mode is
activated, the Boot ROM prompts for the path to be used. The primary boot
path is not altered or disabled.
If you do not want to boot automatically from the primary boot path during
the boot process, disable the autoboot flag in Stable Storage. You can do this
using the ISL auto boot off command. However, this is not normally done
because the autoboot feature makes your system administration tasks more
efficient . Disabling autoboot requires your intervention each time the system is
rebooted. To re-enable autoboot , use the ISL autoboot on command.
2· 1 8 System Startup
2
Autosearch
Many Series 800 computers have a feature called autosearch. If the system
cannot locate the console using the console path from Stable Storage, it
searches for a console device. Then, if the system cannot locate the boot device
using the primary or alternate boot paths and the autosearch flag is set, the
system continues to search for a boot device.
The autosearch flag is much like the autoboot flag. It is in Stable Storage and
can be enabled or disabled. Use the ISL autosearch on command to enable
autosearch and the ISL autosearch off command to disable the feature.
When autosearch is invoked ( if the two paths specified in Stable Storage fail ) ,
the following messages appear on the console:
Autosearch for boot device enabled .
To override , press any key within 10 seconds .
If you press a key, the system responds:
Do you want to cont inue an interact ive search? (Y or N) ?>
If you answer "no," autosearch halts at that point and proceeds to manual
boot . If you answer "yes," the system searches for a boot path, states it,
and asks you if you want to boot from it . If you respond "yes," the system
uses that path. Otherwise, it presents other logical paths until you respond
positively or until it finds no other paths. It then proceeds to manual boot.
The ini t process reads the I etc/ ini ttab file one line at a time, each line
containing an entry that describes an action to take.
The syntax of ini ttab entries is:
The / etc/ inittab file sets up system run levels . The entry marked
initdef ault sets the default run-level to 2:
After bcheckrc exits , ini t call s recoversl to check for the existence of
shared libraries critical to the system. recoversl checks for ( and corrects, if
necessary ) the owner, group , and permissions of these shared libraries.
The shared libraries considered critical to the system are dld . sl ( the dynamic
loader ) and libc . sl. If any of these libraries are missing or damaged,
recoversl guides the system administrator through procedures to recover the
shared libraries from update media.
/etc/ inittab .
A local powerfail is a power failure that halts the computer by affe cting its
central bus. The Series 800 HP-UX operating system provides a mechanism for
recovery from a local powerfail, to ensure that any program running on the
system at the time of failure can resume executing when power to the bus is
restored.
Powerfail routines are invoked from I etc/ ini ttab to ensure that power is
maintained to the system in case of emergency.
p£ : : povervait : /etc/poverfail >/dev/console 2>t1 #power fail rout ines
Once / etc/re has :finished its run-level 2 execution, control returns to init ,
which runs the commands from the process field of all run-level 2 entries in
/etc/ inittab . Typically, /etc/ inittab 's run-level 2 command field entries
consist of I etc/ getty commands, one for each terminal on which users log in.
( When you add a new terminal with the SAM utility, it automatically adds an
appropriate I etc/ getty entry to I etc/ ini ttab.) The I etc/ getty command
runs the login process on the specified terminal, allowing users to login on the
terminal.
For example, the following / etc/ inittab entry runs a getty at the system
console:
cons : 01 23466 : respavn : /et c/getty -h console console # system console
The respawn action field tells ini t to restart the getty process after it dies .
This means that each time you log off the system console, a new login :
prompt is displayed, so you can log in the next time. The 0123456 run-levels
Users can log in at all terminals for which getty processes have been executed.
The sections in this chapter describe the default operation of the system as
shipped to you. However, by altering certain configuration or system files, any
of the procedures can change. If, for example, you write your own /etc/re
script , the paragraphs which follow may no longer apply.
Table 2-2 shows where to look for additional information.
System Shutdown
System shutdown is the process of taking your system from a running state
( either run-level 2 or run-level s ) to a halted state in which no processes are
running. This chapter discusses:
• Halting the system versus rebooting the system.
• Shutdown with the shutdown command versus the reboot command.
• What happens during shutdown.
Halting vs Rebooting
There are two levels of shutdown: halting and rebooting. Halting brings the
system to a complete stop ; in this state, the only way to restart the system
is to cycle power or reset the hardware. Rebooting brings the system to a
complete stop , but restarts the system as if you had booted it.
Whether to halt or reboot your system depends on why you want to shutdown
in the first place: If you want to shut the computer off for an extended period
of time ( for example, to add new hardware or to leave the system off for a long
weekend, etc ) , then halting is appropriate. If you want to shutdown only to
boot the system again ( for example, to use a newly reconfigured kernel ) , then
rebooting is appropriate.
3 Example Description
shutdown -h Shutdown and h alt the system; give users
a ( default ) 60-second grace period in
which to logoff.
shutdown -h 360 Shutdown and halt the system; give users
a 6-minute ( 360-second ) grace period in
which to logoff.
shutdown -r Shutdown and reboot the system; give
users the default 1-minute ( 60-second )
grace period in which to logoff.
reboot -h Shutdown and halt the system
immediately.
reboot Shutdown and reboot immediately.
reboot -t +6 Shutdown and reboot in five ( 5 ) minutes.
reboot -t 22 : 06 -m "please logoff" Shutdown and reboot at 10:05 PM. As
10:05PM approaches, display the message
"please logoft'' at more and more frequent
intervals.
Loginis the means by which users gain access to HP-UX. Beginner's Guide
to HP- UX and Using HP- UX describe how to login. This chapter describes 4
what HP-UX does during login-that is, what happens between the time you
type your usemame and the time you get a shell prompt. Understanding this
procedure, you can modify it for your unique needs. For example, you can:
• Set up logins so that a user gets an application instead of a shell.
• Change all users' default login environments.
• Change all users' default login shells.
Such tasks can be done manually (for example, by manipulating system
files and running various commands) or through the SAM program, which
automatically updates system files and calls appropriate commands for
you. For details on doing various tasks related to login, see the System
Administration Tasks manual.
Note This chapter does not explore the intricacies of logging into
a workstation implementing HP Visual User Environment
(VUE). VUE has its own display and other environmental
requirements, and thus reads its own configuration files. For
information on VUE, consult the HP Visual User Environment
(VUE) System Administration Manual.
Login 4· 1
Overview of Login
Login begins with the I etc/ getty process spawned b y the ini t program.
The getty program prompts the user for a username (login : ) and password,
information which corresponds to the user's entry in the file / etc/passwd.
getty passes the username and password to login, which verifies the user's
validity on the system. login then allows access to the valid user and starts a
shell.
Figure 4-1 shows a sample entry in I etc/passwd for a user named terry whose
4 user ID is 265, group ID is 20, home directory is /users/terry , and login shell
is /bin/ksh. You might wish to refer to this figure when reading the following
section. For details on the / etc/passwd file, see "The / etc / passwd File" later
in this chapter.
/ u sers/terry : / b i n / k s h
L D)f 1 p
terry : Z M P PAvH rX TDfM : 2 6 5 : 2 0 : Terry K e l log :
ID stri n
4-2 Login
The login Process
The login process, described next, is illustrated in Figure 4-2.
1 . login searches the I etc/passwd file for the username.
a. If the username exists, login goes to step 2.
b . If the username does not exist , login:
i. Prompts the user for a password (Password : ) .
ii. Displays the message Login incorrect .
iii. Updates the I etc/btmp file ( if it exists ) , which tracks invalid login
attempts . 4
iv. If the user attempts three consecutive invalid logins , login exits;
otherwise, login prompts the user (login : ) for a username and
repeats step 1 .
2. login checks t o see if the username's password field i s set in I etc/passwd.
a. If so, it prompts the user for a password (Password : ) and goes to step 3.
b . If not , the user need not enter a password; go to step 4.
3. login compares the password to the username's encrypted password in
I etc/passwd.
a. If the password matches, login goes to step 4.
b. If the password does not match, login displays the message "Login
incorrect . " If the user attempts three consecutive invalid logins , login
terminates; otherwise, login prompts the user for a username (login : )
and control passes back to step 1 .
4 . login sets the username's user ID , group ID , and home directory from the
corresponding fields in / etc/pas swd ( see Figure 4- 1 ) . login also updates
the I etc/wtmp file, which tracks valid logins.
5 . login executes the command specified in the command field of / etc/pas swd
( see Figure 4- 1 ) . Typically, the path name of the user's preferred shell. If
the command field is empty, login starts a Bourne shell by default.
Login 4·3
prompt for
-......:.::..:..:-.,.. ond i n p u t
password
ye s
4
es
exec command
exec /bin/sh
END
4-4 Login
The Shell Environment Initialization Sequence
A shell initializes its environment before becoming available to a user:
1. The shell runs the appropriate system login script, which initializes the
user's environment :
As shipped, these scripts define and export for shell use the environment
variables PATH, TZ , and TERM. Since these scripts are run for all users at
login, the system administrator can modify these files to set global defaults
for all users.
2. The shell runs the user's local login script if it exists in the user's home
(login) directory:
Typically, the system administrator initially creates a local login script for
each user. If used to add a user, SAM automatically creates a default local
login script . Users can customize their environment by modifying these files
Login 4-5
-
to suit their needs. The Korn and C shells may have additional local login
scripts :
a. Korn shell-If the ENV environment variable is defined, the Korn shell
runs the file defined by ENV ( typically, . kshrc) whenever a new Korn
shell is started. Many programs ( for example, vi and mailx) allow users
to start a shell from within the program; this is called a shell escape.
The ENV file is re-run for a shell escape, whereas . prof ile is run only at
login.
4
b. C shell-Runs the . cshrc file whenever a new C shell is started. This is
similar to how the Korn shell ENV file works.
c. Key shell-Runs the . keyshrc file whenever a new Key shell is started.
If . keyshrc does not exist , /usr/keysh/C/keyshrc is used.
3. Once all initialization is complete, the shell displays a prompt and waits for
input from the user.
4-6 Login
Correcting Typing Mistakes during Login
During login, HP-UX does not know what kind of terminal the user is logging
in on. Therefore, HP-UX has a primitive set of keys for editing. These key
assignments are:
Does a backspace over the character just typed.
Kills the line (backspace to start of line).
Do not use these characters in usernames or passwords since they cannot be
��. 4
Once the user logs in, these key assignments are usually changed in the
system or local login script via the stty command (see stty(l) in the HP- UX
Reference), as follows:
stty erase -H kill -u
This sets the erase (erase previous character) key to (Backspace ) and sets the kill
(kill to start of line) key to @Ofil.
Login 4-7
The /etc/passwd File
The I etc/passwd file contains essential information required during login.
It contains entries (one per line) for all valid users of the system. Typically,
the system administrator would modify or change these fields when adding
new users to the system. As an easier alternative, the system administrator
could use the SAM program to add users, which adds/changes the fields
automatically (see the System Administration Tasks manual for details) .
4 Syntax of Entries
The general form of I etc/passwd entries is:
, pw_age An optional aging field. Can be used to ensure that a user is forced
to change his or her password every n-week interval, where n is
4-8 Login
defined by the system administrator. This field is comprised of
these parts:
Table 4- 1 .
Password Aging Encryption Characters
Character Weeks
0
I 1
0 through 9 2 through 1 1
A through Z 12 through 37
a through z 38 through 63
Login 4·9
is removed. If min is greater than max, then only the system
administrator can change the password.
See the password example for terry in the next section, "Sample
/ etc / passwd Entries" .
use rid A numeric user ID . Must be unique for each user. The id
command displays this value ( see id(l) in the HP- UX Reference).
groupid Group I D of the group t o which the user belongs. Must b e a valid
group ID defined in /etc/group . The id command displays this
4 value ( see id(l) in the HP- UX Reference).
idstring A character string, typically holds the user's full name.
homedir Directory to use as the home direct ory that is, the directory in
-
which the user is initially placed after logi n. login assigns this
value to the HOME environment variable.
command login runs command using the exec system call ( see exec(2) in the
HP- UX Reference). Any command can be placed in this field, but
typically it contains the path name of a shell: /bin/ksh, /bin/ sh,
/bin/ csh, or /bin/pam.
login assigns this value to the SHELL environment variable.
Users can change their default shell without superuser privelege
via the chsh ( change shell ) command ( see chsh ( l ) in the HP- UX
Reference).
For more details o n the format of the /et c/passwd file, ( see passwd(4 ) i n the
HP- UX Reference).
4- 1 0 Login
Sample /etc/passwd Entries
root : xE5/0 qrnYf8Hg : 0 : 1 : System Administrator : / : /bin/sh
Defines the root user (superuser) with an encrypted password, user ID
0, group ID 1 , ID string "System Administrator" , home directory I
(root) , and who uses the Bourne shell.
michael : , . . : 125 : 10 : Michael Moos e : /users/michael : /bin/ksh
Defines a user named michael who when he next tries to login, the
system will force him to enter a new password (indicated by " , . . " in 4
the password field) . In addition, he has user ID 125, group ID 10, id
string "Michael Moose" , home directory /users/michael , and he uses
the Korn shell.
terry : , 9/ : 265 : 20 : Terry Kellog : /us ers/terry : /bin/ksh
Defines a user named terry who has password aging enabled. login
will force terry to change her password every 1 1 weeks-indicated by
the 9 as the max element of the pw_age field ( , 9 / ) . In addition, terry
cannot change her password more than once a week-indicated by the I
as the min component of pw_age ( , 9/ ) .
guest : /bin/rsh
Defines a guest user who has a restricted shell.
who : : 90 : 1 : : / : /bin/who
Defines a user named who with no password, user id 90, group id 1 ,
home directory I , and command /bin/who . If a user attempts t o login
using username who, the system simply runs the who command and
displays its output to the screen.
date : : 9 1 : 1 : : / : /bin/date
This is similar to the who entry. When the user types date to the
login : prompt, the system runs the date command.
Login 4- 1 1
Login Tracking Files
(Jetc/btmp and /etc/Wtmp)
Two files keep a log of logins : /etc/btmp keeps track of bad ( failed ) logins and
/ etc/wtmp keeps track of successful logins . In HP-UX diskless clusters, these
files are context-dependent files ( CDFs ) .
/etcfbtmp
4 If/etc/btmp exists, the login process updates it automatically whenever a
bad login attempt occurs. To create this file, issue the command:
touch / etc/btmp
Note, you must be root to write to the /etc directory.
Read the I etc/btmp file using the lastb command, to determine whether
unauthorized users are attempting to login ( see last(l) in the HP- UX
Reference).
/etc/wtmp
The login process automatically updates I etc/wtmp whenever a user
successfully logs in. Read this file using the last command ( see last(l) in the
HP- UX Reference).
4· 1 2 Login
Environment Variables
Environment variables define various characteristics of the environment in
which your shell runs. Environment variables consist of a name and a value
(NAME=value ) . Table 4-2 lists the environment variables used by the Korn,
Bourne, and C shells. The assigned values of environment variables are used by
your shell and passed to each process created during a session. For example, if
you type the cd command without any options, it returns you to the directory
contained in the HOME environment variable.
To see a list of all environment variables and their values defined in your shell 4
environment , use the env command (see env(l) in the HP- UX Reference).
Login 4- 1 3
Table 4-2. Shell Environment variables
For details on setting and using environment variables , see Using HP- UX. The
remainder of this section discusses two important environment variables: PATH
and TERM.
4· 1 4 Login
The Command Search Path (PATH)
When you type a command, HP-UX searches all the directories specified by
the PATH variable until it finds the command. If the command is not in a
directory specified in PATH , the system displays:
command_name : Command not found .
If you or users of the system use commands in a particular directory frequently,
you may want to change PATH to include this directory.
4
PATH variable Format
Table 4-3 shows the path names of the most frequently used directories. You
might want to add some ( or all ) of these directories to PATH.
Login 4· 1 5
Remember that directories in PATH are searched in the order in which they
appear ( left to right ) . In general, put the most frequently used directories first
in the path-unless two commands in the search path have the same name (for
example, /bin/rm and $HOME/bin/rm ) . In this example, if you want the shell
to find your version of rm first , put $HOME/bin/rm before /bin/rm in PATH.
$ ls /usr/lib/terminfo/2
2382 2397a 262 1a 2623p 2626-x40 2640a
2392 2500 262 1k45 2624 2626A 2640b
2392A 262 1 262 1nl 2624a 2626P 2644
2392a 262 1 -48 262 1nt 2624p 2626a 2645
2393 262 1-ba 262 1p 2625 2626p 2647
2393A 262 1 -fl 262 1'Wl 2626 2627 2647F
4· 1 6 Login
Table 4-4 outlines the most common terminal and graphics display settings for
Hewlett-Packard equipment . When more than one choice is listed, all choices
are equivalent.
Vectra 2392
Most users have a high-resolution terminal. The first setting you might try is
hp300h. If that doesn't work, try the number of your graphics interface card
( such as 987xx) . You can look in /usr/l ib/terminfo/9 for all the interface
cards beginning with number 9, or /usr/lib/terminfo/h for all interface cards
beginning with hp to find your exact number.
Login 4- 1 7
The tset command is a flexible command that sets the value of TERM and
initializes your terminal characteristics. If you always log in using the same
terminal type, you could change your local login script to eliminate the TERM
prompt. In the local script , this command displays the TERM prompt:
eval ' tset -s -Q m ' : ?hp ' '
-
To customize the above command, replace ?hp with the value of TERM. For
example, the following command initializes your terminal as a high-resolution
graphics display (300h) , but the TERM prompt itself does not display:
4 eval ' tset -s -Q -m ' : 300h ' '
If you use more than one type of terminal ( such as one at work and one at
home ) , you could modify your tset command to include multiple terminal
types. For an example, see "Sample C Shell .login Script" .
It also displays terminal settings if invoked with the -a option; for example:
$ stty -a
speed 9600 baud ; 1ine = O ; susp= -@ ; dsusp
= -@
intr = -c ; quit
= -\ ; erase = -H ; ki11
= -u ; eof
= -n ; svtch
= -@ ; eo1
= -@
-parenb -parodd cs8 -cstopb hupc1 cread c1oca1 -1ob1k -crts
- ignbrk brkint ignpar -parmrk -inpck - istrip -in1cr - igncr icrn1 -iuc1c
ixon ixany ixoff ienqak
is ig icanon -xcase echo echoe echok -echon1 -nof1sh
opost -o1cuc on1cr -ocrn1 -onocr -on1ret -ofi11 -ofde1 -tost op
For details on the use and output of stty, see stty(l) in the HP- UX Reference .
4· 1 8 Login
Specifying the Worki ng Environment
with System Login Scripts
System login scripts contain commands to set a user's environment ; for
example, commands may check mail, set a user's terminal settings, and set
environment variables. System login scripts run before local login scripts. This
section describes the system login scripts /etc/prof ile and /etc/csh . login.
The system login scripts define a default environment . Local login scripts
can override or modify these defaults for each user. Thus , the local login
4
script provides a way for individual users to further modify their working
environment .
Note The /etc/prof ile and /etc/csh . login scripts shown here
may differ somewhat from those on your system. The main
point to be gained from looking at these examples is to
understand, generally, what these scripts do.
Login 4- 1 9
/etc/profile
/ etc/prof ile is the default system login script for the Bourne, Korn, and Key
shells. Its features are described after this example:
# @ (#) $Revision : 66 . 6 $
# Defaul.t system-wide profile file ( /bin/sh initializat ion) .
# This shoul.d be kept to the bare minimum every user needs .
trap " " 1 2 3 # ignore HUP , IBT , QUIT now .
4-20 Login
Task Explanation
Ignore signals The opening trap instruction prevents the login script from being
interrupted, by setting the following signals to be ignored: SIGHUP
( hangup , 1 ) , SIGINT ( interrupt, 2) , and SIGQUIT ( quit, 3) . Signals
are documented in sign al(5) of the HP-UX Reference .
Set PATH Your shell searches the default PATH through /bin, /usr/bin,
/usr/contrib/bin, and /usr/local/bin for the commands you
issue. Your current directory is not included. Likewise, MANPATH
identifies the locations of on-line specifications of the HP-UX
Reference Manual. 4
Set time The TZ variable is set to Mountain Standard Time; change the
zone ( TZ ) setting in /et c/prof ile for other time zones.
Set TERM If the TERM variable is not set , this script sets it to hp.
Export global The export command passes the values of shell variables to
variables subshells. This script exports PATH , MANPATH , TZ , and TERM.
Set stty Sets terminal port to recognize A H as the erase character .
Trap This trap captures the exit signal (0) generated when you log out .
logout When the shell receives this signal, the command "echo logout" is
executed.
Display The cat command displays the contents of /etc/copyright , a file
copyright file of copyright messages required by law.
Display The cat command displays the contents of /etc/motd. This file
motd file contains the message of the day.
Check If the /bin/mail file exists , mail -e checks for mail. If you have
for mail mail, "You have mail" is displayed.
List If the /usr /bin/news file exists, news -n is executed to list the
news items news files in /usr /news .
Check for If the file /tmp/ changetape exists and is readable, the message ,
backup tape "Please change the backup tape" is displayed, instructing you to
remove the tape from the tape drive.
Reset The final trap resets signals 1 , 2, and 3, after which, you can use
signals hangup , interrupt, and quit .
Login 4-2 1
/etc/csh.login
I etc/ csh . login is maintained by the system administrator as the default
system login script for the C shell. This section presents a sample script , and
then explains its contents.
# @ (#) $Revision : 66 . 4 $
# Default ( example of) system-wide profile file (/bin/csh initializat ion) .
# This should be kept to the bare minim11111 every user needs .
if ( -f /bin/mail ) then
mail -e # not i£y i£ mail .
if ( $status == 0 ) echo "You have mail . "
endi£
i£ ( -£ /usr/bin/nevs ) then
nevs -n # not i£y i£ nev nevs .
endif
rm -£ /tmp/changetape
endi£
4-22 Login
Task Explanation
Set path The s et built-in command of the C shell sets path as a local shell
variable. The C shell automatically sets the environment variable
PATH to the shell variable path.
The default path tells your shell to search /bin, /usr/bin,
/usr/contrib/bin, and /usr/local/bin for source when you issue
a command. The current directory is not incJuded.
Set prompt The shell variable prompt is a local shell variable in the C shell.
This script sets prompt to " [n] Y. " , where n is the command event
number. Command event numbers are used with the C shell's 4
command history feature.
s et env MAJJPATH The s et env built-in command of the C shell sets the environment
variable MAJJPATH to search the paths listed for on-line specifications
of the HP-UX Reference Manual.
Set time The TZ variable is set by default to Mountain Standard Time, but
zone ( TZ ) the contents of I etc/src . csh override it .
Set TERM If the TERM variable is not set , this script sets it to hp.
Display The cat command displays the contents of /etc/copyright , a file
copyright file of copyright messages required by law.
Display The cat command displays the contents of I etc/motd. This file
motd file contains the message of the day.
Check for If thefile /bin/mail exists, mail -e checks for mail. If you have
mail mail, "You have mail" is displayed.
List news If the /usr/bin/news file exists, news -n displays the list of news
items files in /usr/news .
Check for If the file /tmp/changetape exists and is readable, the message,
backup tape "Please change the backup tape" is displayed, instructing you to
remove the tape from the tape drive.
Login 4-23
Default Local Login Scripts
When adding a new user, the system administrator should make sure that the
new user has a local login script . HP-UX provides three default local login
scripts:
• /etc/d . prof ile for Korn and Bourne shell users.
• /etc/d . login and / etc/d . cshrc for C shell users.
When adding a new user manually, the administrator copies the appropriate
4 file into the user's directory. For example, if the new user's shell is ksh and
home directory is /users /newuser, the administrator copies as follows:
$ cp /etc/d . prof ile /users/newuser/ . prof ile
Ifthe administrator uses the SAM program to add a new user, SAM
automatically copies the appropriate default local login script into the user's
home directory.
/etc/d.profile
The default local login script resets the value of PATH, and sets terminal
characteristics, the shell environment , and shell variables. This section shows a
sample d . profile and describes its contents.
# @ (# ) $Revision : 66 . 1 $
# De£ault user . pro£ile £ile ( /bin/sh init ializat ion) .
# Set up the t erminal :
eval ' tset -s -Q -m • : ?hp ' '
stty hupcl ixon ixo££
# Set up the search paths :
PATH=$PATH : .
# Set up the shell environment :
set -u
trap "echo ' logout • " O
# Set up the shell variables :
EDITOR=vi
export EDITOR
4-24 Login
Task Explanation
Set terminal The t s et command generates the TERM = (hp) prompt during
characteristics login. Based on the value you enter, the TERM environment
variable is set and the terminal's characteristics are defined. If you
press (Return), TERM is set to hp. Refer to tset ( l ) for more
information.
The stty command sets options for modem connections and
scrolling text on your screen. Refer to stty ( l ) for more information.
Set PATH Changes the value of PATH by adding the current directory to the
end of PATH. 4
Set shell The s et -u command prevents the shell from attempting to execute
environment command lines with undefined shell variables. This command is a
safety feature because, by default , the shell substitutes a null value
for variables that aren't defined. For example, if a script uses a
variable named WORK and you have not assigned a value to WORK , the
script will not execute.
The trap command captures the exit signal (0) that is generated
when you log out . When the shell receives this signal, the command
"echo logout" is executed. ( This trap command duplicates the
one set in /et c/prof ile.)
Set shell Shell variables such as EDITOR are set and exported as global
variables variables . EDITOR is a Korn shell variable that determines which
in-line editor the shell uses.
Login 4-25
/etc/d.login
The default C shell local login script is similar to the Bourne shell / Korn shell
script . The default local login script resets the value of PATH, sets terminal
characteristics, and sets shell variables.
# @ (#) $Revision : 64 . 2 $
t abs
4-26 Login
Task Explanation
Set path The value of path, if set here, explicitly changes the default search
path. Note that for security purposes, the current directory should
be placed at the end of the search path.
Set terminal Because of the question mark in the string ' : ?hp ', tset queries you
characteristics for verification of TERM = (hp) during login. If you press (Return),
TERM is set to hp. If you enter a different value, the TERM
environment variable is set accordingly. See tset ( l ) for information
on the tset command and terminfo (4) on the terminal capabilities
database. 4
The stty command sets options for modem connections and
scrolling text on your screen. Refer to stty ( l ) for more information.
Set shell The local shell variables noclobber and history are set .
variables
The shell variable noclobber restricts output redirection , to prevent
accidental destruction of file contents.
The shell variable history creates your command history buffer and
sets its size . By default , history is set to record the last 20
commands executed. If this variable is not set , you have no
command history and cannot edit and reuse previously executed
commands.
The /etc/d . login ( used by C shell ) differs slightly in syntax and function
from /etc/d . prof ile ( used by Bourne and Korn shells ) . For information you
can use to customize users' shells, consult csh(l), ksh(l), and sh(l) in the
HP- UX Reference Manual
Login 4-27
/etc/d.cshrc
The /etc/d . cshrc default script sets a restricted version of path for your
subshells, sets local shell variables, and defines command aliases .
# Defau1t user . cshrc file (/bin/csh init ializat ion) .
# Usage : Copy this file t o a user ' s home directory and edit it t o
# customize it t o t aste . It is run by csh each t ime it starts up .
# Sample alias :
alias h history
end if
4-28 Login
Task Explanation
Set PATH A restricted path is defined that includes only /bin and /usr/bin.
Since . cshrc executes before . login during the login process, this
restricted value of path is overridden by the path defined in
$HOME/ . login. When subshells are spawned, the restricted value of
path is used.
Set shell If the shell is interactive, various shell variables are set .
variables
The shell variable history creates your command history buffer and
sets its size. In this script, history is set to record the last 20
commands executed. If this variable is not set , your subshells have 4
no command history and you cannot edit and reuse previously
executed commands.
The shell variable savehist tells the shell to record the last 20
commands in the $HOME/ . history file. This file is used as the
history from which the next session starts.
A shell variable system is set to the value output by the hostname
command.
The shell variable prompt is set to the value in the system variable,
followed by the command event number and a colon.
Set command If the shell is interactive, command aliases are set . A command alias
aliases is an abbreviation for a long command line . This script sets an alias
of h for the history command.
The /etc/d . cshrc script also contains sample aliases that are
commented out by default . Because of space limitations , these
commands are not shown in the example. To use these aliases ,
remove the pound sign (#) at the beginning of the line, thus
changing the line from a comment to a command.
Login 4-29
Sample Bourne Shell .profile Script
The Bourne shell is the simplest shell in which to customize your environment .
Only one login script is used, the $HOME/ . prof ile script. This section first
presents a sample prof ile script, and then explains the script commands.
.
In . prof ile, exported variables are passed to all subshells . Variables that are
not exported are used only by the login shell. The following script sets terminal
characteristics, global environment variables, and local shell variables used only
by the login shell. The script also sets up a logout script and displays some
4 system status information.
# Set terminal characterist ics :
eval ' tset -s -Q -m ' : hp ' '
tabs -T$TERM
# Set PATH :
PATH=$HOllE/mybin : /bin : /usr/bin : /usr/contrib/bin : /usr/local/bin :
4-30 Login
Task Explanation
Set terminal This tset command sets and exports the TERM environment variable
characteristics for a default HP terminal. The t s et command also initializes the
terminal's characteristics.
The tabs command with the -T sets the tabs to the default format
for your terminal.
Set PATH This example sets PATH explicitly to search $HOME/mybin, /bin,
/usr/bin , /usr/contrib/bin, /usr/local/bin, and the current
directory. A colon ( : ) separates each directory. The trailing colon
specifies the current directory. 4
Export global The export command allows shell variables to be passed to all
variables commands that you execute. In this script, PATH is exported.
Set local shell The Bourne shell has several pre-defined shell variables. This script
variables sets two: PS1 and CDPATH . (These variables could also be exported
to become global variables.)
PS1 is the primary shell prompt. Its default value is "$ " . In this
script, PS1 is changed to your username, followed by a dollar sign
and a space.
CDPATH sets the search path for the cd command. A colon ( : )
separates each directory. As set here, the cd command searches for
the named directory in the current directory ( ) , the parent
.
Set up logout The Bourne shell does not check for a logout script automatically.
.
script The trap command captures the exit signal (0) and executes the
specified commands . In this example, the trap echoes "logout" and
executes a logout shell script when you log out .
Display The dat e command displays the current date and time . The ' who I
system status we - 1 ' pipe counts the number of users logged in and displays the
information results in the echoed string.
Login 4-3 1
Sample C Shell .login Script
If the C shell is your login shell, HP-UX will look for a . cshrc script and a
. login script in your home directory. The . login script is read after the
. cshrc script when you log in. The . login script sets global environment
variables. This section first presents a sample C shell login script , and then
.
# Set PATH :
set path= ( /bin /usr/bin /usr/local/lib usr/lib . $HOKE/mybin)
4-32 Login
Task Explanation
Set terminal The t s et command sets up your terminal when you first log in to
characteristics an HP-UX system. With the t s et command, the login script can
select between two or more terminal types. This example chooses
between a high-resolution graphics display station (300h) that
functions as the console or a personal computer (pc) logging in via a
1200 baud modem.
To modify this command for your own use, replace console and
=1200 with the descriptions you need. For example, you might set
one option to =9600 ( equals 9600 baud ) and the other to <9600 (less 4
than 9600 baud ) . Then replace the 300h and pc with the terminal
types you use. ( Refer to tset ( l ) for more information ) .
Set PATH The s et command sets local environment variables. PATH is a global
variable, and path is a local variable in the C shell. The C shell
automatically sets PATH equal to path.
This example explicitly sets the entire value of path. The dot ( )
.
Login 4-33
Key Shell -keysh
The Key shell (keysh) is a menu-based, context-sensitive softkey interface to
the Korn Shell (ksh) . With Key shell, you can perform most HP-UX user tasks
with softkeys, rather than command-line entries. Key shell also provides online
help for building softkey commands. Full information on using Key shell is
found in the following locations:
• keysh(l) in the HP- UX Reference Manual.
• Shells: User's Guide
4
4-34 Login
5
Process Management
Understanding how HP-UX manages processes will help you better interpret
how your system carries out its computations. This chapter discusses:
• What a process is.
• How processes are created.
• How processes are killed.
• Commands for managing processes.
5
• How the kernel manages processes.
• HP-UX multiprocessing.
Process Relationships
Processes maintain hierarchical, parent-child relationships. Every process has
one parent , but a parent process can have many child processes . Processes can
create processes, which in turn, can create more processes . The relationships
among processes can be represented by a tree graph. For example, Figure 5-1
shows the relationships among processes P i , P2, P3, P4, PS, and P6 .
The effective user ID and effective group ID allow a process running a program
to act as the program's owner while the program executes. The effective IDs
Job Control
HP-UX supports job control for both the Korn shell and C shell. Job control
provides users with greater flexibility in managing and controlling jobs. For
example, you can:
• Temporarily stop (suspend) a foreground job , by pressing (CTRL}(D. This
can be customized using the stty command. see the HP- UX Reference.
• Bring a background job into the foreground, using the fg built-in shell
5 command.
• Move a foreground job into the background, using the bg built-in shell
command.
For more information, see stty(l), csh(l), glossary(9), and ksh(l) in the
HP- UX Reference. Job control is also discussed in Shells: User Guide and A
Beginner's Guide to HP- UX .
Process Groups
Every process (except system processes , such as init and swapper) , belongs
to a process group. When you create a job , the shell assigns all the processes
in the job to the same process group . Signals can propagate to all processes
in a process group; this is a principal advantage of job control. (Signals are
discussed later in this chapter.)
Each process group is uniquely identified by an integer calle d a process group
ID . Each process group also has a process group leader. The process group's
ID is the same as the process ID of the process group leader. Every process in
a process group has the same group ID .
A process group ID cannot be re-used by the system until its process group
lifetime ends. The process group lifetime is a period of time beginning when
Sessions
Each process group is a member of a session. All processes started during a
single login session belong to a session. Or, think of a session as a login shell
with all the jobs the login shell spawns. On a system running windows or shell
layers, each window or layer is a session.
A process belongs to the same session as its creator (parent) . A process can
alter its session affili ation using the s et s id system call. The shell uses the
s etpgid system call to create jobs and ensure that all processes in a job
belong to the same process group . ( See setsid(2) and setpgid(2) in the HP- UX
Reference.)
A session leader i s the process that created the session via the setsid system
call (normally the login shell). Session lifetime is the period between when a
session is created and the end of the lifetime of all process groups that belong
to the session.
Process Management 5· 7
A special instance of process groups is the orphaned process group. This is
a process group in which the parent process of every member is either itself
a member of the group or is not a member of the group 's session. Terminal
signals (such as ' Z) cannot stop an orphaned process group .
Process Creation
A process can create another process to:
• concurrently execute another program.
• execute another program and wait for its completion.
At a shell prompt, you create a new process by typing the command's name 5
and pressing (RETURN ). The shell is the parent process; the process you create is
the child process. The child process can then create its own child processes, of
which it is the parent .
At the system programming level, a new process is created when a program
calls either the fork or vfork system call. The parent process is the calling
process; the child process is the created process. The system subroutine can
also spawn a child process; system's calling process waits for the child process
to terminate before continuing.
The following section discusses briefly key system calls initiated when you
run a program. For detailed information on the intricacies of processes and
programs, consult the manual Programming on HP- UX , and system(3S),
fork(2), vfork(2), and exec(2) i n the HP- UX Reference .
The vfork system call is functionally identical to fork, and provided only for
backward compatibility.
5· 1 0 Process Management
The exec System Call
Often following the fork system call is an exec to another program. exec is
a system call that overlays separate code and data on top of already existing
process code and data. In this manner a parent process is able to create a new
process using fork, and subsequently execute an entirely different program via
exec.
For example, suppose you are editing a file and need to verify the name
of another file. You might use a shell escape to fork a shell and exec the
program ls.
Open Files
For a process to access files, it must first open them. A process inherits all
open files from the parent . Three files that are usually open are standard input 5
( stdin ) , standard output ( stdout ) , and standard error ( stderr ) . When a
process terminates , the system closes any files opened by the process.
Two configurable operating-system parameters govern the number of open
files permitted per process. The parameter maxf iles defines the soft limit ,
representing the maximum number of open files a process can have without
issuing the setrlimit ( 2 ) system call. By default , maxf iles is set to 60.
The parameter maxf iles _lim defines the hard limit of open files permitted per
process. By default, maxf iles_lim is set to 1024. Only a superuser process
can increase this parameter beyond its hard limit . maxf iles _lim is used
with setrlimit ( 2 ) to change number of open files permitted. maxf iles_lim
can be increased up to a maximum of 2048 or decreased to a minimum of 60.
( Programmatically, you can use sysconf ( ) to get the current value. )
A process's soft limit can be increased up to the hard limit or decreased to
any value greater than number of the highest file-descriptor allocated. An
absolute limit of 2048 is imposed on both hard and soft limits. If the value of
maxf iles_lim is 60, no one can increase their open-file (maxf iles ) limit .
When considering the appropriate setting of soft and hard limits, consider too
the operating-system parameters , nf ile and ninode , because they are affected
as well. ( See Appendix A, "System Parameters" in the System Administration
Tasks manual for descriptions of nf ile and ninode . )
5- 1 2 Process Management
Process Management Commands
From both command level (from a shell) or from SAM (Process Management
area) , you can manage and monitor processes. The most useful tools are
described in this section. HP-UX can also provide system accounting
information for terminated processes (see Chapter 14, "System Accounting" ) .
Including the - e option causes ps to display information for all processes in the
system, not just those of the user who invoked it :
$ ps -e:f
UID PID PPID C STillE TTY TillE COlllU.ID
mickey 25737 25715 14 08 : 48 : 13 ttyp3 0 : 00 xcal1 /usr/local/b:in/xcal1
root 13322 1 0 Jun 6 ? 0 : 00 cron
mickey 24357 1 0 19 : 45 : 46 console 0 : 01 -ksh [ksh]
r\)ot 4 0 0 Jun 6 ? 7 : 15 net isr
Process Management 5- 1 3
If the - 1 ( long ) option is specified, ps displays user ID , state (s), nice value
( NI ) , memory or disk address of the process ( ADDR ) , priority ( PRI ) , and size
( SZ ) in blocks of the process core image. ( State and priority are discussed in
some detail later in this chapter.)
$ p s -1
F S UID PID PPID C PRI !II I ADDR sz VCHAlll TTY TIJIE CDKD
1 R 513 11009 7793 5 179 20 d6e200 16 ttyu4 0 : 00 ps
1 s 0 7792 133 15 154 20 e06100 13 214fb0 ttyu4 0 : 00 rlogind
1 s 513 7793 7792 16 168 20 d:f5a80 52 7ffe6000 ttyu4 0 : 00 csh
All processes have a priority, set when the process is invoked and based on
factors such as who is running the process ( user, system ) and whether the
process is created in a time-share or real-time environment .
The nice command can be used to set a process to run at a lower priority
than would be set by default . nice does not lower the priority of an already
running process . nice is useful for running programs whose execution time is
not critical.
For example, suppose you have a program, named numcrunch, that
manipulates large arrays of data, but the data is not critical to your work
at the moment. How long it takes for the program to manipulate the data
is unimportant; more critical programs should have greater access to CPU
resources. To run numcrunch as a low priority background process , type:
$ nice numcrunch &
Note that both Korn and C shells handle nice slightly differently: ksh
automatically lowers priority of background processes by four; this behavior
can be modified using the bgnice argument . If you specify nice from ksh, it
executes /usr/bin/nice and lowers priority by ten. If you specify nice from
csh, it executes its built-in command and lowers priority by four; however, if
you specify /usr/bin/nice , csh lowers priority by ten.
Process Management 5· 1 5
The renice command allows you to alter the priority of running processes.
Running processes can also be altered from the Process Management area of
SAM.
For details, see nice(l), ksh(l), csh(l), renice(l), and nice(2) in the HP- UX
Reference.
5- 1 6 Process Management
Process Management and the Kernel
You can think of the process control system as containing the kernel's
scheduling subsystem, memory management subsystem, and interprocess
communication ( !P C ) subsystm.
The process control system interacts with the file system when reading files
into memory before executing them. Several processes may be instances of the
same program; for example, more than one person might be using vi at same
time; each invocation of vi is an instance of the same process .
A process reads and writes its own data and stack, but cannot write / read any
other processes'. ( Note, however, shared memory can be read and written by
several processes. )
Processes communicate with other processes via shared memory or system
calls. Communication between processes ( !P C ) includes asynchronous signaling 5
of events and synchronous transmission of messages between processes . System
calls are requests by a process for scme service from the kernel, such as I / O ,
process coordination, system status , and data exchange. All HP-UX system
call s are documented in section 2 of HP- UX Reference Manual.
Much valuable information about CPU usage can be obtained by running
monitor or top from the Process Management area of SAM.
Process Modes
An HP-UX process can execute in two modes-kernel or user mode-and
through its process lifetime, switches between them. Information about the
process ( such as variables , process addresses, buffer counts ) accumulates in a
"stack" for each mode, and it is through these stacks that the process executes
instructions and switches modes.
For Series 300/400, certain kinds of instructions trigger mode changes; for
example, when a program invokes a system call, an entry point in the system
call library is encoded in assembly language and contains "trap" instructions,
which, when executed, cause an interrupt that results in a switch to kernel
mode. When the process executes the instruction, it switches mode to the
kernel, executes kernel code, and uses the kernel stack.
Process Priorities
Processes are chosen by the scheduler to execute a time-slice based on their
priority. Priorities range from 0 ( highest priority) to 256 ( lowest priority) , and
are classified by need. You can see at what priority a process is set to run at
by looking in the PRI column when you invoke ps or top . The following lists
the three categories of priority:
Real-time priority (0- 127) Reserved for processes started with rtprio ( )
system calls.
System priority ( 128- 1 77) Used by system processes.
User priority ( 1 78-256) Assigned to user processes.
The kernel can alter the priority of time-share priorities (128-256) but not
real-time priorities .
5- 1 8 Process Management
Run Queues
A process must be on a queue of runnable processes before the scheduler can
choose it to run. Figure 5-2 shows an abstraction of run queue organization.
Run queues are link-listed in decreasing priority. Each process is represented
by its header on the list of run queue headers; each entry in the list of run
queue headers points to the process table entry for its respective process.
Processes get linked into the run queue based on the process's priority, set in
the process table.
5
Real-lime
1 27
1 28
System
x
-Z. c=J -+ [J[J - - - - - + x
Time
Share 1 77
Priorities 1 78
User
25 6
LG20021 1 _025
Process M anagement 5- 1 9
The kernel maintains separate queues for system-mode and user-mode
execution. When a timeshare process is not running, the kernel improves
the process's priority (lowers its number). When a process is running, its
priority worsens. The kernel does not alter priorities on real-time processes.
Timeshared processes (both system and user) lose priority as they execute and
regain priority when they do not execute.
The scheduler chooses the process with the highest priority to run for a given
time-slice. system-mode priorities take precedence for CPU time. User-mode
priorities can be preempted-stopped and swapped out to secondary storage;
kernel-mode priorities cannot . Processes run until they have to wait for a
resource (such as data from a disk, for example) , until the kernel preempts
them when their run time exceeds a time-slice limit , until an interrupt occurs,
or until they exit . The scheduler then chooses a new eligible highest-priority
process to run; eventuaJ.ly, the original process will run again when it has the
5 highest priority of any runnable process.
system mode
P rocess 1
user mod e
5
I I
I l
P rocess 2
system mod e I
user mod e
l
Time ----.
LG20021 1 _026
Context switching is shown in Figure 5-3. In this figure, the system switches
from executing in the context of process Pi to executing in the context of
process P2. The dotted vertical lines indicate the points of context switching.
Note that context switching can only take place when the process is executing
in system mode.
acquiring
system resources
shell
sends
process
5
gets resource
SIGCONT
process
gets
gets resource
(loses)
time
slice swapper
swaps
out
process
waits for
mode
switch process
ends
LG20021 1 _0 1 8
Symmetry
Multiprocessor Boot-Up
I I
real main main i d 1eo
MONARCH SS
Time -----+ 5
LG20021 1 _0 1 7
1
P2 ---�--1-
,
I
0-·------------ --
Time __,.
LG20021 1 _0 1 5
Processes run concurrently, but each lock may only be held by one process at a
5
time. If another process attempts to acquire an already-held lock, the process
must wait for the lock to be released.
The example shown in Figure 5-7 demonstrates how the kernel allocates critical
regions to concurrently running processes. A process ( P l ) , executing in user
mode on SPU 1 , might take a trap , which interrupts tl;i.e process's execution
and sends it into kernel mode, where it starts executing system code. P l puts
itself on a run queue, which pulls another process ( P2 ) off the run queue. P2
starts to run. Meanwhile, a third process ( P3 ) , executing in user mode on SPU
2, takes a trap into kernel mode and wants to go on the run queue. Since P2
is executing in the critical region and controls the spinlock, P3 must wait ,
spinlocked, until P2 releases the lock; then P3 can continue to run.
I
Run Q
Lock
System Space
I
User Space
SPU 2
5
System Space
User Space
Time ----.
LG200211_018
Figure 5-7.
Kernel Allocates Resources to Three Concurrent Processes on Two Processors
Using Semaphores and Spinlocks
When multiple processes want to access critical resources at the same time,
there is potential for a race condition or failure. Race conditions might occur
any time a program takes an action dependent on data. Spinlocks enable the
kernel to arbitrate between competing processes so that each process gets to
access resources in a prioritized order.
What Is a Run-Level?
A run-level is a system state in which a specific set of processes are allowed to 6
run. This set of processes is defined in the / etc/ initt ab file for each run-level.
You can define up to six run-levels (1-6).
Run levels s and 2 are predefined: s is the administration run-level and 2 is
the normal operating run-level ( users must provide user name to gain access ) .
Most systems do not need to define additional run levels or use any run levels
other than s and 2.
Run-Levels 6-1
Predefined Run-Levels
There are three pre-defined run-levels as shipped: run-level 2, run-level O, and
run-level s.
Run-Level 2
The run-level in which your system automatically boots is called the initdefault
run-level. As shipped, run-level 2 is the initdefault run-level. On multi-user
systems , it may be necessary to make certain, additions to run-level 2 ( such as
the addition of more getty entries to /etc/ inittab ). For more information,
refer to Chapter 2 and the System Administration Tasks manual.
Run-Level 0
Run-level 0 is a special run-level reserved for system installation. Do not run in
run-level 0.
Run-Level s
6 Run-level s is a special run-level reserved for system administration tasks.
Shutting down the system for system administration tasks brings you to
run-level s. Change to run-level s only by using the shutdown command ( i.e. ,
do not execute init s ) . For details on switching to run-level s, see the System
Administration Tasks manual.
6-2 Run-Levels
/etc/inittab
The init process reads the /etc/ inittab file a line at a time. Each line
contains an entry describing an action to take. Typically, entries tell ini t to
run a process in a given run-level or run-levels . For example, the following
entry tells init to run the /etc/getty process in run-levels 0 and 2 through 6:
co : 023456 : respawn : /et c/getty console H
The syntax of inittab entries is:
Run-Levels 6·3
before reading the next entry. When process dies,
run it again.
process This is a shell command to be run, if the entry's run-levels matches
the run-level and / or the action field indicates such action.
Comments of the form # comment can be appended to entries.
6-4 R un-Levels
User-Defined Run-Levels
Because of special requirements , some systems may need additional run-levels
(other than 2 and s). Adding new run-levels involves changing /etc/ initt ab .
For details on creating your own run-levels, see the System Administration
Tasks manual.
Anyone having write permission to the file I etc/ ini ttab can create new
run-levels or redefine existing run-levels. Make sure that the permissions on
/etc/ init and /etc/ inittab are:
-r-xr--r-- root other / etc/init
-rwxr-xr-x root root / etc/ inittab
Changing Run-Levels
When you start up your system, you will be in run-level 2. This means that at
startup your system executed the inittab commands associated with run-level
2. 6
You can move freely between run-levels as long as entering the new run-level
does not kill user or system processes that may have begun in the previous
run-level. (See the System Administration Tasks manual for details on
switching run-levels.) Two examples of possible problems are discussed below:
• If you change to a different run-level, the processes corresponding to entries
in inittab that do not explicitly include the new run-level will automatically
be terminated. For example, assume you are changing from run-level 2 to
run-level 3. If the getty entry for the console does not have the action
respawn for run-levels 3, entering run-level 3 from run-level 2 will cause
the console to die.
• A user logs off prior to a change in run-level. You then change run-levels
from run-level 2 to run-level 4. When the user attempts to log in, he cannot ,
unless his /etc/getty entry contains both run-level 2 and run-level 4.
Run-Levels 6-5
7
Memory Management
7 ·2 Memory Management
Transactions between RAM and Disk
At boot time, the system loads the operating system from disk. (This is
essentially what booting means.) The operating system then resides in RAM
until the system is shut down.
When the user runs programs and commands, they too are loaded from disk
into RAM. When a program terminates, it is usually flushed out of RAM (that
is, the operating system frees the memory used by the process) .
Complex swapping and paging algorithms determine when data and code for
currently running programs will get returned from RAM to disk.
User and system programs write data to disk (for example, to update the
password file or write a database record) . This data-to-be-written is either
written directly to RAM (if raw data) or buffered in cache and written to disk
in relatively big chunks. Programs also read files and database structures from
disk into RAM . Buffering algorithms try to minimize disk access by going to
disk as infrequently as possible; disk access is a bottleneck on all systems.
When you issue the sync command before shutting down a system, all modified
buffers of the buffer cache are flushed ( written) out to disk.
On the Series 800, if the system loses power for a short time and powerfa.il is
enabled, the powerfail routines will put the system in a consistent state and
bring it back up without the user having to reboot it .
There are two other characteristics of physical memory involved at system
start-up: available memory and lockable memory. 7
Available Memory
Not all physical memory is available to user processes. The kernel ( /hp-ux)
always resides in main memory ( that is, it is never swapped) , occupying
approximately 1 .6 MB on a Series 300/400 and 3 MB on a Series 700/800
system. (Note, however, these are static sizes only, and do not include kernel
tables, daemons, device drivers, processes, diagnostics , user interfaces, or other
executing code on a working system.)
The amount of main memory not reserved for the kernel is termed available
memory. Available memory is used by the system for executing user processes.
�---------------
{
7
HP-UX 1------1· �
Kernel at
Boot-up L.----- _
LG200172_01 1 a
D
In CPU
Main
Cache Memory
Input/Output
(VO) Subsystem
1/0 Bus
�l
I
I
network
I
I I
I
I
, __ __ _ _ __ .,, , ..._ __ _ _ __ ..,,,.,
I Swap Sectlo
..._ - - - - -'!-
�wap_dlrecto.!¥
----- I
J
I
L--��ice��------file
d
���!_W� _ _ _ _ _ _ _ _
LG20021 1 _001
7
A transitory form of secondary data storage is termed swap, dating from
early UNIX implementations that managed physical memory resources by
moving entire processes between main memory and secondary storage. Besides
swapping, HP- UX uses paging, a more e:fliicent memory resource management
mechanism for virtual memory.
While executing a program, data and instructions can be swapped ( copied) to
and from secondary storage if the system load warrants such behavior.
Swap space is initially allo cated when the system is configured. Device swap
can take the following forms :
• an entire disk ( Series 300/400/700/800)
• a designated area on a disk ( Series 300/400/700)
You can also configure a file system so that remaining space not used for files is
used for swap; this is termed file-system swap. If more swap space is required,
it can be added dynamically to a running system, as either device swap or
file-system swap .
The swapon command is used to allocate disk space or a directory in a file
system for swap.
-
'--t Vi rtual Access P hysical P hysical Page Offset
i---
Pg. No. I nfo. Pg. No. __. N um ber
i---
in Page
Physical Address
in RAM
LG20021 1 _002
When a process executes, it stores its code (text) and data in processor
7
registers for referencing. If the data or code is not present in the registers , the
processor goes out to the cache, a small high-speed memory between RAM
and the processor, to fill a cache line. If the data is not in cache, the processor
consults the translation tables in RAM that hold the mapping between virtual
and physical addresses of the data. If not in RAM, the data and code might
have to be paged into RAM from disk, in which case the disk-to-memory
transaction must be performed.
A memory management unit (MMU) manages the interface between blocks of
virtual address spaces and their physical memory locations. The MMU also
ensures that processes do not illegally access each others' address space. Access
to data in memory is thus facilitated and protected at a page-by-page level.
An important element of the memory management unit is the translation
lookaside buffer (TLB ) hardware in the processor. The TLB caches the most
7- 1 0 Memory Management
recently used virtual-to-physical address translations with their corresponding
access information. Once an address is translated, it can be used to reference
physical memory.
It is also interesting to compare the relative magnitude of these memory
components. The virtual address space can potentially be a thousand times
greater than the physical address space, while the physical address space might
be a thousand times greater than the TLB . These relationships enable the CPU
to execute programs much larger than the available physical memory. It also
lets you run many more programs at a time than you could without a virtual
memory system.
- - -
- - -
- - - -
- -
- - -
- - -
Virtual Physical
Address Address
Space Space
- - -
- - -
- - -
- - -
- - -
- - -
LG200 172_016a
Process-oriented
proc structure
per-process
virtual address space ---1 region
(preglon)
7 ------------------- ------------
System-oriented
region
page
mapping
LG2001 72_026
Memory Management 7- 1 3
The Series 300 / 400 has a linear address space without base and offset . All
memory is conceptually contiguous . Each process ( including the kernel ) shares
the entire 2 32 ( 4 GB) address range.
On the Series 700 / 800, space registers hold either 16 bits (for 48-bit
addressing ) or 32 bits ( for 64-bit addressing ) and are used to point to the
virtual space to be accessed. The specific location within that space is specified
by a 32-bit quantity called the byte offset .
The present Series 700 / 800 48-bit addressing implementation can be thought of
as having 2 1 6 32-bit spaces .
Operating-system parameters limit the size of the code, data, stack, and
shared-memory segments for each individual process . These parameters have
predefined defaults, but you can reconfigure them in the kernel using the
procedures outlined in the System Administration Tasks manual. The following
list shows configurabl� system parameters for code, data, stack, and shared
memory:
maxts iz Limits the size of the code ( text ) segment.
maxds iz Limits the size of the data segment .
maxssiz Limits the size of the stack segment .
shmseg Limits the number of shared memory segments that can be
attached to a process.
shmmn i Limits the number of shared-memory identifiers.
7
I/ 0 mappings are the ranges of addresses the operating system uses to deal
with 1/0 devices.
When a process executes, the memory management subsystem traverses the
pregions to find pointers to another data structure, called a region, which
points to the address of the desired page of code or data.
The segments of virtual address space for a process reside in virtual memory as
shown in Figure 7-6. In the Series 300/400 memory design, the percentage and
boundaries of memory address are not critical.
As a process is executed, the stack segments grow in the direction shown by
the arrows in Figure 7-6 . Segments are arranged to allow for ample memory
allocation, to prevent overlap that would cause error (such as ENOMEM) and
kill the process.
7- 1 6 Memory Management
( high address) _________
oxFFFFFFFF kernel stack
-----------
�----------
-----------
1/0 mappings
shared memory
m emory-mapped files
shared libraries
-----------
LG2002 1 1 _003
Memory Management 7- 1 7
Placement of Segments in Address Space (Series 700/800)
In the Series 700 / 800, the virtual address space is divided into one-GB
quadrants and addressed by units of 32 bits. Each quadrant has several
segments associated with it , as shown in Figure 7-8 and explained on the next
page.
The basic segments ( quadrants ) of the Series 700 / 800 can be described as
follows:
• First one- GB quadrant always contains the process 's code and sometimes
some of the data.
Text is addressed from OxOOOOOOOO to Ox3FFFFFFF.
• Second quadrant contains data ( static data, stack, and heap ) .
Data is addressed from Ox40000000 to Ox7FFFFFFF.
• Third quadrant , which is addressed from Ox80000000 to OxBFFFFFFF, is
used somewhat differently on Series 700 and Series 800:
o On the Series 700, the third contains shared memory, shared mapped files ,
and shared library code.
o On the Series 800, the third quadrant contains memory-mapped segments
( such as shared-library code ) .
• Fourth quadrant , which is addressed from OxCOOOOOOO to OxFFFFFFFF,
contains shared-memory segments. On the Series 700, fourth quadrant also
contains shared memory-mapped files and shared library code. On PA-RIS C
architecture ( both Series 700 and 800 ) , addresses from OxFOOOOOOO t o
OxFFFFFFFF are used fo r I / O space.
7
On the Series 700, an EXEC _MAGIC user executable ( a . out ) format allows
data to start immediately after the code area in the first quadrant , instead of
at the beginning of the second quadrant , and grow to the beginning of the user
stack. Executables created with this format can handle more than 1 GB of
data; refer to ld( l ) in the HP- UX Reference Manual for information.
Ox80000000
kernel stack
{ === J==
-----------
u area
m axssiz us; stack
private memory-mapped 2 nd quadrant
files
m alloc (heap)
bss
initialized data
7
-- - - - - - - - - - -
1 st quadrant
code (text)
OxOOOOOOOO
(low address)
LG20021 1 _004
Figure 7-7.
Series 700 User Process Virtual Address Space with EXEC_ MAGIC implemented.
Memory Management 7- 1 9
(high address)
OxFFFFFFFF 1/0 mappings
i-- - - - - - - - - - -
OxEFFFFFFF
shared memory
4th quadrant
OxC0002000 -----------
gateway page
OxBFFFFFFF
{ === ]==
Ox80000000
m axssiz user stack
kernel stack
io-- - - - - - - - - - -
{
u area
- - - - ------ 1 -
2 nd quadrant
___ !!!_allo�_(he�)_ _
m a-. bss
�----------
i nitialized data
Ox40000000
1 st quadrant
io-- - - - - - - - - - -
7
code (text)
OxOOOOOOOO
(low address)
LG20021 1 _005
copy-on-write
An HP-UX enhancement to earlier UNIX implementations is the technique of
"copy-on-write." The system used to copy the entire data segment of a process
every time the process forked, increasing fork time as the size of the data and
code segments increased.
On the Series 300/400, HP-UX implements copy-on-write, which enables the
system to create processes more quickly. When a process forks, the parent
process makes a duplicate image of itself at child virtual addresses. But instead
LG200211 _008
Decreasing
Available
Memory
LG200211 _007
vhand decides when to start paging by determining how much free memory is
available.
Thrashing
On systems with very demanding memory needs ( for example, systems that run
many large processes ) , the paging daemons can become so busy swapping pages
in and out that the system spends too much time swapping and not enough
time running processes.
When this happens , system performance degrades rapidly, sometimes to such a
degree that nothing seems to be happening. At this point , the system is said to
be thrashing, because it is doing more overhead than productive work.
Consider, for example, that your system might be thrashing because it is
handling a lot of disk activity. Perhaps a data base is in constant use, yet on
the same disk is swap space. ( On the Series 800, you can check system activity
using the sar(l) command; see the manual page in the HP- UX Reference.) If
so, you can minimize disk activity by moving a busy file system to a different
disk, so that you are distributing busy disk activity among different spindles.
In many cases, even this approach is insufficient . Thrashing is often eliminated 7
by adding more main memory to the system, thus alleviating the need to swap.
This reduces the amount of time the system spends paging and swapping.
1 Executable code that is not page aligned on disk might suffer performance degradation, since it may
be faulted in by a less optimal path.
2 Series 700 EXEC_MAGIC executables will not run on Series 800.
3 Programs built on the Series 800 can be executed on the Series 700; however, footnote 1 applies on
a 4 KB-page size Series 700 for such executables. Note too, executables generated on previous
Series 800 operating systems featuring 2K page size will run, but with some performance penalty.
You might want to recompile for better performance.
Data
I
I
I
Other
LG200211 _008
Figure 7 - 1 1 .
Alignment of Page Boundaries Simplifies Transfer of Data and Code to Memory
The following points might help you determine which kind of executable to use:
• Most programs shipped as shared code by default .
You can tell how the code is shipped by running the f ile command on the
executable, for example:
Y. file /bin/cat 7
/bin/cat : s800 shared execut able
• Demand-loaded code gives flexibility; you can relink user code with ld(l) or
mark programs demand-loaded with chatr(l).
• Both shared code and demand-loaded code reduce the amount of memory
required for user code space when multiple process execute the same
program.
• For both shared code and demand-loaded code, less memory required to run
programs if only a subset of their pages are used, because pages are loaded
only as needed.
Shared Libraries
A shared library is a collection of commonly used subroutines located in one
shared location in memory and which can be invoked dynamically at run-time
by programs that need it .
The libc, libm, l ibM ( the new PO SIX-conformant math library ) , as
well as some X and Starbase libraries are now provided in the /lib and
/usr/l ib directories as shared libraries. A set of shared library routines
/usr/lib/libdld . sl - also provides a user interface to the dynamic loader.
Shared libraries are distinguished from archived libraries by suffix; for example,
the archive form of libc libraries are designated l ibc . a, whereas their
shared-library counterparts are designated libc . s l .
7
A shared library reduces the amount of memory occupied b y code during
execution because only one copy of its routines exists in memory.
When you include a call to an archived library, on the other hand, the library
code is copied to the executable file of the process at link time. Thus , each
executable using a routine has a copy of that routine both on disk and in
memory when running.
libc.a libc.sl
printf
-:::! printf stub to printf ,..... printf
- printf printf
printf copied at stub to printf mapped at
link time run time
""'------
LG20021 1 _01 0
fopen
stub to dld.sl (fopen) � did.SI I
stub to dld.sl (print1) v printf
fopen 7
stub to dld.sl (fopen) H did.SI I
stub to dld.sl (print1) printf
LG200211 _009
Figure 7- 13 shows how the dynamic loader (dld . sl) handles processes when a
user invokes sh. A process is created with multiple stubs pointing to dld . sl.
In this example (more specifically for Series 700/800), two stubs are shown
one stub for fopen(3S ) , other for printf (3S )-both of which are in the same
library. (All the platforms-Series 300/400/700/800-use a linkage table as
well; Series 700/800 use stubs also.)
Memory Management 7 -4 1
Swap Parameters
HP-UX deals with swapping in terms of several parameters :
swchunk The number of DEV _ BSIZE blocks in a unit of swap space, by
default , 2 MB on all systems. ( For information on DEV _ BSIZE ,
see Chapter 8 , "HFS File System" . )
maxswapchunks Maximum number of swap chunks allowed on a system.
min- Number of chunks the system reserves for swapping at boot-up .
swapchunks
swapmem_on Parameter allowing creation of more processes than you have
swap space for. ( See "Pseudo-Swap Reservation," at the end of
this chapter. )
During system startup , the size and location of each swap device is displayed in
512-KB blocks:
st art = xxxxxx indicates the swap space 's starting disk block number
s ize = xxxxxx indicates size of swap space
Drive O . . ..
----
n
1
� Drive O
--6--- ----
Drive 1 Drive O
LIF
Drive 1
u
0 (swap) 7 (swap)
1
files root sr 7
Existing
13 13
usr
Device swap swap
(file system)
I
swap
-
HP-UX allows you to configure swap on several disk drives , making it easy to
expand the swap space. You can have multiple swap volumes per disk.
To enable your swap device each time the system is rebooted, be sure to
include an entry in /etc/checkl ist , as shown:
/dev/dsk/c1d0 s 1 /def ault swap pri= 1
or when using LVM (Series 800 only):
7
/dev/vg00/lvol3 /def ault swap pri= 1
Refer to the checklist(4) manual page of the HP- UX Reference for a thorough
discussion of the fields used when adding device swap.
7 We recommend that you assign the same swapping priority to most swap
devices , unless a device is significantly slower than the rest . Assigning equal
priorities limits disk head movement , which improves swapping performance.
Example Description
/etc/swapon -e /dev/dsk/3s0 Enables swapping to a block device
on a Series 300/400/700 system using
the space after the end of the file
system ( -e option) for swap and
letting the priority default to l .
/etc/swapon -p 0 /dev/dsk/cOdOsO Enables swapping to a block device
on a Series 800 system with logical
number 0, CS/80 drive unit number
0, section 0, with the highest priority
(zero) .
/etc/swapon /dev/vg03/lvol4 Enables swapping on logical volume
l vol4 of volume group vg03 on a
Series 800 system using LVM . (See
the section on Device Swap for
limitations to changing the size of
device swap . Also, see chapter 7,
"Managing Logical Volumes" in the
System Administration Tasks manual
for use of LVM commands .)
/etc/swapon -p 2 -f /dev/dsk/c12d0s0 Forces swapping (-f option) to be
enabled on Series 800 block device
/dev/dsk/c 1 2d0s 0 , even if a file 7
system exists on the device. (Note
that the -f option makes this a
potentially destructive command, to
be used with caution.) The device is
assigned a swapping priority of 2.
Example Description
/etc/swapon /swap -m 256 -1 1024 -r 0 Enables file-system swap to a
-p 3 directory named /swap . Initially, 256
file-system blocks are consumed; no
more than 1 024 file-system blocks
may be consumed. Also, 0 blocks are
reserved for file-system use and this
file system is assigned a swapping
priority of 3 .
/etc/swapon /disk2 -m 0 -1 2048 -r 0 Enables file-system swap t o a
-p 10 directory named /disk2 . Initially, no
( zero ) file-system blocks are
consumed; no more than 2048
file-system blocks maximum may be
consumed. No file-system blocks are
reserved for file-system use. The
swapping priority is 10, meaning that
/disk2 is the least likely file system
to be used for swap space .
/etc/swapon /bigdisk -m 1024 -1 4096 Enables file-system swap to a
-r O -p O directory named /bigdisk. Initially,
1024 file system blocks are consumed,
no more than a maximum of 4096
7 file-system blocks may be consumed.
No file-system blocks are reserved.
/bigdisk is assigned a swapping
priority of 0, meaning it will be used
most often for swap space.
/etc/swapon /dyndisk -m 0 -1 0 -r 2048 Enables file-system swap to a
-p 0 directory named /dyndisk. Although
no file-system space is allocated
initially, no limit is set on the amount
of space that can be used. 2048
blocks are reserved for file system
use . /dyndisk has a swapping
priority of 0-the highest .
HP-UX uses a file system called the High Performance File System ( HFS ),
which is also known as the McKusick ( or BSD) file system. A Beginner's Guide
to HP- UX discusses the file system at the user level; this chapter describes
the structure of the file system and its relationship to the disks on which file
systems reside.
The following additional resources are useful in developing an in-depth
understanding of the HFS file system and how to administer it:
• System Administration Tasks manual, for creating and managing file systems
and disk space.
• Solving HP- UX Problems for repairing file systems and dealing with problems
that arise in managing file systems and disk space.
• section ( 4) of the HP- UX Reference , for specifications of HFS file-system
formats.
To work effectively with file systems, you must understand their
interrelationship with physical disks. Every file of the HFS file system is
stored on a formatted mass storage medium, a disk. The disk is known to
HP-UX by specifying the path name to the disk's device file. Device drivers
in the operating system enable communication to the disk. Each architecture
supports a different set of disks, based on the device drivers written for that
architecture and disk. To access files in a file system, you mount the file system
on a disk, by associating the path name of its mount point to the disk's device 8
file. Once mounted, the file system is accessible to the operating system and
users.
This chapter discusses file-system creation, storage, modification, and
protection.
Note All procedures for creating and maintaining file systems are
found in System Administration Tasks manual, Chapter 5,
"Managing the File System."
There are many reasons why you might add a new file system, including:
• You anticipate that your file system will soon exceed current maximum
8
capacity.
• Your current file system has already reached maximum capacity.
• You wish to separate portions of a file system physically, to restrict growth of
files on a portion of the file system or to increase concurrent access for better
performance.
LG20021 1 _0 1 9
Each type of disk is accessed physically via a compatible interface card that
connects the disk to the computer's bus architecture. Hard disk drives might
use any of the following interfaces-standard or high-speed HP-IB , fiber
8 link ( HP-FL ) , or small computer systems interface ( SCSI ) . The protocol for
each interface is encoded in a specific device driver. ( See Chapter 9 , "System
Configuration," for information on device drivers, device files, and configuration
concepts . )
The operating system accesses physical devices logically through both the
device driver and device special files.
LG20021 1 _021
Figure 8-2. newfs Builds the Disk Infrastructure for a File System
HP-UX cannot use media to store files until you place a file system on it. You
can create a new file system using SA M , mkfs(lM), or newfs(lM). Of the two
manual commands, newfs is easier to use. When you create a file system, you
create an environment to contain files, much like building a "file cabinet" for
paper files. When first built , the file cabinet is empty. Then you add files.
To create a file system, you specify disk type to the newfs command, which
then locates it in the I etc/ diskt ab file of disk characteristics and extracts
key values, including block and fragment size, number of bytes per inode,
8 percentage of reserved free space, and rotational delay. The newf s command
uses this information to create the infrastructure on the media necessary to
support the file system's data structures.
Procedures for building a file system are documented in System Administration
Tasks manual, Chapter 5, section entitled, "Creating File Systems Using the
newfs Command."
I
I
File System , - - - -, - - - - -1
/dev/dsk/1 so Cindy joe zack
LG200211 _022
Figure 8-3. File System /dev/dsk/1 s0 Mounted to Root File System at /users
After creating a file system, the file system has to be mounted ( attached ) to
the HP-UX file hierarchy, using the mount(lM) command. This incorporates
the file system into the existing file system's overall hierarchy. You do this by
logically associating the root directory of the new file system with a mount
point, a directory on the existing file system. Once a file system is mounted,
the mount points are seamless . You can access the new mounted disk space as
a contiguous part of the entire HP-UX file-system hierarchy. Figure 8-3 shows
a mounted file system.
To mount a file system:
• make a mount point directory ( using the mkdir command ) for the file
system.
• mount the newly created file system to the mount point ( using the mount
command ) .
If need be, an existing file system can be moved to a different location on the 8
HP- UX file hierarchy by unmounting ( detaching ) it from its current location
using the -u option ( or umount command ) of mount(lM) and remounting
the file system. A file system cannot be unmounted if any files are open or if
any user's current working directory is in that file system. You can use the
fuser(lM) command to identify which processes are using a file system or file
structure, and if necessary, terminate them. The shutdown command unmounts
Disk Layout
The disk layout is the geometry applied to a physical disk. For each platform,
the /etc/disktab file lists the disk geometry of each disk model available.
Typically, a disk is divided into areas that can accommodate file systems or
raw I/O , dump , and swap . A disk from which the system can be booted is
called a root disk, is organized somewhat differently from other disks, and is
8 discussed later in this chapter. Non-root disks typically contain a single swap
area, file systems , or a combination of both.
The following sections show the layouts of HP-UX disks for each architecture.
Note, only Series 800 disks support disk sectioning and logical volume
management .
Cylinder group n 8
Cylinder group n
A Series 700 feature, Software Disk Striping ( SDS ) , groups disks into arrays;
data on these disks can then be managed as if occupying a single disk. For
full information, see sdsadmin(lM) in the HP- UX Reference Manual and the
manual, Improving Performance with Software Disk Striping.
LG20021 1 _023
When you create a new file system using the mkfs or newfs commands, or the
8
SAM program, you declare what section the file system is to be mounted on.
( For procedures on creating a file system, see the System Administration Tasks
manual. ) You must be careful not to use overlapping disk sections ( as shown in
Figure 8-4 and at the beginning of the / etc/diskt ab file ) .
For example, if you create a file system on section 1 1 on the 7935 disk, you
cannot allocate sections 2, 3, 4, 5, 8, 9, 10, 12, and 13 for other file systems,
6 1-------1
0 1-------t 7
1 1-------t
1 0 1-------t 1 0 ....,_____....
3 1-------t
8
4 1-------1
5 ._____....
LG2001 72_035
Logical Volumes
The Logical Volume Manager (LVM) , available on Series 800 systems, enables
you to partition disks in a more flexible manner than with traditional disk
sections. Using LVM, you combine one or more disks (physical volumes) into a
volume group , which can then be subdivided into logical volumes.
Logical volumes resemble disk sections, but with some important differences:
• You can define the size of a logic al volume according to need.
• You can extend or reduce the size of logical volume as needs change.
• Logical volumes can span disks . This enables you to create very large logical 8
volumes, or use small portions of disk space more efficiently.
• You can mirror logical volumes, using an optional product , LVM Mirroring.
Logical Volume Manager (LVM) is the subject of a separate chapter in this
manual and in System Administration Tasks manual.
8· 1 4 H F S File System
bO Series 300/400/700: Block size in bytes .
Series 800: Block size of section 0 in bytes. Subsequent
block sizes are listed bi through b15, corresponding to their
respective section. Default block size for all systems is 8K.
fO Series 300/400/700: Fragment sizes in bytes ( lK, 2K, or 4K
are supported ) .
Series 800: Fragment size of section 0 in bytes. Subsequent
fragment sizes are listed f 1 through f 15, corresponding to their
respective section. Default fragment size for all systems is l K .
se Number of bytes per physical sector.
rm Rotational speed of disk platters by revolutions per minute.
Not all abbreviations are used on all systems.
The contents of /etc/disktab are used by the newfs command. On the Series
300/400/700, / etc/diskt ab provides multiple entries for any given disk, to
enable you to specify to newf s whether you want portions of a disk used for
swap and boot .
If you are partitioning your disks using traditional disk sections, the Series 800
I etc/ diskt ab file is useful for determining valid disk sections because it shows
Figure 8-4, from which you can ensure that you neither overlap disk sections
or leave gaps. /etc/diskt ab 's listing of each disk with the size of each section
enables you to calculate available disk space.
If you are using the LVM , you have less cause to refer to / etc/disktab ,
although you might refer t o i t when you want t o use non-default settings for
file-system specification ( for example, to change the fragment size, customize
the various file-system sizes ) . Before adding a physical volume ( disk ) to a
volume group , you might consult / et c/diskt ab to get an idea of the disk size.
Be forewarned, however, that once you add the physical volume, the LVM uses
a portion of the disk ( as much as 1 MB ) for its data structures , so the size
8
provided by reading section 2 of I et c/ diskt ab for a given disk is larger than
the actual size you have available.
For full specifications, see disktab(4) in the HP- UX Reference.
With the -b option, /et c/diskinfo returns the size of the disk in 1024-byte
sectors.
Y. /etc/diskinfo -b /dev/rdsk/c0d0s2
55805 1
% bdf
fll ivol n 2
Volume Group /dev/vgn 3 N/A
Logical Volume /dev/vgn/lvol n 4 /dev/vgn
1 ( )
LVM disks physical volumes are named for section two, the entire
disk.
2 The r in the file name denotes "raw" (also called "character" ) and
refers to the way data is streamed, in characters rather than blocks,
or as raw data rather than blocks of data.
3 (This is not a block special file, but a directory. ) Directories for
volume groups are numbered vgOO , vg01 , vg02 , . . . vgnn , in order
created.
4 Device files for logical volumes are listed in the subdirectory for the
volume group to which they belong.
/dev/vgOO
Volume
Group
(pool of disks)
-r-
_{> __ tdevtvsoo11vo11
Logical
Volumes
(apportioned
disk space)
LG200211 _027
You can use SAM to create a file system in a logical volume of a specified size,
and then mount the file system.
Or using commands, you can create and then exten'd a logical volume to
allocate sufficient space for file system, user application, or raw data. You
would then create and mount new file systems or install your application in the
logical volume. You use the same approach when increasing the capacity of a
file system created on a logical volume. 9
Advisory Locks
A solution to this problem common to file sharing is called file locking . In
HP-UX, file locking is done with the lockf or fcntl system calls, which handle
two modes of functionality. Advisory locks are placed on disk resources to
inform (warn) other processes desiring access that a file is currently being
accessed or modified. Advisory locks are only valuable for cooperating
processes that are both aware of and use file locking.
In our example, the programs used to access the on-line reports can use
advisory locks. When George begins to work on the Marketing project his
8 program can call lockf and set an advisory lock. A few minutes later when
Sarah tries to access records in the Marketing report , she would get an error
message indicating that the report is busy. Her program could wait until
George is done and then access the report , by using the system call, lockf .
binary
' '
V ---....
v---1 '""'---..v---' '""'---..v---'
octal 6 7 5 4
where:
Q;::uo-ct-al di.git
inary 0 0
I I I
y y y
octal 7 5 4
where:
D =octa l di it
Protecting Directories
Directories, like all files in the HP-UX file system, have permissions . The
format of a directory's permission bits is identical to that of an ordinary file;
however, the read, write, and execute permissions have a slightly different
meaning when applied to a directory.
• Read permission grants access to display the contents of a directory.
• Write permission grants access to add a file to the directory, rename a file
within the directory, and remove a file from the directory. Users (even
superusers) cannot write directly to the directory itself. Only the kernel can
write directly to directories.
• Execute permission grants access to search a directory for a file. If execute
permission is not set , the files below that directory in the file-system
hierarchy cannot be accessed, even when you supply the file's correct path
name.
8
Setting the sticky bit on a directory provides additional protection to files
within the directory: files cannot be removed from the directory except by
the owner of the file, the owner of the directory, or a user having appropriate
privileges. (See rm(l) in the HP- UX Reference Manual.)
inary
\ J J \ J I
y y y y
octa l D D D D
where :
D =octa l d i it
Each octal digit represents a three-bit binary value: one bit specifies read
permission, one bit specifies write permission, and one bit specifies execute
permission. If the bit value is one, then permission is granted for the associated
operation. Similarly, if the bit value is zero, permission is denied for the
associated operation.
For example, assume a file's permission bits are set to 754 ( octal ) . Octal
754 is equivalent to 1 1 1 101 100 binary. The 11 command represents this as
rwxr-xr-- . As shown in Figure 8- 1 1 , the file's owner may read, write, and
execute the file, while read and execute permission is granted to members of
the file-owner's group . This includes any user ( except the file's owner ) whose
effective group ID equals the ID of the file's group, or whose group access list
includes the file's group ID . All other system users may only read the file.
8
Note, if a file has associated Access Control List ( ACL ) entries , a + is displayed
following the permissions. By default , the chmod command deletes any ACL
entries , but you can use the -A option to preserve them. For more information
on ACLs, refer to A Beginner's Guide to HP- UX , HP- UX System Security, and
acl(5) in the HP- UX Reference .
File Protection
When created, each file in the file system is assigned a set of file protections
stored in the file permissions bits ( often called the file's mode ) . The file
permission bits determine which classes of users may read from the file, write
to the file, or execute the program stored in the file. Read, write, and execute
permissions for a file can be set for the file's owner, all members of the file's
group ( other than the file's owner ) , and all other system users.
These three classes of users ( user, group , and other ) are mutually independent ;
that is, no member of one class of users is included in any other class of users.
When a file is created, it is associated with an owner and a group ID . For
example, a file created by pj w in group dbase is listed as being owned by user
8
pj w of group dbase . These values specify which user owns the file and which
group has special access capability.
The default permissions of a file are initially determined by umask ( set
systemwide, in the users' environment file, or on the command line ) , or by
parameters passed to creat , mknod, or mkdir system calls when the file is
created. The permissions can be changed with the chmod command.
File permissions are represented as the binary form of four octal digits as
shown in Figure 8- 10. The initial discussion deals with only the three least
8 The directory inode number entry for " . . " should be the second entry in the
directory data block. Its value should be equal to the inode number for the
parent of the directory entry (or the inode number of the directory data
block if the directory is the root directory) .
If the directory inode numbers for "." and " . . " are incorrect , fsck replaces
them with correct values .
Bad Blocks
Contained in each inode is a list or pointer to lists of all the blocks claimed
by the inode. fsck checks each block number claimed by an inode for a value
outside the range of the file system (lower than that of the first data block or
greater than the last block in the file system ) . If the block number is outside
this range, the block number is a bad block number.
fsck prompts the operator to clear the inode.
Series 800 systems using LVM have another mechanism for relocating bad
blocks . LYM bad block relocation is discussed in Chapter 9, "Logical Volume
Manager" .
lnode Size
Each inode contains a 64-bit ( eight-byte ) size field indicating the number of
characters in the file associated with the inode. f s ck uses the inode size field
to check for size inconsistencies.
fsck calculates the number of blocks that should be claimed by an inode by
dividing the number of characters in the file by the number of characters per
block and rounding up to get the number of direct blocks. fsck then counts
actual direct and indirect blocks associated with the inode. If the actual
number of blocks does not match the computed number of blocks, f s ck warns
of a possible file-size error. This is only a warning because HP-UX does not fill
in blocks in sparse data files.
A directory inode within the HP-UX file system has the mode word set to 8
Link Count
Duplicate Blocks
Duplicate blocks can occur from using a file system with blocks claimed by
both the free-block list and other parts of the file system.
8
Each inode contains a list ( or for large files, pointers to lists in indirect blocks )
of all blocks containing its file's data. fsck compares each block number
claimed by an inode to a list of allocated blocks. f s ck updates the list of
allocated blocks to include the block number. If a block number is already
claimed by another inode, fsck adds the block number to a list of duplicate
blocks.
lnode Checking
lnode Consistency
Individual inodes are less likely than superblock summary information to be
corrupted. However, because of the great number of active inodes, it is possible
that a few inodes might become corrupted.
The inodes list is checked sequentially, from inode 2 (inode 0 marks unused
directory slots and inode 1 is reserved for future use) to the last inode in the
file system.
The inode structure is defined in /usr/ include/sys/ inode . h. There are two
major types of inodes: primary and continuation. Continuation inodes contain
only a mode (which is of type continuation) , a link count , and access control
list (ACL) entries. Continuation inodes exist only if a file has optional ACL
entries associated with it . fsck checks the continuation inode's mode, link
count , and the reference from the primary inode. It does not examine the ACL
information itself. fsck checks each primary inode for inconsistencies in the
following areas:
• Format and type 8
• Link count
• Duplicate blocks
• Bad blocks
• Inode size
• Block count
f s ck checks that all data associated with files and directories can be found.
The superblock summary information contains a count of the total number of
free blocks within the file system. fsck checks that all the blocks marked as
free are not claimed by any files. When all the blocks have been accounted for,
fsck compares this count to the number of free blocks it finds within the file
Do not issue the reboot command in its default form after fsck has repaired 8
a mounted file system. By default , reboot executes sync on the disks, thus
writing out inconsistent data. If you must reboot , use reboot -n, which does
not issue a sync .
Refer to Solving HP- UX Problems ( Chapters 6 and Appendix A ) for full
discussion of f s ck options and actions. The following subsections describe the
interaction of f s ck on various elements of the file-system.
The role of the buffer cache is illustrated in Figure 8-9. When you execute a
program, the shell passes the file path name to exec, finds the file on disk,
and reads the a . out header into the buffer cache. The a . out header contains
preliminary information about the executable, including the size of the text
and the uninitialized data ( bss areas ) .
B uffe r Cache
.- - - - - - - ,
1.;-1
I * a. out header I
P rogr�m L - - - - - - -'
File ,
*
_ _
Program
Executable
LG20021 1 _020
Figure 8-9. Buffer Cache Holds the a.out Header of Executing Programs
8
As the code executes , the virtual-memory system reads the pages of data
directly from the disk into memory. ( Some additional pages might also be read
in, based on the probability that they will be needed ) . The file's a . out , which
is only needed to begin the "demand-paging" , might ( or might not ) remain in
the buffer cache throughout the process execution , depending on whether its
buffer is needed.
Allocation Policies
Allocation is performed globally to place new directories and files and locally to
place data in blocks.
A global decision determines which cylinder group will contain a given file or
directory. HP-UX attempts to put all files from a single directory in the same
cylinder group . Newly created directories are put in the cylinder group with
the greatest number of free inodes and the smallest number of directories .
Global policy specifies that once the file size reaches maxbpg (maxbpg is defined
via the tunef s command ) , HP-UX allocates blocks from another cylinder
group . This helps to enforce grouping of all files within one directory into a
single cylinder group by spreading the less common larger files over several
cylinder groups .
Global allo cation routines call local allocation routines with requests for
specific data blocks. Blocks are allocated by the following priorities:
• Allocate block requested.
• Allocate a block on the same cylinder that is rotationally closest to the
requested block.
• Allocate any block within the same cylinder group .
• Use a quadratic hash to find a new cylinder group; allocate a block
somewhere in the new cylinder group .
• Use sequential search to find an available block.
8
Speed in allocating blocks is the most important characteristic of this strategy.
For this reason, the percentage of free space must be maintained.
Fragment numbers 14-21 and 24-31 in this example are free, indicated by 1 s in
the bit map . Fragment numbers 0- 13 and 22-23 are allocated, as indicated by
Os in the bit map. Fragments in adjacent blocks cannot be used to create a
full block; only eight contiguous fragments starting on a block boundary can
be used to allocate a full block. Fragments 24-31 can be coalesced to form a
full block, but not fragments 14-21. Also, if a partial block is allocated, the
fragments must be consecutive and not cross a block boundary. For example,
if three fragments are needed, fragments 16- 18 can be allocated , but not
fragments 14- 16.
Every time data is written to an existing file, the system checks to see if file
size must increase. If so, one of three conditions exists:
• Sufficient space exists in the existing block or fragment ; the new data is
written into the already allocated space.
• The file contains only whole blocks; the last block contains insufficient space 8
to hold additional data. If more than a full block of data must be written, a
new block is allocated and written. This process is repeated until less than a
full block of new data is needed. At that point , a block containing enough
contiguous fragments is located and the new data is written there.
• The file contains fragments, but not enough to hold the new data. If the size
of the existing data in fragments plus the new data exceeds the size of a full
block, a new block is allocated. Both the old and new data are written to
File 20 K
Size
•
•
•
1. I I. I I I
I
I I I I I I I I I I I 1 I I I I I I
8 15 24 31 40 43 46 48
8 ,......I
2 24
3 43
Direct
Blocks
4 0
•
•
•
12 0
•
•
•
All indirect blocks are referenced only as full blocks ; no pieces of the file are
addressed at the fragment level beyond the 12 direct pointers.
When a block or fragment is needed, the disk is searched for free blocks .
Ideally, free blocks should be found throughout the disk, for searches to locate
a free block close to related blocks. When the file system is full, there are long
linear searches to find the block, and when a block is allocated, it is likely to be
placed far from the previous block of the file, resulting in long seeks and slow 8
performance.
# links to file
time sta m p s
1 e-11----'
direct 2 -ti------_.
blocks
single indirect
Data Blocks
Disk space before or after the superblock, cylinder group information, and
inode table is filled with data blocks. (The specific locations of data on each
8 platter is different , due to the cylinder-block offset .) The blocks are used to
store data for regular files, directories, and symbolic links.
HP-UX provides support for file systems in several block sizes:
• On the Series 300/400/800, the file system can use blocks of either 4 KB or 8
KB .
• On the Series 700, the file system can use block of 4 KB , 8 KB , 16 KB , 32
KB , or 64 KB .
Besides maintaining information about the state of the file system, the cylinder
group also maintains key information about the inodes of the file system-the
system's index to the actual files of data. !nodes contain the locations of the
actual file data.
The cylinder group maintains an inode table, which provides summary
information about each file in the cylinder group ( see Figure 8-7). In addition,
the "disk inodes" appear in an expanded version ( "in-core inodes" ) in memory
for inodes currently ( or recently) used.
A disk inode includes the following information:
• mode and file type
• number of links to the file
• owner and group information
• file size in bytes
• time stamps
• pointers to the file's actual blocks of data on disk
When a file is read into memory, its "in-core inode" contains the following
additional fields:
• status of the in-core inode, including if the inode is locked, if a process is
waiting for the inode, if the disk inode now differs from the in-core copy due
to file modification, if the file is a mount point
• numeric address of the file system containing the file
• inode array number by which the kernel identifies the disk inode
• pointers to other in-core inodes linked on buffer hash list and free list
The header file, /usr/ include/sys/ inode . h, defines the in-core inode;
the header file, /usr/ include/sys/ ino . h, defines the disk inode.
When the operating system accesses a file, it finds the file by means of the 8
inode's pointers to the file's blocks of data. The scheme for finding the file data
is discussed later in this chapter.
A static number of inodes is allocated for each cylinder group when the file
system is created. HFS uses a default that provides sufficient inodes per
cylinder group for average usage.
The cylinder group controls all access to a file and its associated data. Each
cylinder group contains a copy of the superblock, a cylinder group information
structure, an inode table, and data blocks (see Table 8-4) .
Whereas the Series 300/400 has three locations hard-coded into the system,
the Series 700 has an additional loader, which understands the layout of the
file system. The Series 700 boot area has pointers to the actual bootstrap
programs.
The lifls command on a Series 700 reports presence of FS, SWAP , ISL , AUTO ,
HPUX, IOMAP , EST, and PAD files. Its reportage of FS and SWAP indicates that
Series 700 LIF has knowledge of the entire disk, including the file system and
swap .
When the system is booted, the loader goes off and can find /hpux at a default
or designated location, using the boot console user interface.
For more information, see the owner's guide for the Series 700 systems or
hpux_ 700 ( 1M ) in the HP- UX Reference.
Series 800 Boot Area Implementation
On Series 800, the LIF header contains ISL, HPUX, AUTO, RDB , and IOMAP files.
ISL uses the AUTO file to locate the HP-UX kernel.
Subarea Size
LIF volume header 256 bytes
( unused ) 256 bytes
Volume directory information 256 bytes
Bootstrap program 7.25 KB
Unless you create your file system using the -n option to newf s , the boot area
will be present on your disk. If you create your file system using mkf s the boot
area will not be present by default . In this case, if you will use the file system
on this disk to boot your system, you must explicitly put the boot area on your
disk using the following command (replace OsO for your disk's actual device file
name) :
d d if=/etc/boot of=/dev/dsk/OsO count= 1 bs=Sk
Each boot disk must have a volume header in the boot area to identify the
volume format (in this case, LIF). The volume header is checked by the boot
ROM in its examination of bootable mass storage media when the computer is
powered up.
The volume directory information contains SYSHPUX, SYSB CKUP, and
SYSDEBUG. All three are object files .
SYSHPUX corresponds to the file /hp-ux, which is your kernel. SYSB CKUP
corresponds to /SYSBCKUP , which is used as a backup kernel. SYSDEBUG
corresponds to the file /SYSDEBUG. This file is used only when writing device
drivers ; its use is described in Series 300 HP- UX Driver Development Guide .
8
On Series 300/400, the last 7.25 KB on the boot area contain the secondary
loader. The boot ROM loads and passes control to the secondary loader which
in turn loads and passes control to the file /hp-ux (or the backup kernel if you
are using SYSB CKUP ) . /hp-ux (or the backup kernel) then completes the task
of bringing up HP-UX.
On the Series 300 / 400 only, the boot area contains a volume header, volume
directory information, and a small secondary loader used when the system is
loaded. This area is reserved exclusively for use by the boot ROM. Table 8-3
shows the layout of this area, and the size of its components.
Y. du /usr/contrib
16 /usr/contrib/lost+found
448 /usr/contrib/bin+/HP-PA/respond+
2832 /usr/contrib/bin+/HP-PA
3384 /usr/contrib/bin+/HP-MC68020
6218 /usr/contrib/bin+
2 /usr/contrib/etc
2 /usr/contrib/games
2 /usr/contrib/ include
486 /usr/contrib/system
8 /usr/contrib/xseethru
89 124 /usr/contrib
The final number reported is the total of 512-byte blocks for the /usr/contrib
file system, and therefore the number is twice as large as that reported by bdf
in 1024 -byte blocks. 8
Table 9-2. When to Use Block vs. Raw Special Files for LVM
Y. 11 /dev/dsk/c3d0s2
brw-r- - - - - 1 root sys 7 Ox000302 Dec 20 15 : 38 /dev/dsk/c3d0s2
The 7 represents the major number (index to the device driver) , 3 is the LU
number (physical device) , and 2 is analogous to the section number of a Series
800 disk.
Now compare the minor numbers (shaded) for a volume group in Figure 9-3
Y. 11 /dev/vg3
crw-rw-rw- 1 root other 64 Jan 23 14 : 35 group
brw-r- ---- 1 root other 64 Jan 24 17 : 02 lvo1 1
crw-r----- 1 root other 64 Jan 24 17 : 02 rlvo11
brw-r- ---- 1 root other 64 3 1 1 : 53 lvo12
crw-r----- 1 root other 64 Feb 3 1 1 : 53 rlvo12
brw-r----- 1 root other 64 Mar 6 12 : 0 1 sales
crw-r----- 1 root other 64 Mar 6 12 : 0 1 rs ales
with the overall hexadecimal format by which they were created, in Figure 9-4:
The logical volume (LV) number is encoded into bits 0- 7; the volume group
number (03 ) , comparable to the LU number of a non-LVM device file but in a
different position, is encoded into bits 16-23. The major number is encoded
into bits 24-31. Note too, the block and raw special files created for the logical
volume /dev/vgOO/sales .
Within each volume group directory is a special file, group , with the volume
group major number 64, logical volume number O , and volume group number.
Volume group numbering begins with zero (vgOO), while logical volumes begin
with one (lvo1 1 ) . This is because the logical volume number corresponds to
the minor number and the volume group 's group file is assigned minor number
0.
HP-UX accommodates u p t o 256 volume groups and 255 logical volumes per
volume group .
HP-18 Limitations
HP-IB disks must be used in their own volume group and cannot be combined
in volume groups with HP-FL or SCSI disks . This is because HP-IB disks
can handle only limited LVM capabilities: HP-IB does not support bad block
relocation or disk mirroring.
LV Name /dev/vg00/lvol2
LV St atus available/ syncd
Current LE 20
Allocated PE 20
Used PV 1
--- Physical volumes
PV Name /dev/dsk/c2d0s2
PV Status available
Total PE 632
Free PE 462
9
Figure 9-5. Sample Verbose Output of vgdisplay
root LE
swap LE
/dev/dsk/c0d0S2
root LE
swap LE
usr LE
/dev/dsk/c1 d0S2
LG20021 1 _028
When you install the system, having decided to implement LVM, the migration
and installation processes set various options ensuring that your root volume
group is properly configured. Later, if you choose to establish another root
volume group, you might want to refer to the guidelines found in "Guidelines
for Configuring the Root Volume Group" , later in this text .
9
Underlying the root volume group is an LVM disk data structure different from
that of non-bootable LVM disks. Bootable LVM disks have sectors reserved
for a boot data reserved area ( BDRA ) and a LIF volume containing boot
a)
LE
b)
LG20021 1 _029
Y. lvdisplay /dev/vg00/lvol1
- - - Logical volumes
LV Name /dev/vg00/lvo1 1
VG Name /dev/vgOO
LV Permis s ion read/write
LV Status available/syncd
Mirror copies 0
Cons istency Recovery MWC
Schedule parallel
Current LE 10
Allocated PE 10
Bad block on
Allocation strict
9
Figure 9-8. Sample Output of 1 vdisplay
Under most circumstances, you need never change the 4-MB default extent
size. Exceptions might arise for extremely large disks. Large extents are more
wasteful of disk space and smaller extent sizes allow a finer granularity of
allocation. ( For more information on these considerations, see "Volume Group
Descriptor Area ( VGDA ) " , later in this chapter. )
As you can see in Figure 9-9, LVM uses two kinds of extents-physical extents
and logical extents. LVM stores data on disks as sets of addressable, disk
blocks called physical extents. Logical volumes consist of logical extents, which
map to the disks ' physical extents.
An unmirrored logical volume has an identical number of physical and logical
extents; a doubly mirrored logical volume has three physical extents to each
logical extent .
Logical extents can be mapped non-contiguously to physical extents on LVM
disks. This means that LVM can disperse data in non-consecutive physical
extents on disk. An exception to this policy is the root volume group. ( See
"Contiguous vs. Non-Contiguous Allocation of LVM Disk Space" , earlier in 9
this chapter. )
Y. pvdisplay /dev/dsk/c2d0s2
--- Phys ical volumes
PV Name /dev/dsk/c2d0s2
VG Name /dev/vgOO
PV St atus available
Allocat able yes
VGDA 2
Cur LV 4
PE Size (MB ) 4
Total PE 632
Free PE 462
Allocat ed PE 170
Stale PE 0
A verbose listing (pvdisplay -v) of the same LVM disk shows the mapping
status of all available physical extents. (In the following example, physical
extents 0 170 to the end are free, meaning unallocated.)
Figure 9 - 1 1 .
Verbose Output of pvdisplay, showing Mapping of Physical and Logical Extents
LG20021 1 _030
When using the raw interface to a device ( as with a database application ) , data
is read and written in DEV BSIZE units. This can pose a performance loss for
_
multi-spindle disk arrays, whose writes are required in units of 2 KB, the disk
array's underlying sector size. For example, to transfer 1 KB ( that is, one
DEV BSIZE unit ) of data, the controlling device driver reads in 2 KB of data
_
( even though only 1 KB is changing ) in order to write in the 2-KB sector size
required by the disk array. ( This is called "read modify write." )
For block interface ( as with a file system ) , there is no performance loss as long 9
as the fragment size is 2 KB or greater.
LVM handles all data transfers in terms of DEV BSIZE units . In most cases ,
_
LVM communicates with the disk driver directly, to ensure that 1/0 block
size is a multiple of DEV BSIZE and the beginning 1/0 address begin on the
_
DEV BSIZE boundary. LVM allocates disk space in units of extents. Extent
_
v
,
• •
LG20021 1 _031
Figure 9· 1 3.
Bootable and Non-Bootable Physical Volume Layouts, Showing Organization of 9
Data Structures
LIF Information
Much like non-LVM boot disks, the LVM boot disk contains a LIF volume, in
which are stored ISL, HPUX, AUTO , IOMAP , RDB , and LABEL .
The LIF LABEL file is created and maintained by lvlnboot and lvrmboot . The
LABEL file has pointers to the starting point and size of boot-relevant logical
volumes, including the file system containing the kernel. With information in
LABEL , HPUXboot can locate and gain access to the logical volume for root .
The support and install tapes also use the information to access the root,
primary swap, and dump logical volumes without actually using LVM.
Caution If the LIF or any reserved area becomes corrupted, the support
tape can be used to recover the operating system. If that fails,
or is impractical, the system must be re-installed.
The LIF volume cannot be copied directly onto LVM disk
using dd( IM) . It must be set up by the install process or by
mkboot(IM), on LVM disks for which the pvcreate -B option
was used, due to a gap between the LIF header and LIF
directory. When using mkboot(IM), you should specify section
2, not section 6.
volume group.
• Amount of space ( expressed in number of DEV BSIZE blocks ) allocated for
_
The volume group descriptor area ( VGDA ) contains the information the LVM
device driver needs to configure the volume group for LVM, including:
• Volume group header with timestamp to indicate when the VGDA was
last updated, volume group ID number, and three configurable operating
system parameters ( see System Administration Tasks manual for further
information ) :
o maxl vs-maximum number of logical volumes allowed per volume group.
o maxpxs-maximum number of physical extents allowed per LVM disk.
o maxpvs-number of LVM disks that can be installed in the volume group .
• List of logical volume entries, one for each logical volume within the volume
group , recorded as follows:
o Maximum number of logical extents permissible per logical volume.
o Current status and capabilities of the logical volume.
o Mirroring schedule policy, if set.
o Maximum number of mirror copies allocated, if set .
• List of LVM disks, including:
o Header with global information ( ID , number of physical extents, status )
about the disk.
o Map of physical extents to logical volumes.
• Volume group trailer, timestamped when the VGDA was last updated. ( Both
header and trailer timestamps are compared to verify the consistency of the
VGDA. )
The VGDA is the area checked to ensure a quorum of total LVM disks in the
volume group . A volume group cannot be activated unless half the disks in
a volume group are present and available, that is, containing the latest state 9
information. The vgchange -q n option can be used to override the system's
quorum check.
Since each physic al extent is recorded in a YGDA entry, the extent size has a
direct bearing on the YGDA. In most cases, the default extent size will work
perfectly well. However, if you run into problems , you might consider the
following circumstances:
• Since the YGDA is a fixed size, a high-capacity LYM disk might exceed the
total number of physical extents allowed. As a result , you might need to use
a larger-than-default extent size on high-capacity LYM disks.
• Conversely, if all LYM disks in a volume group are small, the default number
of extents might make the YGDA too large, wasting disk and memory space.
A smaller-than-default extent size or number of physical extents might be
preferable.
• A high-capacity LYM disk might be unusable in a volume group whose
extent size is small or set with a small number of physical extents per disk.
The volume group status area (YGSA) tracks the validity and availability
of LYM disks and the current state of physical extents (stale or fresh) . The
LYM reads this information when it initializes the volume group , updates it as
a result of configuration changes to the volume group, or as a result of I/O
errors.
The YGSA can be considered an extension of the YGDA, because it duplicates
some of YGDA information, such as quorum, maxpvs , and maxpxs .
When the OSF Mirror Write Cache is used, the mirror consistency record
(MCR) minimizes the amount of 1/0 required to bring all mirrors into a
consistent state following a system crash or power failure.
9 The MCR contains records of:
• Timestamp when the mirror consistency record was last written.
• Minor numbers of the logical volumes involved.
LVM Overhead
The data structures that enable you to use LVM consume a modest amount of
overhead from your disk space. This overhead is set at a fixed boundary (2912
KB) for bootable LVM disks and may vary in size in non-bootable LVM disks
( typically 400 KB).
Overhead required by non-bootable LVM disks depends on the parameters
listed below, which can be modified using SAM or the vgcreate command. If
you set a small extent size or create many physical volumes, your LVM data
structures ( overhead ) will be larger.
-e Sets the maximum number of physical extents allocatable for
LVM disks in a volume group ( by default , 1016).
- 1 Sets the maximum number of logic al volumes allowed in a
volume group ( by default , 255).
-p Sets the maximum number of LVM disks ( physical volumes )
allowed in a volume group ( by default , 32) .
-s Sets the size, in megabytes , for each physical extent in a
volume group ( by default , 4) .
An operating-system parameter, maxvgs , can be configured to set the
maximum number of volume groups LVM will recognize. Its default ( 10) is in
the I etc/master file and can be overridden ( permissible range is 0 to 256) by
adding a statement to the S800 file.
command at the ISL> prompt . This causes the system to boot to single-user
mode without primary swap , dump, or LVM to access the root file system.
For further information, refer to the manual, Installing and Updating HP- UX
or hpuxboot ( lM ) in the HP- UX Reference Manual.
Caution The system must not be brought to multi-user mode ( that is,
init 2) when in LVM maintenance mode. Corruption of the
root file system might result .
~
/dev/dsk/c1 d0s2
/dev/dsk/c1 d0s2
LG20021 1 _032
LV3
LV4 LV4
LG20021 1 _xx
Each copy of mirrored data maps to the same logical volume; the number of
logical extents remains constant , but the number of used physical extents ( and
therefore, occupied disk space ) changes, depending on the number of mirrored
copies.
Mirrored logical volumes must belong to the same volume group ; you cannot
mirror across volume groups.
SCSI
host adapter
@ slot 1 1
H P-PB
bus
SCSI
host adapter
@ slot 1 2
/dev/dsk/c3d0s2
@ 48.0.0
LG20021 1 _034
9 On systems such as the Model 8708 , you can mirror disks across separate
buses, as shown in Figure 9- 18. The logical extents ( LE1 , LE2 , and LE3 ) in
memory map to the physical extents ( PE 1 , PE2, and PE3 ) in LVM disks labeled
PV1 and PV5 .
- --
C\/? C\/1 PVr::
- - -l!:i._7
PE1 PE1
-
- PE3
PE2 PE2
PE3
-
- -
- - - �
- � �
Volume Group
LG20021 1 _035
Figure 9- 1 8.
1/0 Channel Separation via Separate Buses, and using Physical Volume Groups
The LVM scheduler converts logical requests into one or more physical
requests, then schedules them through the physical layer. S cheduling occurs for
both mirrored and non-mirrored data.
9
To ensure maximum control, two 1/0 schedule policies are available-parallel
and sequential.
• •
File
System
User Space
System Call Boundary
Kernel
�
,, ' �.
• T
physical device
}
drivers ("discn'1
LG20021 1 _0 1 2
The LVM pseudo-device driver (lv) handles all 1/0 operations for the LVM
components on behalf of applications, file systems, and other subsystems.
System management commands perform LVM configuration operations by
opening the volume group 's control device and issuing LVM ioctl c alls. When
applications issue open, read, write, ioctl, and close calls, the top h alf of
1 v does everything required to send a request to the underlying disk drivers . 9
This includes ensuring that requests do not overlap , choosing how to access
the mirrors, translating logical addresses to physical addresses, and calling the
driver to start the 1/0 .
10
System Architectures
This chapter surveys the various HP-UX system platforms , with figures of card
cages and bus structures. Visualizing the layouts of the specific architectures
will help you understand HP-UX addressing and configuration.
System Architectures 1 0- 1
10
1 0 ·2 System Architectures
10
Except for Models 318 and 319 workstations, and other lower-priced
non-expandable units, you can enlarge your Series 300 memory or I/O
capability by adding expander boards, either piggy-backed to the System
Processor Unit ( SPU ) or HP-HIL card, or caged in a VME Expander bus
connection. The VME Expander is supported on all DIO-II hosts.
Processor-1/0 Board
(occupies 2 adjacent DI0-11 slots
SCSI Disk Interface
8MB ECC RAM (expandable to 32MB)
Power
Supply
Video Board
Figure 10-2 depicts the functional relationship between the DIO-II bus on the
Model 375 and its attached boards.
32 KB C8che
S MB ECC RAM
4, 8, 1 2, 1 6, 20, or 24 MB add-on ECC RAM
Video Board �
r - - - - - - - - - - - - - - - - - - - ,
LG200 1 72_030
Processor-1/0 Board
The Processor-I/O board occupies one double-width slot on the DI0-11 bus of
the Model 375, and contains the following essential elements:
• Motorola MC68030 CPU /Memory Management Unit .
• MC68882 floating-point coprocessor.
• 32 KB cache (high-speed memory) .
• Error checking and correcting RAM (minimum 8 MB ) . Small SIMM RAM
cards mounted perpendicularly onto the CPU can increase the Model 375 to
a maximum of 128 MB of RAM.
The following elements of the processor-I/O board are specifically relevant to
configuration:
• SCSI (Small Computer System Interface) interface, used for connecting SCSI
peripherals, including magnetic and optical disks, and digital data storage
tape drives . S CSI is a very fast , industry-standard interface and an optional
product for most Series 300 systems.
• Centronics interface (parallel) is used by peripheral devices, such as printers.
Centronics is an eight-bit wide port capable of sending data through multiple
(eight) lines instead of one. This simultaneous transmission results in faster
data transfer than via the serial interface.
• High-speed HP-IB (IEEE-488) interface can be used to connect the System
Processor Unit (SPU) to disk drives. In some systems, a SCSI interface
replaces the high-speed HP-IB interface.
• RS-232C (serial) interface, used to connect a terminal, printer, plotter, or
other serial device to Series 300 systems .
• LAN interface, which enables you to hook up to a local area network.
• Audio output , which connects to an external speaker.
• HP-HIL (Human Interface Link) interface, used to hook up the keyboard and
other HP-HIL devices , such as a mouse, digitizer, and button box.
Other interfaces are available, including the standard-speed HP-IB interface,
used to connect numerous devices, including plotters, instruments, and tape
drives .
Graphics Interface
The video board provides the interface for the monitor. A number identifies
the video board, and should be used to set terminal type. Setting terminal
type incorrectly ( or too vaguely ) results in application products ( such as vi)
working less efficiently than intended.
The correct terminal type is complicated by the issue of how you will be using
your terminal. If you plan to work in raw mode, HP recommends that you
identify the actual product number of your display ( look for it near the HP
logo on the front or back panel ) or execute /etc/dmesg). The terminal type
( TERM ) corresponds to an entry in /usr/lib/terminfo, where the system looks
for information on terminal resolution, number of lines per screen, and other
monitor specifics .
To reference the proper terminal type, enter the following for Bourne or Korn
shells:
$ TERM=98550
$ export TERM
or for C shell:
Y. 1 : setenv TERM 98550
This applies the settings for the current terminal session, but to make them
permanent , you must add the same line to the prof ile file for Bourne and
.
_...,.,..
CPU
,.,,,, l...,..ll
11 -
J.J , 11
CPU Bus ________
rrtt@M@fitj�MMi��i���iiir@iiMW�iii=l��iiWtM �mt�iiiHi�::i:::::::::::::�W'ii'*MWMWf�:� rtwi:ti:
Built-in
---"'---
E/ISA
�� DI0-11
Graphics AT-Compatible
1/0 Card Cage
Card Cage
LG200 1 72_032a
For information on the HP Apollo 9000 Series 400 Workstations, consult the
installation guides , owner's manuals, and HP Apollo 9000 Series 400 and Series
700 Pricing and Configuration Guide.
System Architectures 1 0 -7
10
Port
Bus address
Multiple
Devices (when required)
(Peripherals)
LG2001 72_031
Note Every card in the system must have its own select code. Cards
cannot share select codes, even with other cards of the same
type.
In the simplest case, the select code uniquely identifies the interface on the
DIO or DI0-11 bus . In the case of HP-IB , SCSI, RS-232C, MUX, or HP-HIL,
when more than one peripheral can be connected to a single interface, the
select code is used to identify the interface and a bus address distinguishes the
specific device. In the case of multiple interfaces of the same type ( such as two
or more MUX cards ) , each card requires a unique select code.
Note Standard audio boxes do not have a bus address, even though
they are in the HP-HIL loop .
1 0- 1 O System Architectures
10
Graphics ------
SCSI
Parallel
LAN AUI
Graphics Thin LAN
RS-232
Keyboard
o+--tt-- Audio
a
o.
Figure 1 0-5. Models 720/730 and 750/760 Rear Panels, showing Ports
System Architectures 1 0- 1 1
10
M emory
with Graphics Support
Voice-quality or
#
CD-quality Audio
# FOOi
# Fast/Wide SCSI
LG20021 1 _042
Figure 10-6 depicts the organization of the Series 700 bus architecture. Note
that not all elements shown in the diagram are available on all systems,
and addressing some elements of the core I/O varies by model. # symbolizes
optional interfaces whose function number varies by model. For example,
• EISA is optional on Model 720.
• The number of graphics connection varies by model.
• Voice- or CD-quality audio is available only on Models 710 and 760.
1 0- 1 2 System Architectures
10
• Systems may be equipped with either LAN or FDDI, but not both.
System Architectures 1 0· 1 3
10
The ioscan ( lM) command is useful for visualizing the hardware configuration.
The numbered modules shown in Figure 10-6 correlate to hardware paths
displayed by ioscan -f . Here is a sample full listing on a Model 720:
Class H/V Path Driver H/V St atus S/V Status
=====================================================
1 0- 1 4 System Architectures
10
its addressing.
1 0- 1 8 System Architectures
10
f ff
� �
0 0 N C") ..,. IO
0
.,... ..... .,... .,... .,...
z
m
a. le le le le
II � I
Memory
11 � I
Memory
H P-IB
(optional*)
�
Memory .....
(optional) .....
m � &I � :il
a.
Iii m
a. a. a.
.,...
m
a.
a. a. a.
*Standard On 832S
LG200 1 80_001J
Figure 10-8 depicts the bus architecture and hardware modules configured in
the Model 8x2S :
LG2001 72_033a
I/0 interface cards plug directly into the Precision Bus , making hardware
addressing relatively simple. The hardware address (m . d) consists of two
elements:
..-
..- (') in I'- en
..-
0 0 0 0 0 0
Ci5 .....
"O
Ci5 Ci5 Ci5 Ci5 Ci5 tll
(.)
� 2:-
::::> 0
'ffi a_ E
c: (.) Q)
0 C\I 0
C\I '<:!" co 00 ..- ..- �
.....
CJ)
0 0 0 0 0 0 Q)
a_
Ci5 Ci5 Ci5 Ci5 Ci5 Ci5
Ll320021 1 _037
Figure 10-10 shows the bus architecture of a typical Model 8x7. Note that
processor and memory interactions are segregated from the HP-PB bus,
minimizing 1/0 contention.
8X7 Family
!) VSC Bus
� .-.-
I I I I I I I
1 1 '0 110 1 '0 110
LG20021 1 _0 1 4
In Figure 10- 1 1 , you can see the module numbers used to address each element
of the bus architecture.
Personality Card
_______,
_o 4--�
3--�
2--� 1 _____
a--�
5--� a 9 0�
..- 1_
..� 3-_
1 1__1�2_l_1� 1�l s ......
4-l_1_
H
:��::n
x
-0 ::>
w ::> P rivate Bus
(/) ::E 0
a.
Memory
SCSI Address -
LG20021 1 _036
Factory-Floor Communication
An alternative configuration enables Mid-Bus models to handle computer-aided
manufacturing. The HP Precision Bus ( HP-PB ) is added to a Mid-Bus system
through an HP-PB bus converter. This enables installation of Manufacturing
Automation Protocol ( MAP ) cards (IEEE 802.4) for control of factory-floor
devices . Figure 10- 1 2 depicts the card-cage layout of a Model 845SE, with
[J
attached CIO expander.
0�
Access Port
:�:��::
L
Ope
Open for H P-18
ao
��w 32 MB Memory Board
Open for memory expansion
... - - - -
Mid-bus slots
�I
0 1 im== - - ·- -
.
8 32
1 :m:= 7
�
- 28
2 � 6 24
3 5 20
4 4 16 Module#
5 3 12
2/1 0 8140
mm rmlll
� 1 4
-
0 0
- ....._
- -
Power Supply
- -
[j
Open for MUX- - Processor Board
Power Supply
I
LG200 1 72_036
Figure 10- 13 depicts the bus architecture and hardware modules configured in
the Model 845 system:
open for
memory expansion
...-���....,A-���-
( \
Channel
Adapter
CIC-Bus
HP-B
Access
or HP-IB MUX LAN MUX
Port
HP-FL
LG2001 72_037
11 11111
Hand Card Cage)
�� 1 1 L
or H P-FL
L
MUX
•r[mL
(Console)
�
u I I
01234 •
. . .
1 234 5 6
� �
L
- '"-
-
. .
6 5 43 21
01 234
ii
H P-I B
LAN
Access
Port
Hardware Path :6 - H
ardware Path = 2
Memory Controller
Hardware Paths
LG2001 72_038
====� (cont'd
===�\
� below)
15
· · · �« . . ':!:'
. .
• • •
80
slot # slot #
--
CIO CIO
8/4.0 6/8.0
1hru 8/4.4 1hru 6/8.4
dlsk drlw
�
tape drlw
HP-18 address
2/4.0.0
HP-t8 addres
2/4.0. 1
�
HP-tB add res
2/4.2.3
HP-18 address
2/4.2.1
LG2001 72_039
F ront Rear
1 0 11 12 1314 15 SP 0 1 2 3 4 5 6 7 8 9
Jj
�
....
0
�
Ill
8� 0
Power
-� � E
Gl
ll..
Supply JJ 0 ::il
Fans Modules
14 12 10 8 6 4 2 0
1�
....
Gl .lo:
i
E
8
�
� f/J C\I
a ...!.
�
.9 - �
� f/J ::il
1 5 13 11 9 7 5 3 1
Fans
LG20021 1 _039
Peri pherals
Service
Processor
To HP-PB
Cardcages
Upper BCs in
L.. L.. .J Expansion
Cabinets
- - - - 1 , - - - - - - - 1
I
I I
I
I
I I
I
I
I
I
==���==s=�P=' I
I Lowerl
I
I BC I
I
I I
I :;:::;;:::
:om �
::::; t=;;�
:G G G!
I
L _ _ _ _ _ _ _ _ _J
H P-PB Cardcage
Communication between the PMB and HP-PB buses is handled by Dual Bus
Converter boards, which occupy back slots of the upper cardcage. Model 890
bus converters differ from other systems: two boards perform the conversion
from SPU bus to HP-PB bus : a "Du al Bus Converter" board, plugged into
the SPU bus for communication with processors and memory, and a "Lower
Bus Converter" board, plugged into the HP-PB bus, for communication with
each I/O card cage. As the name implies, each Dual Bus Converter board
actually consists of two upper bus converters , which are addressed separately
and can provide communication to two Lower Bus Converter boards (that is,
two HP-PB card cages) . Each bus converter set connects between the PMB
and HP-PB buses, using two ribbon cables to accommodate high and low
differential voltage.
In addition to the basic HP-PB bus, ribbon cables can connect from Dual Bus
Converter boards to external (expander bay) HP-PB card cages .
In the Series 700, I etc/ dmesg shows system configuration by select code and
function number. It also shows information on the memory subsystem and
LAN.
Kar 28 1 5 : 32
Beginn ing I/D System Con£igurat ion .
Block TLB ent #5 £rom 0Jd:9000000 t o Ox£9££££££ a11ocated .
11
System Configuration
user environment
(device Independent)
HP-UX Kemel
(Including device files
& device drivers)
s>:
dr vers
1/0 Devices
LG200172_040
Figure 1 1-1. Kernel in Relation to the User Environment and 1/0 Devices.
1 1 -2 System Configuration
11
Kernel Configuration Files
The df ile for Series 300/400/ 700 or S800 for Series 800 is the principal vehicle
from which the kernel derives its image of your system. df ile and S800 are
termed kernel configuration files . Although they differ in name and format,
df ile and S800 are both used to create the kernel for their respective systems;
both contain information vital to the kernel about device drivers , subsystems ,
swap configuration, and configurable parameters .
Every time you change the kernel configuration file, you have to generate a new
kernel and reboot the system to activate the changes in that file. Figure 1 1-2
compares what happens when you generate a new kernel on Series 300/400/700
and Series 800.
H I
/etc/m aster system libraries
t
Series
clfile config
conf. c � m ake h p-ux
300/400/700 ..._____,
config. m k ---+! ---
conf. c
config.h
:=-8
Serles 800 SBOO uxgen
�
libs file
� conf. o
mak file
LG20021 1 _041
System Configuration 11 · 3
11
1 1 -4 System Configuration
11
Here is a sample df ile for the Series 300/400:
* DEVICE DRIVERS
cs80 I• disk and tape drivers •/
scsi
tape
st ape
* CARDS
98624 /• HP-IB int erface •/
98626 /* high-speed HP-IB interface •/
98626 /• RS-232C serial int erface •/
98628 /* RS-232C datacomm interface •/
98642 /• RS-232C mult iplexer •/
98668 /• DID SCSI interface •/
98266 /• SCSI int erface •/
* SWAP CONFIGURATION
* CONFIGURABLE PARAMETERS
dskless_node 1
ndilbuff ers 1
npty 30
* Disable support for HP98248A (Float ing Po int Accelerator)
* by changing the 1 to a 0 in the folloving line .
fpa 1
System Configuration 1 1 ·5
11
Here is a sample df ile for a Series 700 system:
* Installed softvare drivers and I/O int erface cards
aut ox I • Magneto-Opt ical aut ochanger •/
aut och
* Netvork management
netman
nipc
uipc
inet
lan01
asioO
nfs /• Netvork File System (NFS) •/
cdf s /* CD File System (CDFS ) •/
• I/O drivers
eisa
CharDrv
hpib
cs80
hshpib
• Tunable parameters
dskless_node 1
server_node 1
• Svap info
•svap auto /• Svap after fs on root device default . • /
•svap scsi 201 500 -1 /• Svap after fs . •/
•svap scsi 201400 0 /• Use the vhole disk for svap . •/
1 1 ·6 System Configuration
11
System Configuration 1 1 -7
11
Here is a sample S800 file on a Model 837 running LVM:
#include "/etc/mast er"
include mirror ; /• subsyst em and driver include stat ements •/
include s1litch ;
include nipc ;
include lv ;
include lvm ;
include nfs ;
include lan ;
include ni ;
include nm '·
include inet ;
include uipc ;
include t arget ;
include t ape2 ;
include scsi1 ;
include mux2 ;
include memory ;
include lpr2 ;
include lan3 ;
include disc3 ;
nclude hpib1 ;
io {} /• io stat ement •/
1 1 -8 System Configuration
11
The io Statement of the seoo File
Series 800 systems automatically bind device drivers included in the S800 file
to their appropriate device. This "autoconfiguration" applies to most device
drivers. You must use the io statement to configure drivers that cannot be
bound automatically into the kernel using SAM. This section describes the io
statement of the S800 file.
The syntax of the io statement is:
io {
addr�ss_specifi cation
System Configuration 1 1 ·9
11
The io Statement of a Mid-Bus/CIO Configuration.
Suppose you have a Model 835 containing:
• two HP-IB disk interface cards , each with four disks connected
• two MUX cards
• another HP-IB interface card with:
o two line printers
o two tape drives
o a plotter
• a LAN card
• a GPIO card
Since most devices listed are configured automatically, their device drivers are
referenced as include statements .
include cio_caO ;
include hpibO ;
include discl ;
include muxO ;
include lprO ;
include t apel ;
include instrO ;
include lanO ;
include gpioO ;
1 1 · 1 O System Configuration
11
Here is an io statement for the plotter and GPIO card:
io {
c io_caO address 4 { address of CIO chann el adapter
hpibO ad.dress 2 { address of HP-IB card for tapes & printers
instrO address 7; address of p lotter
}
gpioO address 5; address of GPIO card
}
}
The first level of nesting in this io statement shows the CIO channel adapter,
which is used by both devices to communicate with the system bus and
processor:
cio_caO ad.dress 4 {
ifddress_specifi cations
cio_ caO The name of the controlling CAM ( channel adapter manager,
explained in the section, "Device Drivers" ) .
address 4 Physical location of the channel adapter module in slot 1 of
the Mid-Bus . Module boards may contain multiple modules ;
the address is set as slot number multiplied by 4 so that other
modules on the board can be addressed by offsets.
The addresses specified after the CIO channel adapter include all device
adapters inserted in the CIO Bus card cage that cannot be configured
automatically. The same pattern of driver name and address is used:
hp ibO The device adapter manager that controls the HP-IB card.
address 2 The physical slot of the HP-IB card in the CIO-Bus card cage.
instrO The device driver that controls the plotter. Because the plotter
is attached to the HP-IB card, instrO is specified within the
nested address of hpibO .
address 7 The bus address of the plotter card ( in this case, an HP-IB
address switch located on the plotter ) .
gp ioO The device driver that controls the general-purpose 1/0
( GPIO ) card.
address 5 The physical slot of the GPIO card in the CIO-Bus card cage.
System Configuration 1 1 - 1 3
11
Kernel Devices
In the Series 300/400/ 700, kernel devices are found via the /etc/master file.
In the Series 800, kernel devices-console , root , swap , and dumps-are
cited separately in the S800 file to allow the user to modify them. Whenever
possible, they are liste_d with default hardware addresses. Defaults are derived
from processor-dependent code, as follows :
• The default console path is the address displayed during the boot process,
before you get an ISL prompt.
• The default for the root device is the place from which the kernel was loaded,
usually indicated by the primary boot path. Normally, the root disk defaults
to section 13 of the disk from which you loaded the kernel. If you are using
the Logical Volume Manager (LVM) , your root logical volume is in your
root volume group . (For information on implementing LVM , see Chapter 9,
"Logical Volume Manager" in this manual and "Managing Logical Volumes"
in System Administration Tasks manual.)
• Swap defaults to section 15 of the root disk or a logical volume in the root
volume group , if you are implementing LVM.
• The dump device defaults to primary swap .
Defaults can be changed by executing the hpux command with options at the
ISL prompt during installation. See hpuxboot(lM) in the HP- UX Reference
and Installing and Updating HP- UX.
Operating-System Parameters
Configurable operating-system parameters are values set in the df ile or S800
file to customize kernel characteristics . Knowledgeably setting them can
optimize performance, but proceed cautiously, because many parameters are
interrelated and imprudent changes might cause unpredictable results!
Operating-system parameters affect the following areas :
• inter-process communication
• swap space allocation
• memory management
• cluster system management
• process memory limits
• message mapping, queueing, and size characteristics
• file system buffer cache
• networking process scheduling and memory allocation
• maximum number of system-wide open files, file locks, text descriptors
Operating-system parameters and their dependencies are listed in Appendix A
of the System Administration Tasks manual.
System Boot
loads
(system i nitialization)
_. probe hardware and match drivers
to hardware
i nvokes
/etc/inittab
LG20021 1 _040
The kernel detects all buses, channel adapters , device adapters, and external
devices and binds all hardware address space pointers to their corresponding
software modules ( device drivers ) and device special files. This is done
by writing to the kernel's internal data structure, io_ tree, as well as to
/etc/ioconfig. Then, ioinit calls insf to assign logical unit numbers to
all newly configured devices and downloads the lu numbers into the kernel.
insf then creates device files for any new devices it finds, then updates
I etc/ ioconf ig.
Having completed the 1/0 mapping, init then creates a process for each
terminal on the system, thus establishing a multi-user environment .
1 1 · 1 8 System Configuration
11
Figure 1 1-4 illustrates the auto-configuration process and shows user access to
the configuration after the boot process.
1/0 Configuration
/etc/ioconfig
During the Boot
Holds LU: hardware
Process
mapping
(user level)
Downloads mapped
LUs to /dev
- -
files Calls /etc/insf to install special files.
- /
/etc/insf can modify /etc/ioconfig
1 �1
Commands that you can use to affect or see the kernel configuration.
.-�����--. ....�����--.
.
/etc/ioscan /etc/rmsf /etc/lsdev /etc/insf
Reads data struc- Removes device /etc/lssf Makes new
tures and displays special files Lists device device special
the 1/0 and drivers or device files.
configuration. LU assignments. special files. Assigns new LUs.
/etc/ioconfig
Holds current LU:
hardware mapping
LG2001 72_043a
System Configuration 1 1 -2 1
11
The /etc/master File
All HP-UX computers use a /etc/master file, which contains critical device
driver definitions in terms of file type (block or character) , major number, and
I/O functions. These definitions are used by config( lm) (on Series 300, 400,
and 700) and uxgen(lm) (on Series 800) .
O n the Series 300/400/ 700, the /etc/master file consists of lists of devices
and cards , their associated interface or device driver, major numbers by block
or character type. On the Series 700 , the I etc/master file also lists the
subsystems for which library a given device driver is dependent .
On the Series 800, the I et c/master file defines device drivers in a format
resembling C syntax. The first entry in the S800 file includes the I etc/master
file.
Because the bus architectures of Series 800 computers are hierarchical, the
I etc/mast er file also reflects the hierarchical I/ 0 manager relationships of
parent and driver. For example, the following excerpt identifies c io_caO as the
parent driver for the hpflO, the device driver that controls a CIO fiber-link
card:
module hpflO { /* CID HP-FL card 27 1 1 1A */
parent is cio_ caO ;
driver hpflO ;
}
Device Fi les
HP-UX communicates with peripherals through files called device :files , which
are kept in /dev or one of its subdirectories . Device special files contain no
actu al data, but exist solely as the way to write to or read from a device.
Device files point to the logical address for peripherals and other devices.
Device files contain information encoded in major and minor numbers to
identify device drivers , hardware addresses , and other characteristics. HP-UX
uses this device-driver and address information to manage all data transfers to
and from the device.
In the Series 300/400/700, the device-file name encodes hardware-address
information directly. In Series 800, the hardware information must be inferred
from the minor numbers, found either by running 11 on the device file or (for
Series 800 only) by running the /etc/lssf or the /etc/ios can command.
Device files link devices to the kernel and enable I/O between the kernel
and devices . HP-UX uses device files to determine which driver to use when
communicating with a device and the device's hardware address . (Valid drivers
must be compiled into the running kernel.)
The kernel treats I/O to a device much like I/O to a file, by performing I/O
operations as if through the file system. For example, each terminal has its own
device file through which HP-UX writes data (which appears on the termin al
screen) and reads data (typed by the user at the terminal keyboard) .
Typically, two device files-a block and a character device file-are created for
each I/O device in the system. (These are described shortly.)
Individual device files can be created by the following commands:
• insf ( lm )-Series 800 only.
• mksf ( lm)-Series 800 only.
• mknod( lm)-Series 300/400/700/800.
On the Series 800, insf is the easiest , fastest way to handle special files . insf
can be used any time. It is not actually run when the kernel is regenerated,
but rather when the new kernel is booted. insf assigns logical unit numbers ,
needed for the device before you can use either mksf or mknod to create a
device file. mksf and mknod should be used only for special cases , as they are
more difficult to use than insf .
See lssf ( lM), mksf ( lM), and ioscan(lM) in the HP- UX Reference .
Device Fiie
I
Which driver
\
Where is the device the driver
do I taik to? needs to access?
What are the device file's special
access modes (e.g. tape density)?
LG2001 72_042
Each device driver in the system is assigned a major number, which the kernel
uses to locate the driver routine to service an 1/ 0 request .
The driver uses the minor number to get to the specific device and for
information regarding how to handle data.
Major Numbers
The major number is an index for the device driver into one of two kernel
tables-bdevsw, the block device switch table and cdevsw, the character device
switch table. These device switch tables list driver entry points.
Drivers that support both block and character I/O (such as scsi disk driver
and optical autochanger) have two major numbers-a block major number and
a character major number-each of which can be referenced in their respective
switch tables , depending on how the device is used . Or, explained from another
perspective, the character device switch table finds all the functions that can be
called by a character device driver (such as the scsi driver) in character mode.
Major numbers are listed in the I etc/master file, discussed earlier in this
chapter.
System Configuration 1 1 -3 1
11
Here is sample' output from the lsdev command issued on a Series 300, 400, or
700:
Charact er Block Driver
0 -1 /dev/console
1 -1 BP98628 , BP98626 , and BP98642
2 -1 /dev/tty
3 -1 /dev/mem , /dev/kmem , and /dev/null
4 0 CS80 disk
5 -1 BP7970/BP7971 nine-track magnetic tape
6 1 HP9826/BP9836 internal flex disk
7 -1 BP-UI print er
8 -1 /dev/svap
9 -1 BP7974/BP7978 nine-track magnet ic tape
11 2 Amigo disk
13 -1 SRM opt ion
16 -1 Master pty
17 -1 Slave pty
18 -1 IEEE 802 device
19 -1 Ethernet device
21 -1 BP-IB DIL
22 -1 GPIO DIL
23 -1 raw 8042 BIL
24 -1 BIL
25 -1 BIL cooked keyboards
26 -1 c iper printer
47 7 SCSI disk
54 -1 SCSI t ape
55 10 opt ical aut ochanger
For more information, consult the lsdev ( lm) and lssf ( lm) manual pages in the
HP- UX Reference .
System Configuration 1 1 -3 3
11
Minor Numbers
The minor number is a six-digit hexadecimal encryption of address and
characteristic hardware information, stored in the inode of the device's speci al
file. The minor number gives the device driver the channel or connection
through which to perform 1/0 .
Minor numbers are used to distinguish among devices whose major numbers
are identical ( that is, use the same driver ) and are connected to the same
system processor unit ( SPU ) . The minor number typically defines one or both
of the following:
• The device's physical location ( hardware address or logical unit number ) and
switch settings, to enable the system to locate the peripheral.
• Behavioral information. The minor number's content depends on the type of
device; for example, the minor number of a magnetic tape drive encodes tape
density and other behavioral information.
Minor numbers also provide some flexibility in your system configuration. On
Series 300, 400, and 700 systems , the minor number can be decoded by select
code or function number to a specific function on a multi-function card.
Device drivers can use minor numbers to select a communication line ( such
as a specific terminal on a multiplexer ) or operating mode ( such as magnetic
tape drive with different minor numbers to enable different formats ) . In the
following long listing of two device :files of a medium-density tape drive file on a
Series 800,
Nine-track magnetic OxScBaUV Ba = bus address (from switch settings on the tape drive).
tape\ DDS-Format tape U = unit number (O=SCSI drive, 4=HP-IB drive; 4-bits) .
drive V = volume number (4-bit value) , as follows:
bit 3--always 0
bit 2-immediate report (O=on,l=off)
bit 1-close style (O=AT&T,l=Berkeley)
bit 0-rewind on close (O=yes,l=no)
Cartridge tape drive OxScBaUV Ba = HP-IB bus address (from tape-drive swit ch settings) .
U = unit number.
V = volume number ( 0 for single file systems).
Terminal and modem OxScPaOI Pa = Port address (swit ch settings on the device)
0 = 4 bits of 0.
I = hexadecimal 4-bit binary number, defined as follows:
bit 3--always 0
bit 2-0=modem; l=direct connect
bit 1-protocol (O=Simple/USA; l=CCITT/Europe)
bit 0-modem (O=dial-in; l=dialout)
where:
SMB # is a four-bit single hexadecimal digit representing the System
Bus Module number with the following decim al values:
0 Standard Graphics Connect (SGC) slot 1
1 SGC slot 2
2 Core 1/0
4 EISA adapter
8 Processor
9 Memory
Slot # is a four-bit single hexadecimal digit representing the EISA
interface card slot number.
Function # is the four-bit value specifying a particular function if the
interface card is a multifunction al card. The basic function
numbers of the Core 1/0 are listed:
1 S CSI
2 LAN
3 HIL
4 Serial port A
5 Serial port B
6 Parallel
If the interface is not a multifunction card, the function
number contains driver-specific information. (Additional
function numbers may be model-specific.)
Driver Info 12-bit (three-hexadecimal digit) value that can be found in the
HP- UX Reference, section 7 for the particular driver you are
using.
0 0000 0 8 1000 8
1 0001 1 9 1001 9
2 0010 2 10 1010 A
3 001 1 3 11 1011 B
4 0100 4 12 1 100 c
5 0101 5 13 1101 D
6 0110 6 14 1110 E
7 0111 7 15 1111 F
The hexadecimal notation for the Series 700 minor number follows the format
OxSSFDDD , which encodes S MB , slot number, function, and device-specific
information. The minor number for a device connected to the Core I/O SCSI
interface with a driver specific value of Ox333 is:
Ox20 1333
The corresponding binary minor number value is:
I 0010 I 0000 I 0001 I 001 1 0011 001 1 I
These hexadecimal values can be interpreted as follows:
0010 The core I/O card occupies SMB slot is 2.
0000 The core I/O card has no slots .
0001 The S CSI function is number 1 on the core I/O card.
001 1 001 1 001 1 The driver-specific information i s Ox333.
information is Ox333.
Note Function numbers only apply to the Core I/O interfaces and
slot numbers only apply to the EISA interfaces .
Minor numbers might vary from the formula shown, particularly in the case of
pty drivers, which have unique requirements.
SCSI disk drives OxBMFTOO BmF-Bus module and function number of controller,
asfollows:
201 = SCSI on core I/O
4SO = SCSI on EISA (s = slot number on EISA bus)
T-Target number (0-6 = bus address setting on device)
00-Place holders for disks
DDS-format tape drive OxBMFTDO BmF-Bus module and function number of controller,
as follows:
201 = SCSI on core I/O
4SO = SCSI on EISA (S = slot number on EISA bus)
T-Target number (0-6 = bus address setting on device)
D-Device compression, partition selection bits
0-0peration bits (e.g. immediate reporting, rewind)
(See Installing Peripherals for DDS
tape D and 0 bit definitions.)
System Configuration 1 1 -4 1
11
Minor Numbers on Series 800
/dev/ [ r ] dsk/c#d# [ l# ] s#
where:
r Indicates a raw (character) interface to the disk.
c# Specifies the controller number. The # should be replaced with
a capitalized hexadecimal representation of the select code.
d# Specifies the bus (target) address, a number representing the
entire device.
[1#] The logical unit number (1) is used to identify specific units in
integrated devices.
/dev/ [ r ] dsk/c###d# [ l# ] s#
where:
r Indicates a raw (character) interface to the disk.
c### Specifies the controller bus module and function number; the
### can be:
201 = core 1/0 (the default)
4# = EISA bus (4) and slot number (#). If specifying a
device on an EISA bus, only two (not three) digits follow the
c (for example, 41).
d# Specifies the target number, the address set on the device
itself. This number represents the entire device.
[1#] Disk arrays require a logical unit number, which designates
specific device units .
s# The s# stands for section number. This i s typically zero,
except when using software disk striping (refer to the System
Administration Tasks manual for information) .
On Series 800 systems , default disk device files are shipped as follows:
/dev/ [ r ] dsk/c#d#s#
where:
r Raw interface to the disk.
c# Controller, represented by the lu number.
d# Drive number; always 0 .
s# Section number.
The assignment of controller, drive, and section numbers is described in the
System Administration Tasks manual. Additional information about disks can
be found in disk (7) in the HP- UX Reference Manual.
/dev/ [ r ] ac/c#d#_pp
where:
r Indicates a raw ( character ) interface to the disk.
c# Specifies the controller bus module and function number; the #
can be:
Capitalized hexadecimal representation of select code ( Series
300/400)
201 = core 1/0 (Series 700 default )
4# = EISA bus (4) and slot number (# ) .
Logical unit number ( Series 800)
d# Specifies the target number, the address set on the device
itself. This number represents the entire device.
Underscore ( always present ) .
pp Disk platter number and side (a or b ) .
For further information, consult the chapter, "Setting u p Devices Using
HP-UX Commands," in the Installing Peripherals for your system. Also see
autochanger(1) in the HP- UX Reference Manual.
System Configuration 1 1 -4 7
11
• h (high) for 6250 bpi.
• m (medium) for 1600 bpi .
• 1 (low) for 800 bpi .
c indicates data compression.
n indicates no rewind on close.
For example, I dev /rmt/2mn is raw device 2 at 1600 bpi with no rewind and no
compression.
Additional information about 9-track magnetic tape is available in mt(7) of the
HP- UX Reference Manual.
/dev/rmt/c#d#m l c [ n ]
where:
r indicates a raw (character) device.
c# specifies the controller number, in capitalized hexadecimal
notation.
d# is the device number.
mlc indicates density. Use either m for medium density (standard
DDS format) or c for compressed density.
n indicates no rewind on close.
Additional information about DDS cartridge tape can be found in mt(7) of the
HP- UX Reference Manual.
/dev/rmt/#qic
1 1 -48 System Configuration
11
for default AT&T-style QIC format, or
/dev/ [ r ] ct/ [ r ] c# [ d# ] [ s# ]
where:
r indicates a raw interface to the cartridge tape; the second r is
reserved to indicate that this cartridge tape is on a remote
system.
c# indicates the controller number.
d# ?Ptionally indicates the drive.
s# optionally indicates a section number.
The assignment of controller, drive, and section numbers is described in the
System Administration Tasks manual; also see in ct(7) of the HP- UX Reference
Manual.
/dev/hpib/# [ a# ]
where:
System Configuration 1 1 -5 1
12
12
H P - UX Peripherals
HP-UX Peripherals 1 2- 1
Magnetic Tape
Perhaps the closest thing to an industry standard for mass media, nine-track
( 1/2-inch) magnetic tape ( "magtape" ) serves as a low-cost, high-capacity
medium to store information. Magnetic tape is also the most interchangeable
medium between different hardware and operating systems.
Tape Density
The measure of the amount of information which can be stored in a given area
of tape is known as tape density. Bits per inch (bpi ) , a common measure of
tape density, is the number of bits per track , recorded per inch on the tape.
For nine-track tape, eight data bits and one parity bit are written across the
width of the tape simultaneously. Thus for nine-track tape, bpi is synonymous
with characters per inch (cpi ) . One of these characters is sometimes called a
frame.
File Marks
A special command to the drive writes a :6.le mark to the tape. A file mark
is a special type of record recognized by the drive and reported as a Boolean
condition during reading. It is not possible to write a file mark as ordinary
data.
Single file marks are used to separate logical files on tape. Two consecutive file
marks are used to signify the logical EOT. Data is undefined past the logical
EOT.
I
B u rst Doto Mork
A
( �
_l_
12
•
DOD • • •
DD -
Loa d Physical
Point EOT
When writing a tape, a number of frames are written by the drive in a single
transaction. This collection of frames is called a record. Part of the record,
but invisible to the user, is a cyclic redundancy check (CRC). The CRC is
recorded as some additional frames on the tape. There is a very short blank
section between the true record and the CRC . Following the CRC is a nominal
1 / 2-inch gap of unrecorded tape, known as the inter-record gap or IRG. The
next record follows the gap. If either the frame parity or the CRC is incorrect
when the tape drive reads the tape, an error is generated by the drive. Newer
formats ( 1600 bpi and above ) generate a preamble and postamble to help
synchronize the read logic.
Coding
Tape is recorded in several ways. Older systems use Non Return to Zero
Immediate (NRZI) coding, and record with a tape density of either 200, 556, or
800 bpi ( bits per inch ) . Newer tapes use Phase Encoding ( PE ) and record at
1600 bpi, or they use Group Coded Recording ( GCR) and record at 6250 bpi.
There may be other forms of coding as well, but these are the most common.
The HP 7971 supports a density of 1600 bpi, the HP 797 4 and HP 7979
support both 1600 bpi and ( optionally ) 800 bpi, and the HP 7978 and HP 7980
magnetic tape drives support a density of 1600 and 6250 bpi.
The higher the density, the more information can be stored on a tape. On a
2400 foot tape, an HP 797 4 at 800 bpi can only store 22 MB of data, at 1600
bpi the HP 7974 can store 43 MB , while an HP 7978 storing at 6250 bpi can
write up to 140 MB of data to a tape at a rate of up to 16 MB per minute.
Preventive Maintenance
There are several maintenance procedures for tape. A tape can be completely
erased (degaussed) , or the beginning of the tape can be discarded and a new
load point put on (stripped) . There is also a tape cleaning ·and certifying
machine that will knock off any loose oxide and check that the tape will record
properly over its full length (certified) . This always makes any data on the
tape unusable. Commerci al shops certify their tapes fairly often, and discard
them if they get too short or fail to certify. It is also an excellent idea to clean
the tape head and guides of your drive periodically as they tend to accumulate
loose oxide and other contaminants .
Tape Streaming
Tape drives are designed to transfer data by one of two methods - st art/ stop or
streaming .
The HP 7971 is a start/stop tape drive, and is designed to stop and restart
the tape fairly quickly. The HP 7971 transfers data with very little buffering
between the computer and the tape drive's read/write head; the drive must
stop the tape between records, and wait for the next record.
The HP 797 4, HP 7978, and HP 7980 are streaming magnetic tape drives.
I
I I �I� I 11 11 111
111
LBOT Records F i lem a r k 2 F i l emarks
Tape archives such as these are sometimes called filesets, since they usually
consist of many files . A tape can consist of one or more files or filesets, with
the files separated by single :filemarks . The last file is followed by a double
filemark, representing EOD . The mt command is used to space between the
files .
1 2- 1 O HP-UX Peripherals
For More Information
For information on DDS-format tapes and their operation, refer to the
following resources:
• User's manual for the HP Series 6400 Model 1300 DDS-Format Drive 12
( available as 1300H for HP-IB and 1300S for S CSI ) .
• Installing Peripherals manual, for information on customizing HP-UX for a
DDS-format drive.
• mt(7) manual page in the HP- UX Reference.
HP·UX Peripherals 1 2- 1 1
Cartridge Tape Drives
In addition to nine-track magnetic tapes and DDS-format tapes,
Hewlett-Packard manufactures a series of 1 /4-inch data cartridge tapes used
12 for the installation and updates of HP-UX. The cartridge tapes can also be
used for inexpensive backups . These data cartridges, model HP 88140, have
most of the benefits of nine-track magnetic tape but are cheaper and easier to
handle. However, they do not offer the same level of data interchange between
non-HP-UX machines as the nine-track or DDS-format tapes and are much
slower to use.
Like nine-track magnetic tape drives , cartridge tape drives can stream data in
immediate response/report mode. See the discussion of "Immediate Response
Mode" earlier in this chapter.
HP 9 144/45 cartridge tape drives are supported on Series 700 systems . They
require an optional EISA HP-IB card, customization of your default df ile
with the HP-IB device drivers , and appropriate device files.
1 2· 1 2 HP·UX Peripherals
CD-ROM File System {CDFS)
CD-ROM is an acronym for Compact Disc-Read Only Memory, a technology
for mass distribution and easy retrieval of large amounts of information.
Compact Discs ( or CDs ) contain approximately 550 megabytes ( MB ) of data 12
per disk. The information on the CD is virtually permanent ; you can read data
from a CD, but cannot write to it . Data on CDs is prepared and mastered
using a specialized publishing process .
In addition to the information contained in this section, you can learn more
about CD-ROM technology from these HP manuals:
• CD-ROM: The Basics , part number 5954-9709-discusses the introductory
concepts of CD-ROM technology.
• HP Series 6100 Model 600/S CD-ROM Drive User's Guide , part number
A1999-90002-describes the HP Series 6100 Model 600 / S SCSI CD-ROM
Drive.
• HP Series 6100 Model 600/A HP-IB CD-ROM Drive User's Guide, part
number C l 707-90000-describes the HP Series 6100 Model 600 / A HP-IB
CD-ROM Drive. ( Note, the HP-IB CD-ROM drive is not supported on the
Series 700. )
Overview of Implementation
Thjs section discusses the file system format for CD-ROM data, and the
standards which define it.
HP-UX Peripherals 1 2- 1 3
standard document i s Information Processing (Volume and File Structure of
CD-ROM for Information Interchange ( IS O . 9660: 1988 ( E ) ) .
The file system formats described by these two standards differ in some areas ,
but are largely identical. HP-UX supports CD-ROM media that conform to
12 either specification, hiding the differences from you.
1 2- 1 4 HP-UX Peripherals
CDFS_BFID Returns the bibliographic file identifier for the primary
volume whose root directory is specified by fildes,
terminated with a NULL character. Maximum size for
outbuf : 38 bytes .
CDFS_CFID Returns the copyright file identifier for the primary volume 12
whose root directory is specified by fildes , terminated with
a NULL character. Maximum size for outbuf: 38 bytes.
CDFS_VOL_ID Returns the volume ID for the primary volume specified by
fildes , terminated with a NULL character. Maximum size
for outbuf : 33 bytes .
CDFS_ VOL_SET _ ID Returns the volume set ID for the primary volume specified
by fildes , terminated with a NULL character. Maximum
size for outbuf: 129 bytes.
For example, suppose the volume ID for a CDFS volume is desired. The
following code retrieves this information:
Command Changes
Compared to the kernel effort , only minor code changes were necessary in the
HP-UX commands. This is due to the fact that most of the low-level details
are hidden within the system call and kernel work, thus allowing commands to
function independently of file system type.
Most HP-UX commands work transparently under CDFS . A few commands,
however, are not applicable to CDFS volumes, either because of the read-only
nature of the medium, or because they are inherently HFS-oriented. These
commands are unsupported under CDFS , and include the following:
clri( lM)
convertfs( lM)
diskusg( lM)
fsck( lM)
fsclean( lM)
fsdb(lM)
mediainit( lM)
mkf s ( lM)
ncheck( lM)
newf s ( lM)
tunef s ( lM)
No new commands have been added as a result of CDFS support .
Enabling CDFS
Before being able to mount and use CDFS volumes, the appropriate kernel
code must be configured into the kernel.
1 2· 1 6 HP-UX Peripherals
Series 300/400/700 Configuration for CDFS
To add the CDFS code to the Series 300/400/700 kernel, add the cdfs keyword
into the appropriate df ile. If the S CSI driver is needed for the CD-ROM drive
that 's been chosen, add the scsi keyword as well. Reconfigure the kernel using
conf ig and make , or the sam program. 12
HP-UX Usage
Once the kernel has been reconfigured and the necessary device files created,
the CDFS volume can be mounted. Mounting a CDFS volume is done in
exactly the same way as mounting an HFS volume.
Once mounted, HP-UX commands can be used to list, edit ( without making
changes ) , print , or copy files on the CDFS volume. Any executable files on
the CDFS volume can be directly executed on HP-UX. Other CDFS or HFS
volumes can be mounted on top of the mounted CDFS volume. In short ,
anything that does not require modifying the data on the CDFS volume may
be done.
Many things can also be done programmatically. Files may be opened, read
from, stated, checked for accessibility, etc., via the normal HP-UX system calls
and library routines. Again, only those library routines and system calls which
do not require modifying the CDFS volume data can be used successfully.
Rewritable Optical
12
Traditionally, mass storage solutions have fallen into one of two categories
primary or secondary storage. Primary storage is typically one or more fixed
magnetic hard disks. It is fast , random-access storage with moderately high
capacity and is used as the online system disk.
Primary storage is used to store applications, heavily accessed databases,
or files on which you are currently working and using extensively. It is also
used for applications needing virtual memory, fast data processing, report
generation, and complex calculations.
Secondary storage has consisted of one or more offiine storage devices-usually
a 1/4-inch or 1/2-inch tape drive, or a flexible disk drive on smaller systems.
These devices are used primarily to back up the system disks and are also used
for logging transactions, distributing software, archiving historical data, and
exchanging data between systems.
There's a gap between primary and secondary storage in terms of access time
and cost per megabyte. Average access time for hard disks is measured in tens
of milliseconds . Access time for information on tapes is measured in tens of
seconds for a mounted tape, minutes to hours for a tape in the library. The
cost of magnetic disk storage is a few dollars, while tape storage costs a few
cents per megabyte.
Rewritable optical fills this gap . With an average access time in the . 1- to
10-second range, and a cost of a few cents per megabyte more than tape
storage, optical drives create a new layer in the storage hierarchy called Direct
Access Secondary Storage (DA S S ) . Figure 12-3 illustrates this concept .
1 2- 1 8 HP-UX Peripherals
Traditional Mass
storage Devices
Primary Storage
• High Perfonnance Hard Disks
Performonce: Access in
m i l l iseco n d s
Cost: /
Cents M byte
• Applications
/
H istoric a l Archiva l
Stora g e
Unattended Backup/Restore
Docume n t Storage & Retrieva l
• Sequential Tape Drives for
Backup/Interchange
Performance : Acc e s s in
minutes
Cents/Mbyte
HP·UX Peripherals 1 2· 1 9
performance magnetic hard disks . Therefore, the optical disk library system
would not be good as a hard disk replacement .
·
.::
·•
• • '1
.. · ..�. .
.
.
.
.
. ,. .
·. '
.. ,
;
..
:
"
,
\
.
•
Figure 1 2·4 Optical Disk L "brary
• . System concept
Terminal Configuration
The Installing Peripherals supplied with your computer discusses the hardware
aspects of connecting a terminal to your system. This section offers the
software configuration information you need.
After connecting the hardware, terminals must be configured so they can
communicate with HP-UX. If a particular configuration option is not available
on your HP terminal, the option is already properly chosen ( as a default value )
by the terminal.
Use the Installing Peripherals to determine the typical terminal and data
communications parameters. The manual supplied with the terminal describes
how to use the function keys to configure the terminal. Generally, you press a
key that chooses the "terminal configuration" option and alter the appropriate
fields by answering prompts from the terminal's configuration program.
Except when using the terminal as a system console ( discussed below ) , you
may use any baud rate that the terminal can handle. The baud rate setting
on the terminal must match the baud rate parameter in the getty command
located in the terminal's entry in the /etc/ inittab file as discussed below.
Otherwise, it must reference a gettydefs entry that cycles the baud rate to
select the correct one.
If you are using the terminal as the system console, set the terminal's baud
rate at 9600. After the system is installed and running, you may change some
of the configuration parameters to suit your own needs. Further information is
provided in the next section ( "Special Considerations for Terminals" ) and in
getty(lM), gettydef ( 4) , and inittab( 4) in the HP- UX Reference.
• action is respawn; this indicates that the specified command (getty in this
case) is to be re-invoked once the process terminates (typically, when the user
logs off) .
The process field contains the /etc/getty command for a terminal. It can be
followed by up to three parameters:
-txxx is the optional time-out option for use with modems.
All external HP-IB connections require that your system have HP-IB I/O
hardware (optional on some systems). In all cases , you will need appropriate
device drivers configured into the kernel and device files created. Each device
attached to the bus must have a unique HP-IB address. See the Installing
Peripherals for further information.
When connecting multiple HP-IB devices, daisy-chain configurations are more
reliable than multiple devices connected at a single point .
Cabling requirements affect HP-IB operating speed. Consult the Installing
Peripherals and documentation shipped with your peripheral for guidelines.
When using HP-IB and other multiple-access external buses, consider what
priority the peripherals should have for accessing system resources. HP-IB
connections provide either standard-speed or high-speed data transmission,
depending on the slowest peripheral connected to the bus. (The exception to
this is the standard-speed internal HP-IB connection on the Series 300, which
transmits data only at standard speed. )
For example, a high-speed HP-IB might be used t o advantage for accessing
the system disk containing root and swap , while standard-speed HP-IB might
be configured with a cartridge-tape drive, which takes longer to respond and
might interfere with higher-speed devices .
On the Series 300 and 400, the system root device ( hard disk ) is typically
located at select code 14, bus address 0 on a HP 98625B or HP 98262A
high-speed disk interface card.
On a Series 300, the internal HP-IB is pre-set at select code 7. You can
change this select code in the Boot ROM configuration mode. The Boot ROM
configuration mode is discussed in the Appendices of the Installing Peripherals
manuals. On the Series 300, 400, and 800, consider the following factors:
• An HP 7974 or HP 7978 nine-track tape drive should be placed on a
high-speed HP-IB interface, if possible. You can also use that same HP-IB
for the root device.
• Plotters and the HP 9 1 1 1 graphics tablet should be placed on separate
standard-speed HP-IB interfaces when possible. Typical HP-IB addresses are
5 and 6 for plotters and graphics tablets, respectively.
• A void putting flexible disk drives and cartridge tape drives on the same
HP-IB interface as the root device, except as noted above.
Networking 1 3· 1
Network Architecture and the OSI Model
A network architecture is a structured, modular design for networks. HP 's
network architecture conforms to the reference model of Open Systems
Interconnection (OSI), a network architecture mode developed by the
International Standards Organization (IS O ) . NS, ARPA, and NFS Services are
implemented based on the OSI model.
In the OSI model, connectivity is divided among seven logically distinct
modules called layers , each of which performs a specific data communication
13 function. Interfaces between layers allow communication with adjacent layers
or with a peer layer on a remote computer.
Table 13- 1 shows each layer and its function.
1 3·2 Networking
HP-UX Networki ng
Networking software corresponds to specific layers of the OSI model and can be
thought of in three broader categories:
• links, corresponding to layers 1 and 2 .
• transports, corresponding t o layers 3 through 6.
• services, corresponding to layer 7.
Table 13-2 shows the relationships of links and transports to HP-supported
networking services . For example, the LAN link enables access to Network 13
Services (NS) through the TCP /IP transport layer or to FTAM through the
OTS layer.
Some of these components are bundled into integrated products. For example,
the TCP /IP transport is bundled with LAN and X.25 products; the 802.4 link
is included in the HP OSI Express MAP 3.0 product .
Networking 1 3-3
Networking Documentation
For a good overview of all networking services, refer to the manual Networking
Overview . Also, networking reference pages are located in the HP- UX
Reference . The designation (3N) denotes networking library.
As a system administrator, you are most likely to deal with networking
issues from the perspective of services. Table 13-3 summarizes the services
implemented in HP-UX and manuals available for each element in the
preceding table. (Manuals can be ordered through your local HP sales
13 representative.)
1 3·4 Networking
Table 13·3. Available Networking Services
Networking 13·5
Table 1 3-3. Available Networking Services (continued)
1 3-6 Networking
Table 1 3-3. Available Networking Services (continued)
Networking 1 3-7
14
System Accounting
System Accounting 1 4· 1
What I s in This Chapter?
HP-UX system accounting allows you to accomplish accounting tasks using
many versatile commands. This chapter describes concepts underlying use of
these accounting commands in the following sections:
• "Accounting System Planning and Billing" suggests how to approach setting
up and using an accounting system.
• "Overview of System Accounting" gives background information useful for
using system accounting.
• "System Accounting Set-up Guidelines" summarizes what happens when you
set up , enable and disable system accounting.
• "System Accounting Files" shows the directory structure and contains brief
definitions of system accounting files .
14
• "Disk Space Usage Accounting" illustrates the use of the accounting
commands that monitor disk space utilization on a per-user basis.
• "Connect Session Accounting" describes the commands that record and
report connect session accounting information.
• "Process Accounting" discusses methods for generating per-process
accounting data and reports.
• "User Fees" introduces an HP-UX tool for charging fees to users.
• "Accounting Summaries and Reports" surveys the daily and monthly
accounting reports that can be generated to monitor system performance and
bill users.
• "Disk Quotas" describes a system of tools that enable you to limit disk usage
by user or file system.
Time Considerations
When collecting data by connect-session and process accounting, you can bill
usage of computer resources differently during busy or less busy periods. When
reporting computer time usage, system accounting distinguishes between prime
and non-prime time, which is defined in the /usr/ l ib /acct/hol idays file.
Prime vs Non-prime Connect Time. Prime time is the time during the day when
the computer system is most heavily used-typically from 9 :00am to 5:00pm.
Non-prime time is the remaining time during the day when the system is used
less-typically from 5:00pm to 9:00am.
Prime time is in effect only on weekdays (Monday through Friday). Non-prime
time is in effect during the weekends (Saturdays and Sundays) and on any
14 holidays specified in the hol idays file.
You can specify prime and non-prime time on your system by editing the file
/usr/lib/acct/hol idays .
Updating the Holidays File. The file /usr/lib/acct/hol idays contains the
information that System Accounting needs to distinguish between prime and
non-prime time. Here is a typical hol idays file:
Note As delivered, the holidays file contains valid entries for typical
prime/non-prime time, and holidays. Edit this file to reflect
your organization's requirements.
14
system reporting
accounting t---i� & summarizing reportS
commands commands
LG200 1 72_001
Summary Reports
The data tabulated in total accounting records can provide insight on specific
areas. They can also be combined to produce comprehensive summaries
of computer resource usage. Several tools for summarizing and reporting
accounting information are discussed later in this chapter.
1 4· 1 0 System Accounting
How System Accounting is Turned On
When HP-UX is switched into multi-user mode, the system initialization shell
script re executes the command st artup , which starts system accounting by
performing the following functions:
• Calls acctwtmp to add an initial record to / etc/wtmp . This record is marked
by storing "acctg on" in the device name field of the I etc/wtmp record.
• Turns on process accounting via turnacct on, which executes accton with
the filename argument /usr/adm/pacct . This directs the kernel to collect
process-accounting data in the file /usr/adm/pacct . ( Additional information
on turning on process accounting is found later in this chapter. )
• Removes work files left in the /usr/adm/acct/sum directory by runacct .
14
.._
.. .. /ate/wt. m p
....,___,,
/ate/re
remove work
files from
/usr/adm/acc1/su
directory
LG200 1 72_1l02
1 4- 1 2 System Accounting
System Accounting Files
System Accounting uses a multi-level directory structure to organize its many
accounting files, some of which are permanent and others temporary. Each
directory in this structure stores related groups of files, commands, or other
directories.
I
/ ( root )
usr
/ ""' etc
ho
odrn I
__
Active data
/ wtrnp
re
shutdown 14
col lection files
pocct
===---- 1 ------
acct
I I I I
nite sum fiscal acct
System Accounting 1 4- 1 3
• /usr/adm-contains all active data-collection files, such as pacct and fee.
• /usr/adm/acct-contains the nite, sum, and f i scal directories described
below.
• /usr/adm/acct/nite-stores data files that are processed daily by runacct .
• /usr/adm/acct/sum-cumulative summary files updated by runacct are
kept here.
• /usr/adm/acct/fiscal-periodic ( monthly ) summary files created by
monacct are stored here.
• /usr/lib/acct-System Accounting commands reside here.
• I etc-contains wtmp , and shell scripts re and shutdown.
Filename Contents
dtmp Output from the acctdusg or diskusg programs .
fee Output from the chargefee command (ASCII total accounting records ) .
pacct The current active process accounting file.
pacct? Prior process-accounting files switched via turnacct swit ch.
Filename Contents
act ive Used by runacct to record progress. It contains warning and error
messages. act ive mmdd is the same as act ive after runacct
detects an error.
ctacct . mmdd Total accounting records created from connect session accounting
where mmdd is the month and day the file was created.
ctmp Output of acctcon1-connect session records.
daycms ASCII daily command summary used by prdaily .
daytacct Total accounting records for current day.
disktacct Total accounting records created by the dodisk command.
fd2log Diagnostic output from the execution of runacct ( refer to crontab 14
entry ) .
lastdat e The last day runacct was executed, in dat e l # + %m %d format .
( Refer to d at e ( l ) in the HP- UX Reference for a description of
+%m%d date format . )
lock and lock1 Used to control serial use of runacct .
lineuse Terminal ( tty ) line usage report used by prdaily .
log Diagnostics output from acctcon1 .
logmmdd Same as log after runacct detects an error.
reboots Contains beginning and ending dates from wtmp, and a listing of
reboots.
stat ef ile Used to record the current state being executed by runacct .
tmpwtmp wtmp file , corrected by wtmpf ix.
wtmperror Error messages, if any, from wtmpf ix .
wtmperror mmdd Same as wtmperror after runacct detects an error .
wtmp . mmdd The previous day's wtmp file.
Filename Contents
ems Total command summary file for current month in intern al
summary format .
cmsprev Command summary file without latest update.
day ems Command summary file for previous day in internal summary
format .
loginlog Shows the last login date for each user.
rpt mmdd Daily accounting report for date mmdd .
taeet Cumulative total accounting file for current month.
taeetprev Same as taeet without latest update.
14 taeet mmdd Total accounting file for date mmdd .
wtmp . mmdd Saved copy of wtmp file for date mmdd . Removed after reboot .
Filename Contents
ems ? Total command summary for month ? in internal summary format .
fiserpt ? Report similar to prdaily for the month ? .
taeet ? Total accounting file for the month ? .
1 4- 1 6 System Accounting
Disk-space Usage Accounting
System accounting provides the means to monitor disk space used by individual
users. Before reading this discussion, you might want to review the "HFS File
System" chapter of this manual. Also, if you are interested in setting limits on
disk-space usage, refer to the section at the end of this chapter, entitled "Disk
Quotas."
Disk-usage commands perform three basic functions, which are illustrated in
the figure below:
• tabulate disk usage by file system
• report disk usage (in blocks) for individual users
• summarize disk usage in a form that can be merged with other accounting
records, to produce reports by commands such as prtacct or runacct .
14
file
find name
list
disk
clodlsk . Total
usage acctdlsk
Accou nti
report Records
file-system
I nodes
LG200172_003
1 4- 1 8 System Accounting
The output of diskusg is normally used by acctdisk to create disk total
accounting records. In addition, diskusg is normally called by dodisk.
The syntax of the diskusg command is:
System Accounting 1 4- 1 9
$ f ind I -hidden -print I acctdusg
00350 fred 11
0035 1 bill 30
00352 mike 17
00353 Sarah 13
00354 molly 18
00000 root 3
00004 adm 36
0000 1 bin 2434
When using diskusg, the device file of the disk is specified.
$ diskusg /dev/dsk/OsO
0 root 106 16
1 bin 778
14 4 adm 96
350 fred 14
35 1 bill 32
352 mike 20
353 S arah 16
354 molly 22
355 j ulie 2
50 1 guest 2
A Security Note
It is possible for malicious users to defeat disk-space accounting by assigning
their files to other users with chown(2) or chown(l), which by default , all
users can execute. If necessary, restrict access to these commands for some or
14 all users with the s etpri vgrp ( 1M) command. To restrict chown use to the
superuser, add the following line to / et c/re :
setprivgrp -n CHOWN
To permit one or more groups of users to use chown, add a line for each group
to I etc/re, similar to the following:
14
login acctcon2
I nit Total
prctmp
Accounting
Records
Report
l.G2Q0172_004
fwtmp [ - i c ]
Ifno option is specified for the fwtmp command, input is in binary format and
can be converted to ASCII readable format . Output results differ, depending
on whether you use - i , - c , or - ic :
Option Description
- ic Input is in ASCII readable form and is to be converted to binary form. This
is essentially the opposite of using fwtmp without any options .
-i Both input and output are in ASCII readable format . This is the same as
wtmpf ix [ files]
See the System Administration Tasks manual and fwtmp(lM) in the HP- UX 14
Reference for information on using wtmpfix.
Recording Connect-session Statistics
Total accounting records for connect-session accounting are created by the
acctcon2 command.
Prior to generating the total accounting records , however, you use acct con1 to
produce columnar output from I etc/wtmp and prctmp to provide headings for
your columnar output . Both acct con1 and acctcon2 are found in acctcon(lM)
of the HP- UX Reference . Prctmp is a shell script found in acctsh(lM).
Acctcon1 converts the sequence of login and logout records read from
I etc/wtmp into output in columnar AS CII format . This output can be
supplied as input to prctmp or acctcon2 , two commands that generate
connect-session reports.
The columnar output of acctcon1 resembles that of fwtmp ( shown previously ) ,
but sorts by different categories, including device address and duration of
connect time.
$ acctcon1 < /etc/vtmp
20095488 353 sarah 1665 2478 479518335 Tue Kar 12 16 : 32 : 1 5 1985
521012224 352 mike 479493590 Tue Kar 12 09 : 40 : 00 1985
520095488 351 bill 0 5012 479521475 Tue Kar 12 17 : 24 : 35 1985
52101 1712 0 root 41047 6488 479475173 Tue Kar 12 04 : 32 : 53 1985
Option Description
-p This option tells acct con1 not to produce one record per connect session.
Instead, acctcon1 simply echoes its input-one line per wtmp record
showing line name, login name, and time (in both seconds and day /time
format). Using this option is similar to using fwtmp, except that this
option doesn't show status information, whereas twtmp does.
-t acctcon1 maintains a list of lines on which users are logged in. When it
reaches the end of its input , it emits a session record for each line that still
appears to be active. It normally assumes that its input is a current file, so
that it uses the current time as the ending time for each session in progress.
The -t flag causes it to use, instead, the last time found in its input , thus
assuring reasonable and repeatable numbers for non-current files .
-1 file This option causes a line usage summary report to be placed in file . This 14
report shows each line's name, number of minutes used, percentage of total
elapsed time used, number of sessions charged, number of logins, and
number of logins and logoffs. This report can be used to keep track of line
usage , identify bad lines, and find software/hardware oddities.
Note that hang-up , termination of login, and termination of the login shell
each generate logoff records; therefore , the number of logoffs is often three
to four times the number of connect sessions .
-o file Using the -o option (for example, acct con1 -o £_overall ) creates a
concise file containing a record of the accounting period, giving starting
time, ending time, number of reboots, and number of date changes.
Acct con1 options can be combined, as shown in the following example, which
uses both -1 and -t options. Also, the standard output of acct con1 is
redirected to the file ctmp :
The prctmp command simply puts headings above the output created by
acctcon1 , thus making the report more readable.
14 Since prctmp takes its input from standard input , pipe the output from
acctcon1 into prctmp as follows:
$ acctcon1 < / etc/wtmp I prctmp
Total
acctprc2 Aooountlng
Records
Display
14 Report
LG200 1 72_005
The command ckpacct is typically invoked by cron hourly to ensure that the
current process accounting file /usr/adm/pacct does not become too large.
If disk space becomes critically short , process accounting is turned off until
14
sufficient space is available.
The syntax of ckpacct is:
ckpacct [ blocks]
If the size of pacct exceeds the blocks argument , 1 000 by default if blocks is
not specified, then turnacct switch is executed. turnacct switch renames
the current pacct file and creates a new pacct file.
If the amount of free space falls below a threshold of 500 blocks, ckpacct
automatically turns off process accounting via turnacct off . When free space
exceeds the specified threshold, process accounting is reactivated.
The kernel can also enforce a size limit on the size of pacct . This takes
precedence over the limit set by ckpacct . Refer to acctsh ( 1M) and acct(2) in
the HP- UX Reference for more details.
If /usr I adm/pacct becomes too large, a new /usr I adm/pacct file is created
via turnacct switch.
The turnacct swit ch renames the current /usr/ adm/pacct file so that it no
longer receives data, and creates a new, empty /usr I adm/pacct file.
turnacct switch is used to create a new /usr I adm/pacct file when the
current /usr/adm/pacct file is too large. The action of turnacct switch can
be summarized as follows:
1 . Process accounting is temporarily turned off.
2. The current pacct file is renamed to pacct incr , where incr is a number
starting at 1 and incrementing by one for each additional pacct file that is
created via turnacct swit ch.
3. After the old pacct file is renamed to pacct incr , a new, current pacct file
is created.
4. Process accounting is restarted; the kernel starts writing records to the
newly created pacct file.
14
The following sample report illustrates the default use of acct com.
$ acct com
ACCOUBTllG RECORDS FROM : Thu Kar 21 12 : 52 : 26 1985
COKKAl'ID START EID REAL CPU KEAi
HAKE USER TTYIAKE TIME TIME (SECS ) (SECS ) SIZE (K)
#acct on root console 1 2 : 52 : 26 12 : 52 : 26 0 . 12 0 . 10 19 . 00
ls sarah tty07 14 : 04 : 08 14 : 04 : 08 0 . 28 0 . 23 1 6 . 50
ckpacct adm '!' 14 : 30 : 00 14 : 30 : 05 5 . 13 1 . 45 24 . 00
pvd bill tty10 15 : 09 : 07 15 : 09 : 07 0 . 48 0 . 22 22 . 50
:find sarah tty07 18 : 51 : 37 18 : 51 : 39 2 . 73 0 . 15 26 . 50
t abs root console 19 : 10 : 18 19 : 10 : 18 0 . 92 0 . 13 23 . 50
stty root console 19 : 10 : 19 19 : 10 : 19 0 . 88 0 . 08 26 . 00
mail bill t ty10 19 : 10 : 21 19 : 10 : 22 1 . 78 0 . 23 28 . 50
nevs root console 19 : 10 : 23 19 : 10 : 23 0 . 73 0 . 12 23 . 00
acct com adm ttyaO 19 : 53 : 16 19 : 53 : 38 22 . 58 2 . 55 28 . 50
#dat e root console 19 : 58 : 26 12 : 58 : 26 0 . 12 0 . 10 19 . 00
14
Definitions o f Information Produced by acctcom
The MEAN SIZE estimate is determined from the current process's memory
usage at each system clock interrupt , and is therefore subject to statistical
sampling errors. Only the memory resident pages of a process are counted; no
pages in the swap space are counted. Shared code and data are divided among
the processes using them. MEAN SIZE is divided by the number of processes
sharing the code or data.
Listed below are columns not displayed in a standard acct com report , but can
be displayed by using acct com options. The acctcom options used to generate
these columns are described in the next section.
The options described here allow you to select the records that are included
in the report produced by acctcom. See your System Administration Tasks
manual for usage examples.
Option Description
-1 lin e Display only the processes executed from the user terminal /dev/ /ine .
- u user Show only the processes belonging to user.
-g group Show only processes belonging to group , which may be specified by
either group name or group ID .
-s time Select processes existing at or after tim e . Time is specified in 24-hour
format- hr[: min [:sec]] .
-e time Select processes existing at or before tim e . Time is specified in 24-hour
format hr[: min [:sec]] . 14
-S time Select processes starting at or after time where time is in 24-hour format.
-E time Display only processes terminated at or before tim e , where time is in
24-hour format hr: [min [: sec]] . Note both the -S and -E options with the
same time argument cause acct com to display only processes existing at
the specified time .
-n pattern Show only the commands matching pattern . pattern can be a regular
expression as described in ed( l ) , except that + means one or more
occurrences.
-H factor Display only processes whose hog factor exceeds factor.
-0 time Show only processes whose system CPU time exceeds time , specified in
seconds.
-c sec Show only processes whose total CPU time ( SYS + USER ) exceeds sec
seconds.
-I chars Display only processes transferring more characters than the limit given
by chars .
By default , the output of acct ems is in internal summary record format ; if you
display it to your terminal, all you see is gibberish. To get a AS CII, readable
report , use the -a option.
The -a option causes acctcms to produce a report with descriptive column
headings . Total and average ( mean ) execution statistics for each command are
displayed-one line per command-along with total and average statistics over
all commands in the report .
The AS CII reports produced by acctcms contain more than 80 characters per
line. When displayed at an 80-column terminal, the lines wrap around on the
screen , and if printed on an 80-column printer, some of the rightmost columns
of the report are lost . Therefore, compensate as follows:
Header Descriptions
Descriptions of the columnar data produced by acct cms are shown in the
following table.
Option Description
-c Sort the commands in descending order on TOTAL CPU-MIN , rather than
by default TOTAL KCOREMIN. This report can be used to determine which
commands are using most of the computer's CPU time.
-n Cause the report to be sorted in descending order on the column named
NUMBER CMDS . Commands toward the start of this report are the ones
used most frequently; commands toward the end are used least often.
-j Combine all commands invoked only once on one line of the report . This
line is denoted by having "***other" in the COMMAND NAME column. This
14
option is useful for shortening a report that has many one-invocation
commands.
-o Used only with the -a option , -o causes the report to be generated only
for commands that were executed during non-prime time ( as specified in
the holidays file ) . You can use this option to get a non-prime time
command summary report .
-p Also used only with the -a option , -p elicits a report generated only for
commands that were executed during prime time ( as specified in
holidays ) . This option is used to get a prime time command summary
report .
acctprc 1 [ ctmp ]
where ctmp contains a list of login sessions of the form created
by acctcon1 , sorted by user ID and login name.
Note number can be any whole number from -32K to 32K; when
charging fees, remember that a user's total fees must be within
this range.
l..G200172Jl08
l..G200 1 72Jl07
Prtacct produces a columnar report with one line per total accounting record,
with the following column headings :
14
cron
Daily
Interim
prdaily Summary
Reports ReporlS
Up to Nlne Monthly
Total Accounting monacct Summary
Records Reports
l.G200172_008
States of runacct
Sometimes runacct fails and terminates abnormally. The primary reasons for
runacct failure are:
• a system crash
• not enough disk space remaining in /usr 14
The Daily Line Usage Report summarizes connect-session accounting since the
last invocation of runacct . It logs system reboots, power failure recoveries ,
and any other records dumped into / etc/wtmp via acctwtmp, and provides an
analysis of line utilization.
The FROM/TO banner in the first part of the report identifies the period covered.
The times are the date-time the last report was generated b y runacct , and
the date-time the current report is generated. It is followed by a log of system
Column Description
LINE The terminal line or access port being reported on.
MINUTES The total number of minutes that the line was in use during the
accounting period.
PERCENT The percentage of TOTAL DURATION that the line was in use :
PERCENT = (MINUTES / TOTAL DURATION) * 100
# SESS The number of times that this port was accessed for a login session.
14
# ON Historically, this column displayed the number of times a port was used
to log a user on. However, since login is no longer be executed to log in
a new user, this column should be identical to # SESS.
# OFF This column reflects the number of times a user logs off and any
interrupts that occur on the line . Interrupts occur on a port when getty
is first invoked, which happens when the system is brought to run-level 2 .
If # OFF exceeds # O N b y a large factor, the multiplexer, modem, or
cable is probably deteriorating, or a bad connection exists somewhere.
The most common cause is an unconnected cable dangling from the
multiplexer.
The I etc/wtmp should be monitored regularly, as this file from the source of
connect-session accounting data. If I etc/wtmp grows rapidly, execute acctcon1
to determine the noisiest line. If interruptions occur at a high rate, general
system performance is affected .
The Daily Resource Usage Report summarizes resource usage, by merging all
total accounting records and displaying the information by individual user.
This report gives a by-user breakdown of system-resource usage. The format
of this report is identical to that produced by the prt acct command. ( For
Last Login
The Last Login simply shows the last date and time each user logged into the
system. It is useful for finding likely archive material or for removing unused
user directories.
prdaily [ -1 ] [ -c ] [ mmdd ]
where:
• The -1 option prints a report of exceptional usage by login name for the
specified date. This option might reveal which users are consuming excessive
14
amounts of system resources. The limits for exceptional usage are kept
in the file /usr/lib/acct/ptelus . awk and can be edited to reflect your
installation's requirements.
• The - c option is valid only for the current day's accounting, and is used to
identify exceptional resource usage by command. The limits for exceptional
usage are maintai�ed in the file /usr/lib/acct/ptecms . awk and can be
edited to reflect your system's needs.
• mmdd is an optional report date. If no date is specified, prdaily produces a
report of the current day's accounting information.
monacct number
where number specifies month or period ( Ol=January, 12=December ) . If
number is not specified, monacct assumes it is being invoked for the current 14
month. This default is useful if monacct is executed via cron on the first day
of each month.
Descriptions of the files created in the acct/fis cal directory follow:
• ems ? contains the total command summary file of the accounting period
denoted by ? . The file is stored in internal summary format . To display this
file, use the acctcms command. The following example shows how to display
this file for June:
$ acctcms - a -s /usr/adm/acct/nit e/f iscal/cms06
• f i scrpt ? contains a report similar to that produced by prdaily. The
report shows line and resource usage for the month represented by ? . To
display the fiscal accounting file for November, enter:
$ cat /usr/adm/acct/nite/f iscal/f iscrpt 1 1
• t acct ? i s the total accounting file for the month represented by ? . To
display this file, use the prtacct command. The following example shows
how to display the total accounting summary file for January:
You need to decide which file systems warrant disk-quota controls . Typically,
only file systems containing users ' home directories and possibly the /usr file
system require disk quotas . Do not assign quotas to the /tmp directory, which
is historic ally a less restricted environment that is periodically purged of excess
files by other means .
You can set disk quotas on all users on a file system, or only specific users,
by using the edquota command, discussed later in this chapter. You can also
establish separate limits for the number of files ( designated as inodes ) and
number of blocks ( given in units of one kilobyte ) per user.
When setting up disk quotas, be sure these file systems have adequate available
space for data collection. Note that the quot as file grows based on the numeric
Imposing disk quotas involves setting soft and hard limits on the amount of file
space a user can consume. The soft limit , or quota, is the amount of file space
allocated for a given user, and can be exceeded temporarily. The hard limit , or
limit , is the maximum amount of file space allowed by a given user.
The grace period for exceeding the quota is set by the system administrator, or
left at the default of one week. Once the grace period expires , a quota becomes
a hard limit .
If a user exceeds the hard limit , a disk quota mechanism in the operating
system kernel prevents files from being written to disk, thus compelling the
user to remove files . 14
Any file open in violation of the disk quota cannot be written and its original
contents are destroyed. Operations that truncate or remove then rewrite files
might fail, because the system refuses to allocate new resources to the offending
user. Such operations might result in loss of data. For this reason, users
should be warned to heed system warnings when they exceed quotas and take
corrrective action as soon as possible, when the system warns them they have
exceeded quota.
L.G2001 72Jl09
All disk-quota commands work via the system call quotactl(2), which
14
communicates with the kernel via two disk-quota data structures:
• struct dqblk data structure, defined in quota . h
• struct mount mount tables defined in mount . h . The mount table has a flag
indicating whether quotas are enabled.
The quotactl(2) system call commands are used to update both the data
structures and the quotas file with mappings of each file system. The quotas
file retains information on disk-quota settings and utilization statistics for the
operating system.
When file systems are mounted, the kernel sets up internal tables in memory
containing statistics on usage and limits. The kernel uses these internal tables
to maintain information about disk resources allocated or released for users
with quotas. The information is :flushed to the quotas files on each file system
whenever the file system is unmounted ( such as during a shutdown ) , to prevent
losing the information.
A quot as file, created at the root of each affe cted file system, stores limits
and utilization statistics for each user for the entire file system. To enable
disk quotas, you must create a quotas file. It is not an ASCII file, but can be
accessed in ASCII form by using the edquota command.
quotaon(lM) activates disk quotas on one or more file systems. Its syntax is:
/etc/quotaon [ -v ] -a
14
/etc/quotaon [ -v ]file_sys . . .
quotaoff( lM) suspends enforcement of disk quotas on one or more file systems.
Its syntax is:
/etc/quotaoff [ -v ] -a
/etc/quotaoff [ -v ]file_sys . . .
The following options and arguments apply to both quotaon and quotaoff :
-v Produce verbose output.
-a Enable or suspend disk quotas on all mounted file systems
cited with the quota option in I etc/ checklist .
file_sys Enforce or suspend disk quotas on specified mounted file
systems. The file_sys argument is the name of either the
directory on which the file system is mounted or the block
special file of the file system.
Either -a or file_sys must be specified.
Both quotaon and quotaoff work by calling quotactl(2). quotaon and
quotaoff update the status field of devices located in /etc/mnttab to indicate
whether quotas are being enforced.
quotacheck( lM) is used to maintain usage statistics on a file system with disk
quotas . Each file system being checked must have a quotas file at its root .
Quotacheck examines each specified file system and builds a disk-usage table
of user IDs and blocks used, which it compares to a table stored in that file
system's quotas file. If inconsistencies are detected, both the quotas file and
the kernel quotas table are updated. ( Inconsistencies typically develop if a
system mounted with disk quotas has been used for a period of time with
quotas enforcement suspended. )
Quotacheck is executed at various times:
• During a reboot , quotacheck(lM) can be run from /etc/bcheckrc, before
activating disk quotas with quotaon.
• When interactively mounting a file system assigned quotas , quotacheck
14
should be run after the mount .
/etc/quotacheck [ -v ] -a
/etc/quotacheck [ -v ]file_sys . . .
Like quotaon and quotaoff , quotacheck uses a -v ( verbose ) option, -a
option instructing the system to check all mounted file systems listed in
/etc/checklist , and file_sys argument , for checking specific mounted file
systems.
Since quotacheck accesses the raw device in calculating the actual disk usage
for each user, the file systems checked should be inactive when quotacheck is
executed. This is most efficiently done in single-user mode.
edquota(lM) is the command used to edit the quotas file, something you must
do to set disk quotas . Its syntax for editing user quotas is:
Editing Disk-Quota Time Limits. Time limits are used to enforce disk quotas.
Enforcement changes from warning message to restriction after a specified time
limit . The syntax for specifying the time limit for a given file system is:
/etc/edquota -t
When invoked, edquota -t creates an AS CII representation of the quotas file
much like this:
However, if the user exceeds the time limit by ignoring warnings to remove
files or reaches the limit by creating more files or blocks than alloted, the
system prevents the user from writing files. In fact , any file the user attempts
to open and write might be destroyed and the following message (in this case,
by friendly vi(l)) is displayed:
DISK LIMIT REACHED - WRITE FAILED (/users )
Your edited changes will be lost if you do not complete
a successful write command before exit ing . If you were
writing out to your original file , the previous contents 14
of that f ile have been destroyed . Contact your System
Administrator BEFORE exiting if you need ass istance .
[Hit return to cont inue . ]
The user is thus compelled to remove files to below the assigned disk quota.
One thing to bear in mind (and inform users on your system): do not panic
when you get a "WRITE FAILED" message. If you work in a windows
environment, open up another window. If you are not running X-Windows or
some other window manager, suspend the job. From the shell, remove some
unnecessary files, then return to the process. The process is still in memory,
and once you return to it , if you have brought the number of files or blocks
below quota, you will then be able to save the file.
As the user creates files, the number of blocks and files the user owns is shown
in the usage and files columns.
/usr/etc/rpc . rquotad
Manipulating Disk Quotas Programmatically-quotactl
repquota quotas
File
quotactl(2)
Summary of Disk Data
Usage and Quotas Structures
l.G2001 72_010
option, to report on two specific file systems (I and /users). The -a option
can be used instead to read all mounted file systems in /etc/checklist :
$ repquota -v I /'users
/dev/root (/) :
Block limit s File limit s
User used soft hard t imeleft used soft hard t imeleft
julie 20 100 2000 4 50 400
fred 400 100 2000 50 min 20 50 400
/dev/dsk/1s0 (/users ) :
Block limits File limit s
User used soft hard t imeleft used soft hard t imeleft
bill 593 1000 1 200 192 500 700
julie 947 1000 1 200 700 500 700 IDT STARTED
fred 4150 3000 6200 4 days 800 1000 1500
The output shows three users, bill, j ulie, and fred. The system is set up
so that they can create a small number of files in the root directory, but are
allotted more space in the /users file system. j ulie and fred have files in the
root directory as well as in /users .
System Accounting 1 4· 7 1
User fred has exceeded his quota (soft limit) of lK blocks allocated on both I
and /users . login warns him of the condition whenever he logs in, but having
neglected to heed warnings and decrease block numbers below acceptable levels,
fred now has only 50 minutes before the soft limit is enforced as a hard limit
in the I directory. He faces the same restriction in /users if he fails to cut his
block usage below the 3000K-block quota.
Once time runs out , the t imeleft field will read EXPIRED . The kernel will
allow fred to log in, but the login program will report to him that he has
exceeded his quota. Any login process that creates space on the disk will fail.
Any command that he runs that creates new blocks will fail. All he will be able
to do is delete files or the contents of files, until he has brought his account
below quota.
User j ulie faces a similar problem. Although she has not exceeded her block
14
allocation, she has not only exceeded her quota for number of files, but has
reached the hard limit of number of permissible files. Once she exceeded quota,
she too received login warnings . Having reached the hard limit , she is unable
to create files on /users .
The t imeleft field shows j ulie's transgression somewhat cryptically with the
notation "NOT STARTED" . When a user reaches allotted hard limits, whether
block or file, time is irrelevant . The system no longer permits the user to do
anything other than comply with disk quotas.
address
In the context of peripheral devices, a set of values that specify the location
of an 1/0 device to the computer. On the Series 300/400, the address is
composed of up to four elements: select code, bus address, unit number
and volume number. On the Series 800, the address is composed of up to
five elements: bus converter, module number, slot address, device switch
setting, and logical unit number. Addresses on the Series 700 are composed
of device, module number, and switch setting.
Addresses are covered in more detail in Chapter 1 1 , "System Configuration"
and the manual Installing Peripherals.
advisory lock Glossary
A file lock placed on a file to inform (warn) other processes wanting to
access the file that it is already being accessed and potentially being
modified. Advisory locks are useful only among cooperating processes that
use file locking. (See Chapter 8 , "HFS File System" .)
access
An interaction between a subject and object resulting in information
:fl.owing from one to the other.
access control list (ACL)
A set of entries associated with a file that specify permissions for all
possible user-ID/group-ID combinations. (See acl(5) in the HP- UX
Reference and HP- UX System Security.)
access control mechanism (ACM)
An algorithm and data structure that supports access control decisions.
It mediates decisions about whether specific subjects can access
specific system objects in specific ways. An ACM might be implicit
Glossary- 1
(contextual) ,e.g. "only user ID 0 can access files in /etc" . It might be
explicit , as in a list of objects and their access rights. An explicit ACM
might be distributed (data stored with protected objects), as in the UNIX
file permissions scheme, or it might be centralized, as in a file describing
access rights for all protected system objects.
allocation policy
Allocation policy governs how disk space is distributed. When using the
Logical Volume Manager (LVM) , the allocation policy governs how disk
space is distributed to logical volumes and how extents are laid out on an
LVM disk.
(See Chapter 9, "Logical Volume Manager" .)
archived library
Object files that are linked to a program when called, regardless of whether
another copy of that library already exists in memory. Compare with
shared library.
ARPA hostname
Needed for ARPA Services. A name consisting of one field containing any
Glossary printable character except spaces, newlines, or the pound ( See NS_ARPA
attribute
In an HP-UX cluster, the attributes are characteristics of the cluster
nodes , such as the cluster node name or processor type. The attributes
are collectively referred to as the cluster node's context . (See Managing
Clusters of HP 9000 Systems.)
audit trail
A set of records that collectively provide documentary evidence of
processing, used to aid in tracing from original transactions forward to
related records and reports, and/or backwards from records and reports to
their component source transactions.
G lossary-2
audit ID
An ID associated with each user when trusted systems are used. The audit
ID does not change, even when executing programs with a different user ID .
( See Chapter 5, "Process Management" and HP- UX System Security.)
auto creation
If you create a CDF, but specify only the path name of the CDF and not
a subfile, the system automatically creates a CDF subfile named after the
cluster node name attribute. This is known as autocreation. ( See Managing
Clusters of HP 9000 Systems .)
available memory
Memory is used by the system for executing user processes. It is the
amount of physical memory ( main memory ) on your system not reserved
by the HP- UX kernel for device drivers, system data structures, and other
kernel needs. ( See Chapter 7, "Memory Management" . )
background process group
A process group that is currently not running as the foreground process
group. Typically, only one process group at a time is the foreground process
group in a session, while all other process groups are background process G lossary
groups.
bad block relocation
A feature of LVM for recovering corrupted blocks of data from HP-FL and
SCSI disks, by redirecting the data to another block of media on the disk.
( See Chapter 9, "Logical Volume Manager" . )
binding
The process by which the operating system's self-configurating capabilities
find hardware on the bus architecture and associate it with relevant
software ( device files and device drivers ) . ( See Chapter 1 1 , "System
Configuration" . )
bit
The smallest unit of information in a digital computer. Its value can be
either 0 or 1. Bits are normally grouped together in bytes and words .
G lossary-3
bits per inch
A common measure of "tape density." Indicates how many bits can be
stored per inch of magnetic tape. ( See Chapter 12, "HP-UX Peripherals" .)
block
The fundamental unit of information HP-UX uses for access and storage
allocation on a mass storage medium. Block size on an HFS file system
can be either 4 KB or 8 KB, and is set at file system creation. The default
block size is 8 KB. However, to present a more uniform interface to the
user, most system calls and utilities use "block" to mean 512 bytes,
independent of the actual block size of the medium. (See Chapter 1 1 ,
"System Configuration" . )
block device
A hardware device that transmits and receives data in blocks . (See Chapter
1 1 , "System Configuration" . )
block mode
Also termed buffered I/O . Data is held in the buffer cache, then transferred
one block at a time. Block size for buffered I/O is not the same as
Glossary block size on the file system. Block size for buffered I/ 0 is defined as
BLKDEV _IO SIZE in /usr/include/sys/param . h. Compare with raw
mode. (See Chapter 1 1 , "System Configuration" .)
boot or boot-up
The process of loading, initializing and running an operating system. (See
Chapter 2, "System Startup" . )
boot area
Eight kilobytes of the disk that are reserved for system use. This area
contains the LIF volume header, the directory that defines the contents of
the volume, and the bootstrapping program. On the Series 300 and 400, the
8 KB are at the beginning of the disk; on the Series 700, they are at the
end of the disk; and on a standard implementation of Series 800, they are
in their own section (typically section 6) or logical volume. On a Series 800
implementing either LVM for the root file system or the SwitchOver/UX
product , the LABEL file is stored in the boot area. (See Chapter 8, "HFS
File System" .)
Glossary-4
boot process
A process that runs during the HP-UX phase of system startup. For
example, I etc/re and I etc/brc are boot processes . ( See Chapter 2,
"System Startup" . )
boot ROM
The boot ROM is small, machine language program that resides in your
computer's read-only memory. When you boot or re-boot the system, the
computer starts the boot ROM program which takes control of the system.
The boot ROM tests computer hardware, finds some devices accessible
through the computer, and loads an operating system. ( See Chapter
2, "System Startup" in this manual or Chapter 5, "System Boot-Up
Problems" in Solving HP- UX Problems .)
bpi
See bits per inch.
buffer cache
A buffer which remains in memory and which is used by the file system for
buffering writes to the file system. ( See Chapter 8, "HFS File System" . )
G lossary
bus
Hardware that carries data and signals between hardware modules within
the system. Typically, a bus is implemented as soldered parallel wires either
on a frame to which boards are plugged, on a board housing multiple chips,
or internal to a processor for transmission to and from memory, other
processors, or other buses.
bus address
Part of an address used for devices ( such as HP-IB , SCSI, EISA, or
HP-FL ) ; a number determined by the switch setting on a peripheral that
allows the computer to distinguish between two devices connected to the
same interface. A bus address is sometimes called a device address; no two
devices on the same HP-IB can have the same bus address. ( See Chapter
1 1 , "System Configuration" . )
bus converter
A board that serves as an internal interface between higher- and
lower-speed bus, typically the SMB and Mid-Bus. The bus converter
handles timing and bus protocol management . Because more than one can
G lossary-5
be connected to the SMB , bus converters can also increase the number of
modules in a system, thus enabling more devices to be connected.
byte
A basic unit of digital computer information, consisting of 8 consecutive
bits.
byte offset
On the Series 800, a 32-bit quantity that points to the specific location
of the virtual address space being accessed. (See Chapter 7, "Memory
Management" .)
bytes per inode
This specifies the number of data bytes (amount of user file space) per
inode slot . The number of inodes is calculated as a function of the
file system size. The default value is 2048 . (See Chapter 8, "HFS File
System" .)
cache
A small high-speed memory between RAM (main memory) and the
processor that may hold data and text for active processes. Cache designed
Glossary
into computer-system architecture accelerates effective memory transfer
rates and processor speed. If the data is not in cache, the processor consults
the translation tables in RAM that hold the mapping between virtual and
physical addresses of the data. ( See Chapter 7, "Memory Management" .)
Glossary-&
CDF
Context-dependent file. The mechanism used by HP-UX clusters to share a
path name between different cluster nodes in a cluster. A CDF consists of a
hidden directory and one or. more subfiles. ( See Managing Clusters of HP
9000 Systems .)
channel adapter manager ( CAM)
On the Series 800, the type of device driver ( cio_caO ) for the CIO bus that
provides the software interface to device adapters ( such as hpibO, muxO,
and scsi2 ) . The channel adapter manager manipulates data between the
memory mapped I/O and CIO bus .
channel I/ 0 adapter
On the Series 800, a chip on a board or one or several Mid-Bus cards that
serve as an internal interface between the Mid-Bus and the lower-speed CIO
bus. The channel adapter synchronizes the different speeds and bandwidths
of the Mid-Bus and CIO bus. The channel adapter also manages direct
transfer of data to and from main memory with minimal CPU intervention,
and by extension, to the rest of the I/O system. More than one channel
adapter can be installed on a system, thus expanding the number of
possible modules. Glossary
character device
Typically, a device which is not a block device and which transfers data a
character a time. Printers, plotters, terminals, magnetic tape drives, and
pseudo devices are all examples of character devices. (See Chapter 1 1 ,
"System Configuration" . )
clean byte
A flag in the primary superblock which the fsck command uses to
determine whether the file system state is consistent . (See Chapter 2,
"System Startup" and Chapter 8, "HFS File System" .)
cluster
An HP-UX cluster is one or more workstations linked together with a local
area network (LAN ) , but consisting of only one file system, HP-UX clusters
are supported on Series 300/400/700 only. (See Managing Clusters of HP
9000 Computers.)
Glossary-7
cluster client
A cluster node that does not have the root file system for the cluster on its
local disks. Its file system resides on the cluster server. However, cluster
clients can have locally mounted disks for local data storage. ( See Managing
Clusters of HP 9000 Computers.)
cluster node
A computer in a cluster. ( See Managing Clusters of HP 9000 Computers.)
cluster server
The cluster node that acts as a file-system server for all the clients in an
HP-UX cluster. ( See Managing Clusters of HP 9000 Computers.)
cluster server process (CSP)
A special kernel process that runs on a machine in a cluster to satisfy
requests from other nodes in the cluster. There are two kinds of CSP, the
limited CSP ( LCSP ) and the general CSP ( GCSP ) . ( See Managing Clusters
of HP 9000 Computers.)
code segment
The memory in segment into which a process 's executable code is loaded by
GIossary
exec. S ame as the text segment . ( See Chapter 7, "Memory Management" . )
comment lines
In the context of system accounting, lines in the holidays file that
begin with an asterisk ( * ) in the first column. ( See Chapter 14, "System
Accounting" . )
company holiday lines
Used in the system accounting file, /usr/lib/acct/holidays , to denote
holidays. ( See Chapter 14, "System Accounting" . )
configuring
Telling the operating system what physical hardware is present , by
associating the hardware with necessary software-device drivers and device
files. ( See Chapter 1 1 , "System Configuration" . )
connect session
This denotes the period of time in which a user is connected to the system.
Glossary-8
It starts when the user logs in and finishes when the user logs out. ( See
Chapter 14, "System Accounting" . )
context
The mode ( either system or user ) a process is in when executing. ( See
Chapter 5 , "Process Management" . )
In HP-UX clusters, context is an AS CII string comprised of a number
of attributes that determine which subfile ( if any ) is accessed from a
CDF. Each workstation on a cluster has an associated context set at boot
time. The context attributes include cluster-node name; processor type;
floating point hardware; file system location; and the string "default" . ( See
Managing Clusters of HP 9000 Computers.)
context-dependent file
A file in a cluster having different contents, depending on which cluster
node uses it . A context-dependent file consists of a hidden file and one
or more subfiles. Also called a CDF. ( See Managing Clusters of HP 9000
Computers.)
controlling process
The session leader that connected to the controlling terminal. ( See Chapte:P l ossary
5 , "Process Management" . )
controlling terminal
Every session has exactly one controlling terminal, which all processes
in that session, by default , use for standard input, standard output , and
standard error. Every controlling terminal is associated with, at most , one
session. ( See Chapter 5, "Process Management" . )
copy-on-write
On Series 300/400, when a process forks, the parent process plans a
duplicate image of itself at child virtual addresses. But instead of actually
copying the image, the parent pages are marked "copy-on-write." The pages
continue to reside in the parent address space, and are not copied until the
process actually writes on the page. On Series 700/800, HP-UX implements
a variation of copy-on-write, called "copy-on-access." ( See Chapter 7,
"Memory Management" . )
G l ossary-9
cron
This process wakes up every minute to execute commands at specified dates
and times, according to instructions in files contained in the directory
/usr/spool/cron/crontabs . See the cron(lM ) and crontab(l ) entries in
the HP- UX Reference for more details.
CS/80
A family of mass storage devices that communicate with a computer via the
CS /80 (Command Set '80) or SS/80 ( Sub Set '80) command set. In HP-UX
your file system can be on either a SCSI drive or a CS /80 drive.
cylinder
One or more vertical collections of tracks in a disk pack. Disk accesses
within a cylinder do not need a seek. (See Chapter 8, "HFS File System" .)
cylinder group
One or more consecutive cylinders. Each cylinder group contains a
superblock, inodes, cylinder group information, and data blocks. (See
Chapter 8, "HFS File System" .)
Glossary- 1 o
daily resource usage report
A report produced by system accounting, which summarizes resource
(e.g. , disk, memory, cpu) usage for the day. ( See Chapter 14, "System
Accounting" .)
DASS
Direct Access Secondary Storage. A form of mass storage with
characteristics of both online magnetic disk primary storage and offiine
magnetic tape secondary storage. ( See Chapter 12, "HP-UX Peripherals" in
this manual and autochanger ( 7 ) in the HP- UX Reference Manual. )
data segment
A memory segment into which a process 's static and dynamic data is
stored. ( See Chapter 5, "Process Management" .)
demand paging
A form of virtual memory management in which pages are brought into
memory only as they are accessed. At any one time, only a subset of the
process need be loaded into main memory. (See Chapter 7, "Memory
Management" . )
Glossary
demand-loadable
Even though HP-UX is a demand-paged virtual memory system, it still
attempts (by default) to load an entire process into main memory. If,
instead, code is marked as demand-loadable, then the process's code will be
brought into physical memory only as pages are accessed.
demand-paged virtual memory
This is the type of memory management implemented on Series 300 and 800
computers. See also demand paging.
destination device
The mass storage device on which HP-UX is to be installed or updated.
The destination device must be a hard disk drive.
device adapter
Interface cards (such as HP-IB , HP-FL , S CSI, LAN , and MUX cards)
installe d in the I/O slots of the CIO , HP- PB , EISA , or other bus. Device
adapters make the crucial link that enables the system to communicate
with external peripherals (such as terminals, printers, disk drives) . Device
Glossary- 1 1
adapters are frequently called 1/0 cards. CIO device adapters are also
called CIO cards; HP-PB device adapters are called HP-PB cards. ( See
Chapter 1 1 , "System Configuration" and Installing Peripherals.)
device adapter manager (DAM)
On the Series 800, the type of device driver that deals with the
device-adapter protocol. For example, hpibO handles HP-IB data protocol
transfer for the CIO bus; hpib 1 handles HP-IB data protocol transfer for
the HP-PB bus. (See Chapter 1 1 , "System Configuration" .)
device manager (DM)
On the Series 800, the type of device driver (such as mux ) that translates
requests from the CIO bus to the attached interface card. (See Chapter 1 1 ,
"System Configuration" .)
device driver
On the Series 300/400/700, the term used for the driver that controls kernel
data structures from the interface card to the external device itself. On the
Series 800, device driver is also used more generally to mean the software
that enables the operating system to transmit data between the computer
Glossary and the external device. Series 800 device drivers include channel 1/0
adapter manager (CAM), device manager (DM), device adapter manager
(DAM ) , and logical device manager (LDM ) . (See Chapter 1 1 , "System
Configuration" .)
device :file
See special :file.
device swap space
Swap space that occupies a disk, section, or logical volume of a disk
reserved exclusively for swapping. It is fast . Because at least one swap
device must be present on a system, device swap space is also referred to as
primary swap space. (See Chapter 7, "Memory Management" .)
Glossary- 1 2
disk quotas
A subsystem used to limit the number of files and file blocks a user can own
per file system. (See Chapter 14, "System Accounting" . )
disk sectioning
On Series 800 systems, disks can be divided into sections, each one
appearing to the operating system as if it were a separate disk. This
is known as disk sectioning or partitioning. A more flexible Series 800
alternative to disk sectioning is provided by the Logical Volume Manager
(LVM) . ( See Chapter 8, "HFS File System" and Chapter 9, "Logical
Volume Manager" .)
diskless workstation
Same as a cluster client .
driver
Compiled code (supplied with HP-UX) , which resides in the kernel and
handles input and output with peripheral devices. Also called device driver.
( See Chapter 1 1 , "System Configuration" . )
driver number
Glossary
A number identifying a device driver. Same as major number. ( See
Chapter 1 1 , "System Configuration" . )
disk
Collection of recording platters contained in a single disk drive or disk-drive
library.
domain
The set of objects that a subject has the ability to access. A set of
(object , rights) pairs. Each pair specifies an object and some subset of
the operations that can be performed on it . A right in this context means
permission to perform one of the operations.
dynamic swap space
Swap space allocated as needed while the system is running. Compare this
with primary swap space. Both device and file-system swap can be added
dynamically. ( See Chapter 7, "Memory Management" .)
Glossary- 1 3
effective user ID
A form of user ID that allows users access to files they do not own. (See
Chapter 5, "Process Management" .)
effective group ID
A form of group ID that allows users access to files not in their group. (See
Chapter 5, "Process Management" .)
enforcement mode
A form of file locking in which a user is not allowed to read or write to a
file while another user is accessing the file. In such a case, the requesting
process sleeps until the process that has control of the file releases it . (See
Chapter 8, "HFS File System" .)
exchange
An exchange occurs when an optical autochanger replaces one disk surface
in the optical drive with another. (See Chapter 12, "HP-UX Peripherals" .)
extent
Fixed-size addressable areas of space on an LVM disk or in memory.
On disk, these areas are called physical extents, and are by default 4
Glossary
MB . Physical extents map to areas in memory, called logical extents. If
disk mirroring (HP MirrorDisk/UX product) is used, each logical extent
corresponds (maps) to more than one physical extent . If disk mirroring
(HP MirrorDisk/UX product) is not used , there is a one-to-one relationship
between the two types of extents. ( See Chapter 9, "Logical Volume
Manager" .)
file
A discrete collection of information described by an inode and residing on a
mass storage medium.
file locking
Measures which help to ensure that only one user at a time can access a
particular file or files . See enforcement mode and advisory lock. (Also, see
Chapter 8, "HFS File System" .)
file mark
A special type of record written to tape and recognized as a boolean
condition during reading. Single file marks separate records on tape; two
Glossary- 1 4
consecutive file marks indicate the end of tape. (See Chapter 12, "HP-UX
Peripherals" .)
file-system swap space
A secondary form of swap space, enabled by sam and set in
I etc/ checklist , that allows a process to use an existing file system if
device swap space is insufficient to meet demand-paging needs.
File-system swap is slower than device swap but varies in size with the
system's swapping activity. (See Chapter 7, "Memory Management" )
file types
The file type is established at the time of the file's creation. The types are:
• Regular files - Contains a stream of bytes. Characters can be either
ASCII or non-AS CII. This is generally the type of file a user considers to
be a file: object code, text files, nroff files, etc.
• Directory - HP-UX treats directories like regular files, with the exception
that writing directly to directories is not allowed. Directories contain
information about other files.
• Block special files - Device files that buffer the I/ O . Reads and writes to
block devices are done in block mode. Glossary
• Character special files - Device files that do not buffer the I/ 0 . Reads and
writes to character devices are in raw mode.
• Network special files - contain the address of another system.
• Pipes - A temporary file used with command pipelines. When you use a
pipeline, HP-UX creates a temporary buffer to store information between
the two commands. This buffer is a file, and is called a pipe.
• FIFO - A named pipe. A FIFO (First In/First Out) has a directory entry
and allows processes to send data back and forth.
• symbolic link - A type of file that indirectly refers a path name.
file system
The organization of files and directories on a hard disk. The HFS file
system is an implementation of the HP-UX directory structure. NFS
provides access to a file system over a network. (See Chapter 8 , "HFS File
System" . )
Glossary- 1 5
foreground process group
The process group in a session which currently is executing in the
foreground and has control of the controlling terminal. (See Chapter 5,
"Process Management" .)
fragment
A piece of a block. This is the smallest unit of information HFS will
read or write. The lower limit of a fragment is DEV _BSIZE (defined in
/usr/include/sys/param . h) . Fragment size is set at file system creation.
(See Chapter 8, "HFS File System" .)
frame
A single, nine-bit character on a magnetic tape. ( See Chapter 12, "HP-UX
Peripherals" .)
free space threshold
Specifies minimum percentage of free disk space allowed. Once the file
system capacity reaches this threshold, only the system administrator is
allowed to allocate disk blocks. The default is 10% ; if it is less, file system
performance degrades. The free space threshold is set when you create a
Glossary new file system. Same as minfree. (See Chapter 8 , "HFS File System" .)
fs_bsize
The size of disk blocks in the file system. (See Chapter 8, "HFS File
System" . )
generic device file
A device file whose cluster node ID is O , thus allowing it access by all
cluster nodes . (See Managing Clusters of HP 9000 Systems ; (Series
300/400/700 only.)
gateway page
A Series 800 address range used for switching between user and kernel
privileges when making system calls.
group access list
A list of groups whose users are allowed access to a file. (See Chapter 5,
"Process Management" and Chapter 8 , "HFS File System" .)
Glossary- 1 6
halting
Bringing the system to a complete stop, a state in which no processes are
running. The only way to get HP- UX running again is to cycle power or do
a hardware reset. (See Chapter 2 , "System Startup" .)
hard limit
In disk quotas, a hard limit (also termed limit) is the maximum amount of
file space allowed by a given user. (See Chapter 14, "System Accounting" .)
hardware path
The sequence of hardware addresses from bus converter (if applicable) , to
module, to device adapter, to device.
HFS :file system
High performance File System, the file system implemented on HP-UX 9000
systems. (See Chapter 8, "HFS File System" .)
hidden directory
A directory used to implement a CDF. It is called hidden because it is
normally treated and seen as a file. It can be accessed as a directory
only by appending the special character "+" to its name. (See Managing
Glossary
Clusters of. HP 9000 Systems .)
home directory
The directory into which a user is placed after login. The user's home
directory is defined in the I etc/passwd file. ( See Chapter 4, "Login" . )
homogeneous cluster
An HP-UX cluster containing only systems of the same architecture (for
example, all Series 300 and 400 or all Series 700). (See Managing Clusters
of HP 9000 Systems .)
HP-P B
HP Precision Bus. Refers to the hardware I/O architecture of HP
9000 models such as Models 8x2 and 8x7. (See Chapter 10, "System
Architectures" . )
HP-P B adapter
See device adapter.
Glossary- 1 7
HP-UX directory structure
The hierarchical grouping of directories and files on HP-UX. ( See Chapter
8, "HFS File System" and A Beginner's Guide to HP- UX.)
Glossary- 1 8
1/0 mappings
The range of addresses the operating system uses to deal with I/O devices.
ITE
The Internal Terminal Emulator program which allows a bit-mapped
display to function as a standard computer terminal.
job
An individual instance of a command. Can also be two or more commands
piped together. (See Chapter 5, "Process Management" .)
job control
HP-UX commands and key sequences that allow users to manage jobs more
effectively. (See Chapter 5 , "Process Management" , A Beginner's Guide to
Using Shells , and Using HP- UX .)
kernel
The core of the HP-UX operating system. The kernel is the compiled code
responsible for managing the computer's resources , such as memory, file
system and input/output (1/0). The kernel resides in RAM (Random
Access Memory) whenever HP-UX is running. (See Chapter 1 1 , "System
Glossary
Configuration" .)
kernel stack segment
Virtual address space that contains the run-time stack when a process is
running in kernel mode. (See Chapter 7, "Memory Management" .)
LIF
Logical Interchange Format. LIF is Hewlett-Packard's standard file format ,
used for transferring files between Hewlett-Packard systems. Since LIF is a
standard, files with LIF format can easily be transferred between different
Hewlett-Packard computers (See Chapter 8, "HFS File System" and lif( 4)
in the HP- UX Reference.
logical volume
When using the Logical Volume Manager (LVM) , a logical volume is a
storage device, much like a disk section but of flexible size, that can hold
a file system (including root ) , raw data, application program, or swap .
Logical volumes can be mirrored using an optional product , HP LVM
Mirroring.
Glossary- 1 9
Because its data is distributed logically (rather than physically ) , a single
logical volume can be mapped to one LVM disk or span multiple disks, but
the logical volume itself is used as a single virtual disk. ( See Chapter 9,
"Logical Volume Manager" . )
Logical Volume Manager (LVM}
An operating system software module that implements virtual (logical)
disks to extend, mirror, and improve the performance of physical disk
access. ( See Chapter 9, "Logical Volume Manager" . )
LVM disk
A disk that has been initialized for LVM; also termed a physical volume.
(See Chapter 9, "Logical Volume Manager" .)
limit
In disk quotas, a limit (or hard limit ) is the maximum amount of file space
allowed by a given user. ( See Chapter 14, "System Accounting" . )
link level address
A unique 12-digit hexadecimal number which is part of every LAN card .
This number appears on the LAN card hardware, on the boot ROM screen,
GI ossary
and can be obtained using the landiag program.
local login script
A . login script , contained in a user's home directory, which provides local
control over the user's working environment . (See Chapter 4, "Login" .)
local swapping
In an HP-UX cluster, cluster clients can have locally mounted disks to
which they can do swapping. This is known as local swapping. (See
Chapter 7, "Memory Management" and Managing Clusters of HP 9000
Systems .)
logical device manager (LDM}
On the Series 800 , the kind of device driver that translates requests between
the interface card and the external peripheral. For example, lprO.
login
The process by which user gains access to HP-UX. This process consists of
Glossary-20
entering a valid user name and its associated password (if one exists). (See
Chapter 4, "Login" . )
lockable memory
Memory that can be locked into memory by processes via the plock and
shmctl system calls (described in section 2 of the HP- UX Reference). (See
Chapter 7, "Memory Management" .)
logical unit (lu)
The logical unit (lu) specification is created by insf ( lm) to allow one
device driver to handle many devices. The lu is mapped into a table that
the kernel then consults to determine which specific hardware address
the driver wants to access . The lu allows the system administrator
to keep track of all configured devices belonging to the same class of
device. ( See insf(lm) in the HP- UX Reference and Chapter 1 1 , "System
Configuration" . )
magneto-optical (MO)
Magneto-optical is a form of rewritable optical technology. (See Chapter 12,
"HP-UX Peripherals" .)
Glossary
major number
An index into a device driver table in the kernel. It is needed to
communicate with peripheral devices. (See Chapter 1 1 , "System
Configuration" .)
manufacturing automation protocol (MAP)
A communications standard enabling HP-UX to control factory-floor
equipment , including robotics. ( See Chapter 1 1 , "System Configuration" . )
mechanical changer
The part of the optical autochanger that moves optical disks from slot to
drive and vise versa. ( See Chapter 12, "HP-UX Peripherals" .)
mechanical picker
See mechanical changer.
media
In terms of optical products, this is the optical disk that holds the data.
Glossary-2 1
The term includes the plastic cartridge that houses the optical disk. (See
Chapter 12, "HP-UX Peripherals" .)
Glossary-22
multi-user run-level
A run-level of HP-UX when terminals in addition to the system console
allow communication between the system and its users . The multi-user
run-level is run-level 2 as shipped. ( See Chapter 6, "Run-Levels" . )
MUX
MUX is an abbreviation for Asynchronous Multiplexer. Each channel is an
RS-232C port which is normally associated with a /dev/ttyXX file.
named object
Objects which have names , are visible at the TCB interface, and are shared
among users.
NCSC
National Computer Security Center, the government agency that wrote the
guidelines for trusted systems .
node
A computer on a network.
NS _ARPA Services
A combined networking product providing both NS and ARPA services . Glossary
The NS_ARPA Services networking product enables your Series 300 or 800
to transfer files to and from remote hosts, log into remote hosts, execute
commands on remote hosts, and send mail to and receive mail from remote
hosts on the network. ( See NS _ARPA Services documentation. )
NS nodename
Needed for Network Services and the rlb daemon. A name consisting of
three fields separated by periods, i.e. node.domain.organization. Each field
can contain up to 16 alphanumeric, case insensitive characters.
objects
Passive entities that contain or receive information. Access to an object
potentially implies access to the information it contains. Examples of
objects are: records, blocks, pages, segments, files, directories, directory
trees, and programs, as well as bits, bytes , words, fields, processors , video
displays, keyboards, clocks, printers, networks nodes, etc.
Glossary-23
optical autochanger
A rewritable optical mass storage peripheral which includes the mechanics
to move optical disks in and out of drive(s), the drive(s) , media and
controller electronics. (See Chapter 12, "HP-UX Peripherals" .)
orphaned process group
A process group in which the parent process of every member is either itself
a member of the group or is not a member of the group 's session. (See
Chapter 5, "Process Management" .)
page fault
When the process encounters an address for which no virtual-to-physical
translation currently exists on the system, the system issues a page
fault . The kernel then switches execution to kernel mode to locate the
sought-after virtual address. ( See Chapter 7, "Memory Management" .)
page
The smallest contiguous block of physical memory that can be allocated for
storing data and processes. On all HP-UX systems, a page is 4 KB in size.
(See Chapter 7, "Memory Management" .)
Glossary .
pagmg
The means by which the memory-management subsystem moves pages of
data between RAM and mass storage for execution as a process demands
them. (See Chapter 7, "Memory Management" .)
parent process
The parent of a process-that is, the process that spawned a process . ( See
Chapter 5, "Process Management" .)
parent process ID
The process ID of a process's parent . (See Chapter 5, "Process
Management" .)
password
A private character string that is used to authenticate a username to
HP- UX. (See Chapter 4, "Login" .)
Glossary-24
path name
A series of directory names separated by / characters, and ending in a
directory name or a file name. (See A Beginner 's Guide to HP- UX.)
peripheral device
Any input/output device that can be connected to your system. Disk
drives, tape drives, printers, plotters, and terminals are all examples of
peripheral devices . ( See Chapter 1 1 , "System Configuration" , Chapter 12,
"HP-UX Peripherals" and Installing Peripherals .)
peripheral location
A peripheral's hardware address (minor number) . (See Chapter 1 1 , "System
Configuration" .)
per-process region (pregion)
A logical segment that points to specific segments of a process, including
text (process instructions) , data, u_area and kernel stack, user stack, one or
more shared-memory segments, and shared-library text and data segments.
Pregions hold page protections and the number of pages mapped to each
segment. (See Chapter 7, "Memory Management" .)
Glossary
phantom record
A record that crosses the EOT mark on a magnetic tape. (See Chapter 12,
"HP-UX Peripherals" .)
physical memory
The actual hardware memory components contained within your computer
system. ( See Chapter 7, "Memory Management" .)
physical volume
A disk that has been initialized by LVM for use in a volume group ; an LVM
disk. (See Chapter 9, "Logical Volume Manager" .)
physical volume group
When using LVM , physical volumes (LVM disks) can be further organized
within a volume group into a physical volume group , on the basis of the 1/0
channel or interface adapter to which they are connected, to achieve higher
availability of mirrored data. (See Chapter 9, "Logical Volume Manager" .)
Glossary-25
PID
Same as process ID .
port
The place of access through which 1/0 comes into contact with the CPU.
PPID
S ame as parent process ID .
primary storage
Typically consists of fixed hard disk( s ) , used for fast , random-access
applications. The primary storage devices are used as online system disks.
(See Chapter 8, "HFS File System" .)
primary swap space
A contiguous area of a hard disk reserved for use by the demand-paged
virtual memory system for swapping. The size and location of primary
swap remain fixed in size and location, but can be changed either by
reconfiguring the kernel or dynamically, while the system is running. ( See
device swap space and Chapter 7, "Memory Management" .)
GlossarJriority
Ranking of processes by relative importance; used by the scheduler in
determining which process the CPU executes next . (See Chapter 5,
"Process Management" .)
process
A process is the environment in which a program (or command) executes .
It includes the program's code, data, status of open files , value of variables,
and more. For example, whenever you execute an HP- UX command, you
are creating a process; whenever you log in, you create a process. ( See
Chapter 5, "Process Management" .)
process group
When a user spawns a job , HP-UX assigns all processes in the job to a
process group . Signals can propagate through all processes in the group .
Each process group has a process group ID and a process group leader.
(See Chapter 5 , "Process Management" .)
Glossary-26
process group ID
An integer number which identifies a process group . It is the same as
the process ID of the process group leader. ( See Chapter 5, "Process
Management" . )
process group leader
Assigned by HP-UX when a process group is created. The PID of the
process group leader is the same as the process group ID of the process
group . ( See Chapter 5, "Process Management" . )
process group lifetime
A period of time beginning when a process group is created and ending
when the last remaining process in a group leaves, caused by either:
• The proces lifetime ends , or
• The process calling the sets id or setpgid system calls ( defined in
section 2 of the HP- UX Reference.
( See Chapter 5 , "Process Management" . )
process ID
An integer, assigned to a process at creation, which uniquely identifies the Glossary
process to HP-UX. That is, no two existing processes can have the same
process ID . ( See Chapter 5, "Process Management" . )
process lifetime
After a process is created with a fork ( ) function, it is considered active.
Its thread of control and address space exists until it terminates. It then
enters an inactive state where certain resources may be returned to the
system, although some resources , such as the process ID , are still in use.
When another process executes a wait ( ) or waitpid ( ) function for an
inactive process, the remaining resources are returned to the system. The
last resource to be returned to the system is the process ID . At this time,
the lifetime of the process ends.
pseudo-swap reservation
On Series 800 , a variation on traditional swapping that allows users to
execute processes in memory without allocating physical swap . ( See
Chapter 7, "Memory Management" . )
Glossary-27
quorum
When using LYM, quorum is the requirement that a volume group have
at least half the configured LVM disks present to change or activate that
volume group . If there is no quorum, LYM prevents the change. Quorum
is also required to maintain Mirror Write Cache. (See Chapter 9, "Logical
Volume Manager" .)
quota
In disk quotas, a quota (also termed soft limit) is the amount of file space
allocated for a given user, and can be exceeded temporarily. (See Chapter
14, "System Accounting" .)
random access memory (RAM)
Memory cards that plug into the computer's backplane. For the CPU to
execute a process, the entire process must exist in RAM. ( See Chapter 7,
"Memory Management" and Chapter 11, "System Configuration" .)
raw mode
Unbuffered 1/0 . Data is transferred directly between the device and the
user program requesting the I / 0, rather than going through the file system
Glossary buffer cache. Also known as character mode. Compare with block mode.
(See Chapter 1 1 , "System Configuration" .)
re command
This is the system initialization shell script /etc/re. The actions that
it performs depend on the state in which it is invoked. ( See Chapter 2,
"System Startup" .)
real user ID
An integer, assigned to a username at login from the /etc/passwd file,
which uniquely identifies the username to HP-UX.
real group ID .
An integer, assigned to a username at login from the I etc/passwd file,
which identifies what group the user is from. Group IDs are defined in the
file /etc/group.
reboot
Taking HP-UX from a running state, down to a stopped state, and back to
a running state. (See Chapter 3, "System Shutdown" .)
Glossary-28
record
A group of related data items, usually stored contiguously on a mass
storage medium. ( See Chapter 12, "HP-UX Peripherals" .)
region
Data structures unique to a file or chunk of memory being accessed.
Regions inform the process about where the data exists in physical memory.
( See Chapter 7, "Memory Management" .)
remote swapping
The default mode of swapping in an HP-UX cluster. That is, the swapping
is performed for a cluster node on the cluster server. (See Chapter 7,
"Memory Management" and Managing Clusters of HP 9000 Systems .)
rewritable optical
An optical disk technology which can be repeatedly written. ( See Chapter
12, "HP-UX Peripherals" .)
resource
Anything used or consumed while performing a function. The categories
of resources are: time, information, objects (information containers) , or
GI ossary
processors (the ability to use information) . Specific examples are CPU time;
terminal connect time; amount of directly-addressable memory; disk space;
number of 1/0 requests per minute.
read-only memory (ROM)
Memory that can be read from (for example, the boot ROM resides in such
memory) , but cannot be written to. It retains its state (memory) even after
power is shut off.
root
Root refers to the highest level directory (root directory or /).
root file system
The file system containing the HP-UX kernel. The kernel is loaded from the
root file system at system startup . ( See Chapter 2, "System Startup" .)
root logical volume
When using LVM, the root logical volume is the logical volume containing
the HP-UX kernel. (see Chapter 9, "Logical Volume Manager" . )
Glossary-29
run-level
A system state in which a specific set of processes are run. Run-levels are
defined in /etc/inittab.
secondary loader
Code located in the Boot ROM which executes during system boot-up and
loads the HP-UX system kernel. The Boot ROM loads and passes control
to the secondary loader, which, in turn, loads and passes control to the file
/hp-ux (or backup kernel, if /SYSBCKUP is specified) .
secondary memory
The location (typically disks) where data is stored when not being used.
By comparison, main memory (RAM) stores computer data required for
program execution. Secondary memory (also called secondary data storage)
is commonly termed swap. In the course of executing a program, data and
instructions are swapped (that is, copied) to and from secondary memory.
secondary storage
The storage device(s) , typically tape drives, used to back up and archive
data stored on the syst em disks (primary storage) . Secondary storage is
Glossary also used to log transaction, interchange data and distribute software.
Secondary storage devices always use removable media.
section
On Series 800 only, HP-UX allows you to divide a disk into separate pieces
called sections. To the operating system, these pieces look like separate disk
drives , each of which can have its own file system, swap area, or boot area.
( See Chapter 8 , "HFS File System" .)
security policy
The set of laws , rules, and practices that regulate how an organization
manages, protects, and distributes sensitive information.
select code
On a Series 300 / 400, the part of an address used for devices; a number
determined by switch settings on the interface card. The select code
determines the interface card's location in the processor address space.
Each interface card is in turn connected to a peripheral. Multiple
peripherals connected to the same interface card share the same select code.
( See Chapter 1 1 , "System Configuration" .)
Glossary-30
semaphore
A locking mechanism for ensuring that only one processor accesses critical
kernel resources at a time on a multiprocessor ( MP ) system. ( See Chapter
5, "Process Management" . )
sensitive information
Information that, as determined by a competent authority, must be
protected because its unauthorized disclosure, alteration, loss, or
destruction will at least cause perceivable damage to someone or something.
session
Typically, a session is the same as a login shell and all the jobs spawned
from the command line of that login shell. A session consists of one or more
process groups . ( See Chapter 5 , "Process Management" . )
session leader
Normally, the process that created the session ( i.e. , the login shell ) . ( See
Chapter 5, "Process Management" . )
session lifetime
The period between when a session is created and the end of the process
Glossary
group lifetime of all its process groups . ( See Chapter 5, "Process
Management" . )
set group ID bit
The middle bit of the most-significant octal digit in a file's protection mask.'
When set on a file that is an executable file, this bit causes the effective
group ID of the user invoking the command to be set equal to the group ID
of the file's group. ( See Chapter 8, "HFS File System" . )
set user ID bit
The most-significant bit of the most-significant octal digit in a file's
protection mask. When set on a file that is an executable file, this bit
causes the effective user ID of the user invoking the command to be
set equal to the user ID of the file's owner. ( See Chapter 8, "HFS File
System" . )
shared code
When an executable file is marked as having shared code, this means that
the file's code can be shared among the processes that run it. That is, each
Glossary-3 1
process need not have its own copy of the code in its code segment ; instead,
there is one copy of the code, which all processes that run the program
share. ( See Chapter 7, "Memory Management" . )
shared library
Object files linked to a program the first time the library is c alled.
Subsequent calls to that library are mapped to the copy of the library
already existing in memory. ( See Chapter 7, "Memory Management" . )
shared library segment
Each shared library segment typically has three pr e gions text , initialized
-
data, and bss . The shared library text can expand like other text segments,
while the initialized data and bss cannot . ( See Chapter 7, "Memory
Management" . )
shared memory segment
Shared memory segments are data segments that can be shared among
processes . They are typically used when multiple processes must share data
( for example, in a windowing system, all window processes must be able to
update common data structures ) . Multiple shared memory segments can be
Glossary attached by many processes using the shmat(2) system call. ( see shmat(2)
in the HP- UX Reference and Chapter 7, "Memory Management" . )
shell
A program that interfaces between the user and the operating system.
HP-supported shells are:
• /bin/sh
• /bin/ csh
• /b in/ksh
• /b in/rsh
• /b in/rksh
• /b in/pam
shutdown
The process of taking the system from multi-user state to a single-user
state, or taking the system from a running state to a state in which no
processes are running.
Glossary-32
shutdown command
A shell script that has the primary function of terminating all currently
running processes in an orderly and cautious manner. ( See Chapter 3,
"System Shutdown" and shutdown(lM) in the HP- UX Reference.)
slot
The physical place in the card-cage of a computer where a card plugs in.
Each slot has a number, which if the slot is used for modules, is multiplied
by four to derive the module number (used in hardware addressing) .
( See Chapter 10, "System Architectures" and Chapter 1 1 , "System
Configuration" .)
SMB
System Main Bus, implemented on Models 850S , 855 S , 860S, 865S , and
870S . Memory and processor boards are plugged into the SMB, which
connects to the Mid-Bus for 1/0 via bus converter. ( See Chapter 10,
"System Architectures" . )
soft limit
In disk quotas, a soft limit (also termed quota) is the amount of file space
allocated for a given user, and can be exceeded temporarily. (See Chapter Glossary
14, "System Accounting" . )
source device
The mass storage device from which HP-UX is installed . The source device
must be a cartridge tape drive or flexible disk drive.
special file
Often called a device file, this is a file associated with an 1/0 device.
Special files are read and written just like ordinary files, but requests
to read or write result in activation of the associated device. These
files norm ally reside in the /dev directory. ( See Chapter 1 1 , "System
Configuration" . )
spinlock
A kind of semaphore used to lock kernel resources very briefly. ( See
Chapter 5, "Process Management" . )
Glossary-33
stack segment
A memory segment reserved for use by a process's stack. On Series 300 , it
is attached near the top of the logical address space and grows "down" in
memory. On Series 800 , the stack and user data area share one space. ( See
Chapter 7, "Memory Management" . )
standalone
A machine which is not part of an HP-UX cluster.
standard error
By default, all command error messages are displayed to a file known
as standard error. Also, by default , standard error is displayed on the
controlling termin al. ( See Chapter 5, "Process Management" . )
standard input
By default , all command input is taken from a file known as standard input .
Also, by default , standard input is input ( typed ) at the keyboard of the
controlling terminal. ( See Chapter 5, "Process Management" . )
standard output
By default , command output is displayed to a file known as standard
Glossary
output . Also, by default , standard output is displayed on the controlling
terminal. ( See Chapter 5, "Process Management" . )
sticky bit
This is one of the bits on a file's protection mask. It can be set only by
the system administrator via the cbmod command. If set on an executable
program, the program will continue to reside in the swap area until
the system administrator unsets the sticky bit . This can improve the
performance of programs that are often used since they can be loaded
from the swap device, not form the file system. ( See Chapter 8, "HFS File
System" . )
streaming
A design feature which allows a tape drive to move in long continuous
motions rather than jerky motions. This is done by buffering data in
such a way that it can be written smoothly. ( See Chapter 12, "HP-UX
Peripherals" . )
Glossary-34
subfile
Part of a CDF in an HP-UX cluster. The subfiles are under the hidden
directory, and are named for one of the system's context attributes. ( See
Managing Clusters of HP 9000 Systems.)
subject
An active entity, generally in the form of a person, process, or device that
causes information to flow among objects or changes the system state.
Technically a process/domain pair.
superblock
A data structure containing global information about the file system such
as file system size, disk information, and cylinder group parameters. The
superblock is created at the same time as the file system and is replicated
into each cylinder group. Also, HP-UX keeps a copy of the superblock in
memory at all times. The sync command writes the superblock to disk.
(See Chapter 8, "HFS File System" in this manual and sync(lM) in the
HP- UX Reference.)
superuser
The root user who has special privileges. Same as the system administrato:o1ossary
surface
In terms of optical disks, this is one of the disk sides-surface 1 or 2.
swap
Secondary memory (secondary data storage) is commonly termed swap .
In the course of executing a program, data and instructions are swapped
(that is, copied) to and from secondary memory. (See Chapter 7, "Memory
Management" .)
swapping
The means by which entire processes are moved for execution between
RAM and mass storage (typically disk) . (See Chapter 7, "Memory
Management" .)
swap space
Disk space which is reserved for use by the demand-paged virtual memory
system. Processes are swapped to and from swap space. There are two
Glossary-35
kinds of swap space: primary swap space and dynamic swap space. ( See
Chapter 7, "Memory Management" and Chapter 8 , "HFS File System" . )
synchronization
When using LVM, synchronization keeps mirrored logical volumes
consistent by ensuring that all copies contain the same data. ( See Chapter
9, "Logical Volume Manager" . )
system administrator run-level
A run-level of HP-UX when the system console provides the only
communication mechanism between the system and its users. lnit state s is
the system administrator run-level. ( See Chapter 6, "Run-Levels" . )
system CDFs
System file ( e.g., /etc/re, /etc/ inittab) that are also CDFs
( context-dependent files ) . ( See Managing Clusters of HP 9000 Systems .)
system console
A keyboard and display ( or terminal ) given a unique status by HP-UX
and associated with the special device file /dev/console. All boot ROM
error messages ( messages sent prior to loading HP-UX ) , HP-UX system
Glossary
error messages, and certain system status messages are sent to the system
console. Under certain conditions (for example, the single-user state ) ,
the system console provides the only mechanism for communicating with
HP-UX. ( See Chapter 2, "System Startup" . )
system login script
A system-wide login script, run for every user of a particular shell when he
or she logs in. System login scripts are:
• /etc/profile for Bourne and Korn shell users
• /etc/csh . login for C shell users.
system shutdown
The process of taking HP-UX from a running state to one in which no
processes are running. See also shutdown and reboot . ( See Chapter 3,
"System Shutdown" . )
Glossary-36
system startup
The process of taking HP-UX from a stopped state ( in which no processes
are running ) to a state in which it is ready to accept input from users. ( See
Chapter 2, "System Startup" . )
tape density
A measure of how densely information is stored on a magnetic tape. Bits
per inch is a common measure of tape density. ( See Chapter 12, "HP-UX
Peripherals" . )
TCB
See trusted computing base.
TC SEC
Trusted Computer Systems Evaluation Criteria, also known as the "Orange
Book" . This is the book where evaluation criteria for trusted systems is
documented.
text segment
See code segment .
thrashing Glossary
When the demand-paged virtual memory system spends an inordinate
amount of time paging ( swapping processes to and from swap space ) , so
much so that system performance degrades. ( See Chapter 7, "Memory
Management" . )
time-slice
The amount of time a process can run before the kernel checks to see if
there is an equal-priority process ready to run.
track
One of several concentric circles on the surface of a disk upon which data is
recorded ( refer to Chapter 8, "HFS File System" . )
translation lookaside buffer (TLB)
A page table that matches cache or indexes physical addresses ( depending
on design ) for recently accessed virtual addresses. Once an address is
translated, it can be used by the cache, which uses physical addresses. ( See
Chapter 7, "Memory Management" . )
Glossary-37
trap door
A hidden software or hardware mechanism that permits system protection
mechanisms to be circumvented. It is activated in some non-apparent
manner (e.g., special "random" key sequences) .
Trojan horse
A computer program with an apparently or actually useful function
that contains additional (hidden) functions that surreptitiously exploit
the legitimate authorizations of the invoking process to the detriment of
security-for example, making a "blind" copy of a sensitive file for the
creator of the Trojan Horse.
Glossary-38
unattended mode
The default method by which the boot ROM finds and loads an operating
system. Occurs if the user does not intercede during system startup . (See
Chapter 2, "System Startup" . )
unit number
Part of an address used for devices; a number whose meaning is software
and device-dependent but which is often used to specify a particular
disk drive in a device with a multi-drive controller. When referring to
single-controller integrated disk/tape or disk/flexible disk drive, a unit is
used to distinguish between disk and cartridge tape drives or hard disk and
:flexible disk drive. (See Chapter 1 1 , "System Configuration" .)
(The unit number also selects a single partition on the 913x series.)
use count
The demand-paged virtual memory system keeps track of the number of
processes accessing shared code. This number is called the use count . (See
Chapter 7, "Memory Management" .)
user
Any person who interacts directly with a computer system. G lossary
G lossary-39
vnode
A region is usually filled by a vnode, an interface for reading and writing
pages of data between memory and disk. Vnodes are categorized by
file type, such as uf s , nfs , dux, and cdf . (See Chapter 7, "Memory
Management" .)
volume group
In LVM , the combined disk space of one or more LVM disks (physical
volumes) from which logical volumes space are allocated. (See Chapter 9,
"Logical Volume Manager" .)
volume number
Part of an address used for devices; a number whose meaning is software
and device-dependent but which is often used to specify a particular volume
on a multi-volume disk drive. The volume number is also used to inform
the device driver of special handling semantics (such as printer drivers
skipping over perforations). ( See Chapter 1 1 , "System Configuration" .)
word
A unit of information, typically consisting of four consecutive bytes (32
Glossary bits) .
write protected
Indicates that a storage media is protected from being written to. This is
useful in situations where you have a tape or diskette that you don't want
written to and possibly destroyed. ( See Chapter 12, "HP-UX Peripherals" .)
write ring
A mechanism on a reel-to-reel tape that allows you to write-protect the
tape.
Glossary-40
Index
I ndex
8 terminals , 12-25
802.4 link, 13-3 addressing, 1 1-21
bus address, 1 0-8 , 10-10
9 definition, Glossary-1
9-track magnetic tape device drivers, 1 1-21
device file format , 1 1-47 format , 1 0-19
hardware path, 1 0-19
A hardware paths , 1 0-41
HP-IB , 12-28
access, Glossary- 1
access control list ( ACL ) , 8-59 , 8-63 HP-PB models , 1 0-2 1
access control mechanism ( ACM ) , logical unit ( lu) specification, 1 1-43
MAP cards, 1 0-22
Glossary- 1
accessing raw data using LVM , 9-9 Mid-Bus, 1 0-27
MUX card, 1 0-10
access permission, 8-58, 8-60
accounting directories, 14-14 select code , 1 0-8
acct , 14-25 Series 300 hardware paths , 10-8
acct ( 4) , 14-9 Series 700 , 1 0-14
acctcms report options , 14-45
Series 800 , 1 0-19
SMB models , 1 0-30
acct cms , to generate command report '
14-42 advisory lock
acctcom, 14-35 definition , Glossary-1
acctcon1 , 14-28 advisory locks, 8-64
acctcon2 , 14-27, 14-30
AFI ( Asynchronous FIFO Interface )
acctdisk, 14-21
management , 1 1-24
acctdusg, 14-17, 14-18
aging, password, 4-9
acctdusg and diskusg compared, 14- 1 9 allo cation policy, 9-47
acctmerg , 14-49 , 14-51
defined, 9-5 , Glossary-2
acctprc1 and acctprc2 , 14-46 alternate superblock, 8-28, 8-50
a . out , 7-28
acct sh, 14-27, 14-53 , 14-61
acctwtmp , 14- 1 1 , 14-24
application layer, 13-2
adding architecture, 10- 1
modems, 1 2-25 CIO , 10-15
lndex- 1
Index
lndex-2
Index
lndex-3
Index
lndex-4
I ndex
lndex-5
Index
lndex-6
Index
lndex-7
Index
l ndex-8
Index
lndex-9
Index
lndex- 1 0
Index
lndex-1 1
Index
lndex- 1 2
Index
lndex- 1 3
Index
lndex- 1 4
Index
lndex- 1 5
Index
lndex- 1 6
Index
lndex- 1 7
Index
lndex- 1 8
Index
l ndex- 1 9
Index
lndex-20
Index
lndex-2 1
Index
lndex-22
Index
lndex-23
Index
lndex-24