- 论坛徽章:
- 0
|
5. 补丁管理命令Patch
查看patch: # showrev -p,
安装patch: # ./installpatch .
备份patch: # ./backoutpatch 102972-01
patch安装目录: /var/sadm/patch
patch信息网站: http://sunsolve.sun.com
6. 操作系统启动过程及运行级别
操作系统启动过程
================
[1] prom (系统自检selftest) ,
[2] bootblk, (系统引导盘启动扇区),
[3] ufsboot (/platform/'uname -i'/ufsboot),
[4] kernel (initself, /kernel/genunix, /etc/system),
[5] init (/sbin/init, /etc/inittab, /sbin/rc*.d,
/etc/rc*.d, /etc/init.d)
操作系统自动配置过程
====================
[1] 内核上载入内存(kernel module are load to memory)
o 静态内核static core:
/kernel/genunix, /platform/.../kernel/unix,
o 动态内核dynamically loaded module:
driver module, streams, ufs module, nfs module
/kernel/,/platform/.../kernel/unix, /usr/kernel
o /etc/system内容:
moddir,
exclude rootdev,
set pt_cnt=100
...............
[2] 设备配置(device configration )
o device tree: /devices, /dev
o /etc/path_to_install
查看操作系统配置
==================
# dmesg,
# printconf,
# sysdef
# /usr/platform/sun4u/sbin/prtdiag
# /usr/platform/sun43u/sbin/prtdiag
重新配置系统硬件
=================
# touch /reconfigure
# init 0
ok boot -r (重新启动/配置系统硬件)
ok boot -ar
在系统运行情况下,如果不想重新启动系统,
安装硬盘/磁带等热插拔硬件,则:
# drvconfig
# devlinks
# disks
# tapes
查看配置情况:
# dmesg
# printconf
# sysdef
操作系统运行级别
==================
系统启动时,进入/etc/inittab中initdefault所定义的运行级别(deafult 3)
各运行级别的定义:
run level:0, (halt, shotdown, stop+a,sync,go )
1, (single user, boot -s, init s )
2, (multiuser, unshare net)
3, (multiuser, deafult)
5, (halt, power off )
6, (reboot to level 3 )
S (init 1, boot -s)
改变系统运行级别命令
====================
# init 0, halt, shotdown, stop+a,sync,go
# init 1, single user, boot -s, init s
# init 2, multiuser, unshare net
# init 3, multiuser, deafult
# init 5, halt, power off
# init 6, reboot to level 3
# init s, init 1, boot -s
# init *,shotdown,halt,poweroff, reboot -- -r, reboot -- -s
ok> boot -s, boot -sra
启动、关闭Solaris 操作系统
==========================
ok> boot -r (一般在安装新设备如硬盘等后,重起机器,重建系统内核)。
ok> boot cdrom - brower (从CDROM启动机器,重新安装系统,界面为浏览器方式)。
# sync (将内存中的内容写入硬盘)。
# halt (或 /etc/init 0) (关闭系统)。
# reboot
7. 操作系统启动/关闭时运行的脚本命令
Solaris操作系统会在系统启动或关闭时自动运行脚本命令
例如: 有一个启动/关闭数据库的命令脚本/etc/init.d/rdbms,
想在系统启动/停止时自动启动/关闭数据库:
# vi /etc/init.d/rdbms
# cd /etc/init3.d
# ln /etc/init.d/rdbms S22rdbms (在系统启动时,运行命令脚本)
# cd /etc/init0.d
# ln /etc/init.d/rdbms K8822rdbms (在系统关闭时,运行命令脚本)
也可手动执行:
# /etc/init.d/rdbms stop
# /etc/init.d/rdbms start
要定时运行一个程序
====================
在/var/spool/cron/crontabs/root中加入
分_时_日_月_年 /运用程序
8. 硬盘分区及格式化(disk partition and format )
# foramt (可显示硬盘类型, 大小, 分区情况. 可重新分区, 格式化等)
0 >partition>p>0>1>3>4>5>6>7>print>label>format>quit>quit
0 root wm 0 - 3514 3.62GB (3515/0/0) 7592400
1 swap wu 3515 - 3757 256.29MB (243/0/0) 524880
2 backup wm 0 - 3879 4.00GB (3880/0/0) 8380800
3 unassigned wm 3758 - 3879 128.67MB (122/0/0) 263520
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
#foramt
1>type
<SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
>partition>print>0
root wm 0 1940c
>7
root wm 0 1940c
>p
0 root wm 0 -1939 2.00GB (1940/0/0) 4190400
2 backup wm 0 - 3879 4.00GB (3880/0/0) 8380800
7 home wm 1940-3879 2.00GB (1940/0/0) 4190400
>label>quit>quit |
|