04Solaris系统管理培训.docx
- 文档编号:10554980
- 上传时间:2023-02-21
- 格式:DOCX
- 页数:41
- 大小:35.65KB
04Solaris系统管理培训.docx
《04Solaris系统管理培训.docx》由会员分享,可在线阅读,更多相关《04Solaris系统管理培训.docx(41页珍藏版)》请在冰豆网上搜索。
04Solaris系统管理培训
Solaris系统管理培训
第一章:
系统概念
Objectives :
Upon completion of this module, you should be able to
Match the three parts of an operating system (kernel, shell, and file system) to their definitions
Identify the three most common shells in the Solaris environment
Distinguish between multitasking and multiuser
Describe the client-server relationship
Define the following basic system terms:
host, host name, network,
IP (Internet Protocol) address, client, and server
操作系统的主要三个部分
UNIX操作系统是基于文件的,操作系统的主要三个部分是:
Kernel
Shell
File structure
Kernel 是操作系统的核心,它的主要功能是:
管理系统的设备、内存、进程以及守护进程
系统程序与系统硬件之间接口
执行所有的命令
管理:
Swap space(交换分区) – 系统运行时保留的一部分磁盘空间
Daemons (守护进程)– 处理特定的系统任务
shell 是用户与kernel之间的接口。
它就像是命令的解释器或翻译器。
Shell接收你输入的命令,对你的输入作出解释,然后就将它发送给kernel执行。
操作系统的 Shells种类
Solaris系统中有三种shell:
Bourne shell ($) – 这是Solaris的缺省shell。
Bourne shell为 AT&T UNIX 环境而开发。
(/usr/bin/sh)
Korn shell ($) – 是Bourne shell的一个超级。
它增加了一些功能,如:
别名、历史记录以及命令行编辑等。
(/usr/bin/ksh)
C shell (%) –C shell的语法类似于C语言,并且,C shell有些功能与 Korn shell相类似。
(/usr/bin/csh)
Solaris环境的文件结构是分成的目录树结构,类似于DOS的文件结构。
是一些有特定目的而组织在一起的目录、子目录和文件。
目录 (Directory) – 其他目录和文件所在处
子目录(Subdirectory) – 属于其他目录的所有目录
根目录(/)位于目录树的最顶层,包含 :
/usr目录包含系统的一些命令、工具、库文件等 。
/opt目录包含的三方应用软件。
/dev目录包含诸如磁盘、键盘、磁带机、显示器等地设备驱动程序。
/etc目录包含系统配置文件,如用户口令文件等等。
/export目录一般包含用于NFS共享的目录。
/export/home目录包含用户的个人主目录。
/kernel目录包含系统结构的kernel文件。
这个目录下的文件genunix是系统的UNIX kernel 。
虚拟内存操作系统——交换分区(Swap Space)
虚拟内存操作系统增大了物理内存,它将硬盘中的一部分空间用于存储暂时不用内存数据。
这块硬盘空间叫做交换分区。
与Windows下的SWAP文件的功能相似。
守护进程(Daemons)
守护进程是在后台运行的程序,它负责系统的某个特定的功能,比如打印。
系统管理的一些常见的概念:
主机(Host) – 网络环境下的某台计算机系统。
主机名(Host name) – 某台系统的名字,网络中的任何系统都必须有自己的主机名。
IP地址(IP address) – 网络软件用于鉴别网络中某台机器的一个数字符号。
客户机(Client) – 使用网络中一个和多个服务的主机和进程。
服务器(Server) – 在网络中提供一个或多个服务的主机和进程。
网络(Network) – 许多机器连接在一起、可以互相通信的集合。
Solaris有下列特性:
多任务(Multitasking) – 多个进程或应用程序可以同时运行。
多用户(Multiuser) – 同时可以有多个用户访问系统资源。
分布处理(Distributed processing) – 通过网络使用资源。
第二章:
OpenBootPROM
OpenBoot PROM介绍
所有Sun机器都有一个用于基本硬件测试和初始化的固件,还有一个提供多种重要功能的用户程序。
基本元素
Sun系统的基本硬件元素包括:
Boot PROM芯片,它永久的固定在主板中。
非易失性随机访问内存(non-volatile random access memory (NVRAM) )芯片,包含主机的基本信息。
Boot PROM内容 —boot PROM有以下功能:
加点自检(Power-on self-tests (POST))
系统重起始开始执行。
检测基本CPU板
因机器型号不同而不同。
设备驱动
有一些小型设备驱动程序,使得启动的初始化过程中可以与不同的外围设备相通讯
用户操作界面
NVRAM 内容
除了永久性存在地以太网地址、主机ID、时钟外,还保存着可以修改的系统的配置参数。
Basic Boot PROM Commands:
ok banner
ok boot
ok help
ok printenv
ok setenv
ok set-defaults
ok probe-scsi
ok probe-scsi-all
ok probe-ide
ok reset
The Open Boot banner Command
The banner command lists several pieces of useful information about the system such as model, amount of memory, and hostid. You can also use the banner command to identify your system’s PROM version number. Three boot PROM levels are discussed in this module.
ok banner
Sun UltraSPARC 60 UPA/PCI (2 X UltraSPARC-II 296MHz), Keyboard Present
OpenBoot 3.11, 256 MB memory installed, Serial #3159808.
Ethernet address 8:
0:
22:
1a:
e7:
3f, Host ID:
72303700.
ok
boot 命令和参数
可以在boot命令后键入一个或多个参数。
这些参数传递改操作系统内核,将影响整个启动过程。
命令格式
ok boot [device_name] - [options]
参数
a 交互式启动系统。
提示输入根设备和交换设备以及一些重要的系统文件
r 启动时系统将重新查找所有的设备,在/devices和/dev目录下重新生成文 件,更新/etc/path_to_inst文件。
s 系统启动后停留在S运行级别。
可以用来系统错误排除。
v 详细地显示出系统的启动信息。
有时可以用来系统的错误排除。
printenv 命令
printenv命令显示NVRAM的参数以及参数的缺省值。
查看缺省启动设备
您可以使用printenv显示缺省启动设备。
ok printenv
Parameter Name Value Default Value
tpe-link-test?
True true
output-device ttya screen
input-device ttya keyboard
sbus-probe-list f0123 f0123
keyboard-click?
False false
diag-file
diag-device net net
boot-file
boot-device disk disk
auto-boot?
true true
More [,,q] ?
q
您可以在系统的输出中查看缺省启动设备,参数是boot-device。
您也可以输入printenv boot-device,这样只显示启动设备的值。
重新定义PROM Boot值
使用setenv命令可以重新定义PROM的值 。
下面的例子中把auto-boot?
变为 false,然后reset命令使系统重新启动,使变化生效。
ok printenv auto-boot?
auto-boot?
true true
ok
ok setenv auto-boot?
false
auto-boot?
= false
ok reset
重置缺省值
使用set-defaults 命令将所有的参数重新设置为缺省的值。
ok set-defaults
注意:
set-defaults命令只对有缺省值的参数生效。
影响系统启动和自检的按键有:
stop
如果在系统加电自检时按下Stop键,就取消POST(加电自检)诊断,然后停留在OK状态。
Stop+d
在系统自检时同时按下stop和d键,系统将自动转到诊断模式,诊断模式下系统将更完全地进行自检。
Stop+n
如果由于NVRAM的设置不正确而导致系统无法正确启动时,可以在系统加电自检时同时按下stop和n键。
它的作用是将NVRAM的参数值设为默认值。
Stop+a
同时按下stop和a键将中断操作系统的运行,退到OK状态。
警告:
尽量不要在操作系统运行时按stop+a,这将导致操作系统停止并且导致数据的丢失。
在万不得以的时候,在按下stop+a后,键入sync命令用以将内存的数据同步到硬盘中。
探测系统总线
将外围设备(如光驱、硬盘)与主板连接在一起的I/O总线有SCSI(small computer system interface)总线和IDE (integrated drive electronics)总线。
在OpenBoot 3.x系统中使用probe-命令
在OpenBoot 3.x的系统中,使用probe-命令时,您会看到一个警告。
如果您在操作系统运行状态下,用stop-a将系统强行暂停,或使用halt退出操作系统。
这样的状态下使用probe-命令会造成机器挂起。
因此,您必须先运行reset-all命令。
请先设置auto-boot?
为false后再运行reset-all,系统将重新自检,停留在OK状态下,然后可以运行这个命令。
显示连接在SCSI总线上的设备
probe-scsi命令将鉴别连接在SCSI控制器上的设备。
ok probe-scsi
Target 3
Unit 0 Disk SEAGATE ST1480 SUN0424626600190016
Copyright (c)
All Rights Reserved
Target 6
Unit 0 Removable Read Only device SONY CD-ROM
ok probe-scsi-all
显示连接在PCI总线上的IDE设备
ok probe-ide
Device 0 ( Primary Master )
ATA Model :
ST 34342A
Device 1 ( Primary Slave )
Not Present
Device 2 ( Secondary Master )
removable ATAPI Model :
CDR-8240B
Device 3 ( Secondary Slave )
Removable ATAPI Model yyyyyyyyyyyyyyy
可以使用devalias命令查看设备别名的物理地址,这样就可以知道启动设备的物理设备了。
ok devalias
screen /SUNW,ffb@1e,0
mydisk /pci@1f,0/pci@1,1/ide@3/disk@0,0
net /pci@1f,0/pci@1,1/network@1,1
cdrom /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:
f
disk /pci@1f,0/pci@1,1/ide@3/disk@0,0
disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0
disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0
disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0
disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0
ide /pci@1f,0/pci@1,1/ide@3
floppy /pci@1f,0/pci@1,1/ebus@1/fdthree
ttyb /pci@1f,0/pci@1,1/ebus@1/se:
a
ttya /pci@1f,0/pci@1,1/ebus@1/se:
b
keyboard!
/pci@1f,0/pci@1,1/ebus@1/su@14,3083f8
keyboard /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8
mouse /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8
设备别名在左列。
设备物理地址在右列。
如果操作系统挂起了(没有响应),并且您也不能远程登录,那您没有别的选择了,只有强行中断操作系统。
中断挂起的系统 :
如果系统挂起了,可以尝试下列步骤:
1.用Stop-a中断操作系统。
如果成功,系统会停留在PROM状态。
如果是使用字符终端作为系统控制台,则按Break键。
2. 用sync命令将内存的内容同步到磁盘,减少数据的丢失。
结束后系统会自动重起。
在ok提示符下键入sync命令。
ok sync
注意 – 您也可以用Stop-a强行中断操作系统,然后键入go恢复操作系统运行。
不建议使用此功能。
第三章:
安装Solaris操作系统
Software Groupings
基本 :
包含系统运行所需的最基本的软件和设备驱动。
不包括图形界面和手册页。
最终用户 :
除了基本软件外,还包括图形界面。
开发者 :
包括编译工具、图形界面、手册页。
完整分发和 OEM 支持
包含全部内容和一些OEM地硬件设备驱动。
Installation Information Worksheet :
Acquire the following necessary information prior to your installation:
Host name:
____________________________________________________
IP address:
_____________________________________________________
Name service (NIS, NIS+, DNS or None):
_________________________
Subnet (yes or no):
______________________________________________
Geographic location:
____________________________________________
Time zone information:
__________________________________________
Root password:
_________________________________________________
Installation Process
1.Insert the CD-ROM into the CD-ROM drive.
2.Boot the release media.
ok boot cdrom
3.Select the appropriate language and locale for your site and click on Continue.
4. Enter the assigned host name for the system
5. Type the IP address
6. Select the type of the name service
7. Select Time Zone
8. Select Initial to perform an initial install and not preserve current settings
9. Select the software group
10. Set the sizes of each disk partition
11. Type a root (superuser) password
Solaris系统管理培训
所有Solaris系统的软件都以包的形式出现。
软件包包含:
软件包的描述文件
系统需求的描述文件
需要安装的文件
安装前以及安装后需要运行的脚本
The pkgadd command
用于安装软件包
pkgadd [ -d [device | pathname ]] pkg_name
# pkgadd -d /cdrom/cdrom0/s0/Solaris_2.7/Product SUNWaudio
Processing package instance from
Audio applications
(sparc) 3.6.4,REV=1.98.08.13
Copyright 1998 Sun Microsystems, Inc. All rights reserved.
Using as the package base directory.
## Processing package information.
## Processing system information.
2 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of [y,n,?
] y
Installing Audio applications as
## Installing part 1 of 1.
Installation of was successful.
The pkginfo command
不加任何参数用于查看系统已经安装的软件包
# pkginfo | more
application SUNWAxg Solaris XGL 3.3 AnswerBook
application SUNWaadm Solaris 7 System Administrator Collection
system SUNWab2m Solaris Documentation Server Lookup
system SUNWab2r Solaris Documentation Server
system SUNWab2s Solaris Documentation Server
system SUNWab2u Solaris Documentation Server
application SUNWabda Sun Ultra 5/10 Hardware AnswerBook
application SUNWabe Solaris 7 User Collection
application SUNWabsdk Solaris 7 Software Developer Collection
The pkginfo Command 后面可跟一些参数,显示特定某个软件包的信息
Command Format
pkginfo [ -d [ device | pathname ] ] [ -l ] pkg_name
参数
-d device 指定软件所在的位置,可以是目录、磁带机、软盘等等
-l 显示详细信息
pkg_name 软件包名
输出列
CATEGORY 软件包的类型,是“应用软件”和是“系统软件”
PKGINST 软件包名,如果是SUNW打头,则是SUN的产品
NAME 软件的简要描述
# pkginfo -d /cdrom/cdrom0/s0/Solaris_2.7/Product -l SUNWaudio
PKGINST:
SUNWaudio
NAME:
Audio applications
CATEGORY:
system
ARCH:
sparc
VERSION:
3.6.4,
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 04 Solaris 系统管理 培训