`
yangbin210
  • 浏览: 83471 次
  • 性别: Icon_minigender_1
  • 来自: 山东
最近访客 更多访客>>
社区版块
存档分类
最新评论
阅读更多
知识类型:

1.  启动类型:

hard disk boot

diskless disk boot

service boot

2.  启动步骤:

ROS(Read only storage)、驱动配置(cfgmgr)、卷组(\etc\inittab)

3.  启动现象:

找到处理器会BEEP -à 系统内存检测完毕会出现POWER PC LOGO -à 驱动图标显示将代表DEVICE正常 -à 读入ROS成功后将BEEP。

4.  

alog

rc.boot脚本调用/var/adm/ras/bootlog来记载alog

临时文件 /tmp/boot_log

写LOG 文件:alog –f logfile,如果无法写,将写在/dev/null

列出当前的alog:alog –L (boot bosinst nim console dumpsymp)

列出文件的内容:-o

复制标准的输入文件:-q

按LOG类型查看:-t

查看一个LOG文件:alog –o –f /var/adm/ras/bootlog

查看一个LOG文件的冗余:alog –t boot –V

更改LOG文件到其他文件: alog –f LOGFILE | -q –s SIZE

更改LOG文件属性:alog –C –t LOGTYPE –f LOGFILE –s SIZE –w verbosity

类型:boot  /var/adm/ras/bootlog  8192

      bosinst  /var/adm/ras/bosinstlog  8192

nim  /var/adm/ras/nimlog  8192

console  /var/adm/ras/conslog  16384

dumpsymp  /var/adm/ras/dumpsymplog  8192

快速路径:smitty alog_show



cfgmgr

参数:

-f 运行在启动(第一)阶段,在系统运行期间是无效的

-i device 指定安装位置的路径

-l name 指定配置设备的名称

-p phase 指定运行的阶段

-s 运行在配置的第二阶段

-v 输出配置过程的信息

系统启动分为两个阶段:

第一阶段:首先会将内核程序调入系统,初始化启动文件,这个阶段会用到-f这个参数;这个阶段将会配置基本的设备;

第二阶段:这个阶段会用到-s这个参数;

其实cfgmgr共有三个阶段,第三阶段为服务方式的启动;

注意:这个命令不能被中断,否则会破坏数据库;

可以通过alog –o –t boot命令来查看启动过程中的配置情况;

phase seq rule

1     1  /usr/lib/methods/defsys

1     10 /usr/lib/methods/deflvm

2     1  /usr/lib/methods/defsys

2     5  /usr/lib/methods/ptynode

2     10  /usr/lib/methods/startlft

2     15  /usr/lib/methods/starttty

3     1  /usr/lib/methods/defsys

3     5  /usr/lib/methods/ptynode

3     10  /usr/lib/methods/startlft

3               15  /usr/lib/methods/starttty

例如:检测某一类设备:cfgmgr –l scsi0

      指定安装路径:cfgmgr –i /usr/sys/inst.images



last

文件将记录在/var/adm/wtmp中

参数:

-number 显示行数

name 按用户名查询

terminal 登录的终端设备

例如:

检查在console 上登录的ROOT用户:last root console

检查最后执行shutdown命令的情况:last shutdown



bootlist

三种方式:normal、service、previous

bootlist

- mode:normal service both prevboot

- f file 从文件中读取驱动器信息

- i 显示启动列表,-m参数将失效

- o 按m显示启动列表,AIX4.2以后才支持

- r 在顺序被更改之后,显示新的启动顺序

例如:

bootlist –m normal –o

bootlist –m normal hdisk0 cd0

如果驱动器名错,会报0514-210 bootlist:Device xxxxx is not in the AVAILABLE state

驱动器名:fdx hdiskx cdx rmtx entx tokx



uptime

可以查询系统已经启动多长时间

05:10PM up 6 days,21:45,13 users,load average 4.00,3.00,0.00

同w命令的第一行是一样的



mpcfg

仅支持微通道的多处理器系统:7012 G系列、7013  J系列、7015 R系列

mpcfg –d(f m p S)

mpcfg –c(f m p S w)11 1

mpcfg –r –s

-s 保存在/etc/lpp/diagnostics/data/bump

-f 对话模式

-m MODEM模式

-p 远程电话支持

-S 服务支持模式

-w 加密码



shutdown

-d 从分布式的模式到一个多用户模式

-F 快速宕机

-h halt操作系统

-i 交互式的模式

-k 停止正在进行的SHUTDOWN

-m 切换到单用户模式

-r SHUTDOWN后重新启动

-v halt操作系统

SHUTDOWN命令将运行脚本/usr/sbin/shutdown,如果/etc/rc.shutdown命令存在,将运行该脚本。

5.  解决启动的问题

光盘启动:插入第一张光盘

显示出安装/维护选择画面,系统板上的LED将显示c31

进入维护模式

选择Access a Root Volume Group

选择适当的VG启动,将显示文件卷的信息,出现两个选择,一个为先MOUNT后执行SHELL,另一个先执行SHELL后MOUNT

然后会让选择正常开始和不MOUNT启动

6. 问题LED 201 - Damaged boot image

通过光盘启动,检查/和/tmp空间是否满

检测启动盘,lslv –m hd5

重新创建boot image文件,bosboot –a –d /dev/hdiskn

检查errlog

重新启动

7. 问题LED 223-229 - Invalid boot list

进入维护模式或通过光盘启动,修改BOOLIST

重新启动

8.  问题LED 551, 555, and 557 - Errors including corrupted file system and corrupted JFS  log

通过光盘启动,不MOUNT文件系统,然后做fsck -y /dev/hd1  fsck -y /dev/hd2  fsck -y /dev/hd3  fsck -y /dev/hd4  fsck -y /dev/hd9var 检查文件系统

然后通过/usr/sbin/logform /dev/hd8命令格式化JFS LOG

再用lslv -m hd5检测启动盘

重新创建boot image,bosboot -a -d /dev/hdiskn



9.  问题Led 552, 554, and 556 - Super block corrupted or corrupted customized ODM database

如果在做fsck之后发现block 8是损坏的,用下面命令修补:dd count=1 bs=4k skip=31 seek=1 if=/dev/hdn of=/dev/hdn

然后通过/usr/sbin/logform /dev/hd8命令重建JFS LOG

如果问题无法解决,可能是ODM库损坏,用光盘启动

mount /dev/hd4 /mnt

mount /usr

然后拷贝系统配置到备份目录

mkdir /mnt/etc/objrepos/backup

cp /mnt/etc/objrepos/Cu*/mnt/etc/objrepos/backup

然后将RAM文件系统中拷贝配置到

cp /etc/objrepos/Cu*/mnt/etc/objrepos

然后umount all所有文件系统

再用lslv -m hd5检测启动盘

最后存储ODM到启动盘

savebase -d/dev/hdiskn

重新启动,如仍未解决,需重新安装

10.              问题LED 553 - Corrupted /etc/inittab file

通过光盘启动检查/和/var的空间

检查/etc/inittab文件

检查/etc/environment

/bin/sh

/bin/bsh

/etc/fsck

/etc/profile

/.profile

然后重启

11.              例如:客户定义的磁盘lsdev –Cc disk

AIX提供的磁盘lsdev –Pc disk

列出所有预安装设备lsdev -P –H

列出所有已安装设备lsdev -C –H

列出状态为Available的设备lsdev -C -c adapter -S a

列出状态为Define的设备lsdev -C -c adapter -S d

列出支持的类lsdev -P -r class

列出支持的类型lsdev -P -r type

列出支持的子类lsdev -P -r subclass

12.              例如:列出所有的物理卷所属的DISK、PVIDS及所属卷组:lspv

列出某一个物理卷的信息:lspv hdisk0或lspv –v 00615147ce54a7ee hdisk0

列出物理卷的PP位置、状态、区域、LV名、类型及MOUNT点:lspv –p hdisk0

13.              SMS画面出现后按F1键进入图形MENU,按F4键进入ASCII界面

        如果SMS的密码忘记,可以通过放电解决

14.              如果chdev用-P或-T更改过,需要系统重启后lsattr命令查询才会更改

        查看rmt0当前的属性:lsattr -l rmt0 –E

        查看rmt0默认的属性:lsattr -l rmt0 –D

        查看当前scsi0的中断地址:lsattr -l scsi0 -a bus_intr_lvl –E

        查看TTY的LOGIN的选项:lsattr -l tty0 -a login –R

        查看TTY的速率:lsattr -El tty0 -a speed

        参数:

          -D:默认的属性

          -E:当前的属性

          -F For mat :显示输出按用户指定的格式

          -a Attribute:显示指定的DEV信息

          -c Class:按类查询,但不能用 –E、 -l参数

          -f File:从文件读

          -H :显示标题

          -l Name: 按逻辑驱动器名列

          -O :显示所有被分开的属性??

          -R :显示所有可选参数

          -s Subclass: 指定子类

          -t Ty p e :指定类型

15.              通过/usr/lib/errdemon命令启动错误校验进程,正常情况是在开机自动启动

        检查LOG FILE路径:/usr/lib/errdemon –l

          调节LOG的最大范围:/usr/lib/errdemon -s 2000000

          调节BUFFER的空间:/usr/lib/errdemon -B 16384   将会向上调节为4096的倍数,需重新登陆才能看到变化。

16.              Errpt参数

-a 详细的显示错误日志,如果配合使用-t参数,所有信息通过摸版文件显示

-j ErrorID[,ErrorID] 显示指定ID的错误日志,中间用逗号或引号、空格分开

-s StartDate 显示时间mmddhhmmyy后的所有记录(month, day, hour, minute, and year).

-t 错误记录到临时文件

-F FlagList 显示临时日志按照Alert, Log, or Report类型

-J ErrorLabel 按照错误级别显示

例如:按照ID号显示:errpt -a -s 0828093001

17.              错误日志发布命令:errlogger Testing use of errlogger command

        错误类型将为O

18.              errclear:清除错误信息

errinstall:在错误日志信息中加入信息

errupdate:升级临时信息库

19.              Diag检测问题

也可用diag -d sysplanar0 -v –e来检测sysplanar0

20.              Syslogd的配置在/etc/syslog.conf中,/etc/syslog.pid中记录该命令的ID,/usr/include/sys/syslog.h中定义了优先级

参数:

-d:打开debug

-f config file:指定交互式的文件

-m MarkInterval:定义mark命令在发送信息的频率,否则每20分钟一次,可以用*

-s:指定到另一个系统

-r:禁止从远程主机接收错误日志

syslog.conf的格式:kern Kernel

user       User level

mail        Mail subsystem

daemon    System daemons

auth       Security or authorization

syslog      syslogd daemon

lpr         Line-printer subsystem

news       News subsystem

uucp       uucp subsystem

*           All facilities

emerg        Specifies emergency messages (LOG_EMERG). These messages

are not distributed to all users. LOG_EMERG priority messages can

be logged into a separate file for reviewing.

alert          Specifies important messages (LOG_ALERT), such as a serious

hardware error. These messages are distributed to all users.

Crit           Specifies critical messages not classified as errors (LOG_CRIT),

such as improper login attempts. LOG_CRIT and higher-priority

messages are sent to the system console.

err            Specifies messages that represent error conditions (LOG_ERR),

such as an unsuccessful disk write.

warning        Specifies messages for abnormal, but recoverable, conditions

(LOG_WARNING).

notice          Specifies important informational messages (LOG_NOTICE).

Messages without a priority designation are mapped into this priority.

These are more important than informational messages, but not

warnings.

info            Specifies informational messages (LOG_INFO). These messages

can be discarded but are useful in analyzing the system.

debug          Specifies debugging messages (LOG_DEBUG). These messages

may be discarded.

None           Excludes the selected facility. This priority level is useful only if

preceded by an entry with an * (asterisk) in the same selector field.

File Name       Full path name of a file opened in append mode.

@Host          Host name, preceded by @ (at sign).

User[, User][...]   User names.

*                All users.

#<facility>is:

#*-all (except mark)

#mark -time marks

#kern,user,mail,daemon,auth,...(see syslogd(AIX Commands Reference))

#

#<priority>is one of (from high to low):

#emerg/panic,alert,crit,err(or),warn(ing),notice,info,debug

#(meaning all messages of this priority or higher)

#

#<destination>is:

#/filename -log to this file

#username [,username2...] -write to user(s)

#@hostname -send to syslogd on this machine

#*-send to all logged in users

#

#example:

#"mail messages,at debug or higher,go to Log file.File must exist."

#"all facilities,at debug and higher,go to console"

#"all facilities,at crit or higher,go to all users"

#mail.debug /usr/spool/mqueue/syslog

              如果更改配置文件将重新启动DAEMON

              ps –ef |grep syslogd

        stopsrc –s syslogd

        startsrc –s syslogd

例子:

发送mail的debug级之上的信息到/tmp/mailsyslog中:mail.debug /tmp/mailsyslog

到主机:*.debug;mail.none @rigil

到用户:*.emerg;mail,daemon.crit nick,jam

到所有用户的终端屏幕:mail.debug *

21.              添加TTY:smitty maktty

        删除TTY:rmdev -l tty_name –d

         查看所有TTY:tty

22.              安装分为三种:新的安装、升级安装、保存安装

升级安装:升级安装将升级操作系统,保存除/tmp之外的所有逻辑卷和文件系统

保存安装:将覆盖/usr, /tmp, /var, and /等文件系统,可以通过修改/etc/preserve.list文件保护需要保护的文件系统

23.              在5L中将多三种设置:

Installation Package Set or Desktop:

默认的安装是ASCII consoles,还有:CDE、KDE、GNOME、NONE模式

Enable Trusted Computing Base (TCB):多安装一个bos.rte.security包,增加安全级别

Enable 64-bit Kernel and JFS2:如果是64位处理器将自动安装64位kernel

bos.mp64包决定kernel级别

bootinfo –y:识别硬件位数

JFS2支持1TB的文件,最大的文件系统可以到1PB

如果是新装操作系统,将自动创建JFS2;如果原来是32位系统,将不显示该参数;如果64位系统做升级安装,将自动ENABLED该选项,但不更改现有文件系统

24.              /usr/sbin/install_assist或smitty assist为辅助配置命令(如果是字符终端将显示字符格式)

25.              Oslevel

-l 4.3.3.0:列出低于4.3.3.0版本的包

        -g:列出高于当前版本的包

        -q:列出版本的名字,可配合-l

26.              存储在/usr/sys/inst.data/sys_bundles。5L有:APP-DEV、CDE、GNOME、KDE、Media-Defined、Netscape、devices、wsm_remote

27.              APAR (Authorized Program Analysis Report)经过测试将变为PTF(Program Temporary Fix)

28.             installp

-a 应用一个软件包,这个参数是默认值。一般配合-c参数使用,用于提交软件包

-B  指出不升级的软件包

-C 清除未完成的安装或损坏的安装

-c 提交软件包

-d Device   指出安装介质

-F 如果已有同样的版本或更新的版本,强行安装此包

-f ListFile  从ListFile读产品名,可以将installp -l 作为输入命令

-g 自动执行

-L显示table of contents(.toc) 内容

-l 列出所有安装的软件产品

-N 安装或升级时不考虑直接替换,配合-ac 使用

-p 安装前预览,仅配合-a, -c, -r, and –u使用

-r 删除所有只应用未提交的包

-u 删除软件包,但是bos.rte.*不会被删除

-V Number 指定详细的安装信息

-v 校验软件包

-X 如果空间不足将扩大被安装的文件系统

如果应用不提交,旧版本将保存在/usr/lpp/PackageName中

例如:安装提交并先预览、需要时扩文件系统

如果从同一介质同时提交两个安装作业将报错:0503-430 installp: Either there is an installp process currently running

or there is a previously failed installation. Wait for the process to

complete or run installp -C to cleanup a failed installation.

安装记录在/var/adm/sw/installp.summary中

提交所有并在需要时扩大文件系统:installp -cgX all

移除所有应用包,并输出到文件:installp -rBfX ./reject.list

预先删除包并详细显示:installp -ugp -V2 bos.net.ipsec.rte

清除失败的安装:installp –C

列出软件包:installp -L -d /dev/cd0

/var/adm/sw/installp.log记录安装记录,$HOME/smit.log记录详细记录

快速安装路径:smitty install_latest

快速安装提交路径:install_commit

快速移除路径:smitty install_reject

快速卸载路径:smitty install_remove

29.              lslpp

-l 显示版本

-f 显示安装的详细信息   例如:lslpp -f bos.64bit

-h 显示安装、升级的历史信息   例如:lslpp -h bos.sysmgt.trace

-a 结合其他参数显示全部信息,不能和-f混用

30.              下载补丁可用fixdist命令,登陆http://service.software.ibm.com

下载为BFF(Backup File Format)格式,用backup作成,用restore解

inutoc命令可生成.toc文件:inutoc [Directory name ]

31.              instfix

-a 显示关联信息,可以同-f、-i、 -k 参数合用

-d Device 指定输入设备,但不能同-i 、 -a合用

-f FileName 指定输入文件名

-i 显示安装的信息

-k Keyword 列出关键字

-s String 搜寻关键字符串

-T 在介质上显示列表

-v 配合-I参数,详细列出

例如:

列出光驱中的版本:instfix -T -d /dev/cd0

查看是否安装:instfix -ik IX75893

显示关联信息:instfix -aik IX75893

查看安装版本:instfix -i |grep ML

从光驱安装:instfix -k IX75893 -d /dev/cd0

定位报告文件:instfix -aik IX75893 >/tmp/instfix.out 2>/tmp/instfix.err

instfix -iv

显示版本快速路径:smitty show_apar_stat

升级部分快速路径:smitty instfix 或smitty update_by_fix

升级所有快速路径:smitty update_all

32.              创建介质的安装版:smitty bffcreate

        复制到/usr/sys/inst.images,并升级.toc

        如果.toc文件坏掉可用inutoc /usr/sys/inst.images/.toc重新创建

33.              做mksysb需要有bos.alt_disk_install.boot_images包、克隆需要bos.alt_disk_install.rte包

        smitty alt_install用mksysb恢复到交换盘或将rootvg克隆到交换盘

         做克隆盘:smitty alt_clone   该盘不能属于任何VG,也不能为SSA盘

        可以在Exclude list区域选择上不希望克隆的文件或目录,可以选择下次启动的位置

        在新盘上安装备份的系统:smitty alt_mksysb

34.              Level:xx.xx.xxxx.xxxx:version. release. Modification. Fix

35.              ODM被备份到三个位置:/usr/lib/objrepos   /usr/share/lib/objrepos   /etc/objrepos

        ODM Object  <   Object Class   <    ODM Database

         ODM没有对应的SMIT命令

        odmadd:在object class中添加一个object

        odmchange:在object class中变化一个object

        odmcreate:创建一个空的object classes

        odmdelete:在object class中删除一个object

        odmdrop:删除整个object class

        odmget:在object class中找到一个object

        odmshow:显示一个object class的信息

36.              Volume Group Descriptor Area (VGDA)

Volume Group Status Area (VGSA)

Logical Volume Control Block (LVCB)       

删除卷组:reducevg

查看逻辑卷的lvcb信息:getlvcb -TA hd2

一个卷组中只有一块硬盘:每个磁盘上有两个VGDAs

一个卷组中有两块硬盘:在第一块硬盘上有两个VGDAs,在第二块硬盘上有一个VGDA

一个卷组中有三块硬盘或更多:每块硬盘上有一个VGDA

37.              mklv

        mklvcopy

        mirrovg(或smitty mirrorvg):将关闭quorum

         mirrorvg rootvg

         创建三个mirrorvg -c 3 workvg

          删除坏的镜像重新创建

          unmirrorvg workvg hdisk7

reducevg workvg hdisk7

rmdev -l hdisk7 -d

extendvg workvg hdisk7

mirrorvg workvg

mirrorvg -S -c 3 workvg    -c:镜像数  -S:后台执行

mirrorvg -m datavg hdisk2 hdisk3   -m:精确的

rootvg镜像完成后还需:

bosboot:创建boot image  需要一定/tmp空间

bootlist

重新启动

非rootvg需varyoff、varyon一次

系统的dump驱动器:primary /dev/hd6 and secondary /dev/sysdumpnull

         paging device会自动做镜像

         dump不会做

         sysdumpdev

38.              三种添加硬盘方法:

重新启动自动添加硬盘,生成16位的PVID

        如果不重起,需要手工运行cfgmgr

        mkdev -c disk -s subclass -t type -p parentname -w whereconnected -a

pv=yes

39.              生成PVID:chdev -l hdisk1 -a pv=yes

40.              设置权限:chpv -a n hdisk1

         设为无效:chpv -v r pvname

         设为有效:chpv -v a pvname

41.               删除一块硬盘:rmdev -l hdisk1

         删除硬盘从ODM中:rmdev -dl hdisk1

42.              lspv

        lsdev -C -c disk

         lspv hdisk1

         STALE PARTITIONS:旧的分区数

        ALLOCATABLE:权限是否有

        VG DESCRIPTORS:VGDA数量

        列出LV的分布:lspv -l hdisk1

        列出PV的分布:lspv -p hdisk1

        列出PP的分布:lspv -M hdisk0

43.              移动PP:migratepv

         lsvg -p rootvg

          看是否有盘:lsdev -Cc disk

          看是否空闲:lspv

          如果有HD5:migratepv -l hd5 SourceDiskNumber DestinationDiskNumber(smitty migratepv)

          migratepv不允许移动varyon的VG

         如果是条带化的LV,只能用cplv、rmlv

         bosboot

         清除原盘启动信息:mkboot –c

         AIX 4.2之前需:

bosboot -a -d /dev/DestinationDiskNumber

bootlist -m normal DestinationDiskNumber

mkboot -c -d /dev/SourceDiskNumber

        例:移动PP从HDISK1到HDISK6和7:migratepv hdisk1 hdisk6 hdisk7

            移动LV02从HDISK1到6:migratepv -l lv02 hdisk1 hdisk6

44.              smitty mkvg

        -d:支持最大的PV数,默认为32

        添加一个新的卷组ROOT文件系统至少需要2M空间,因为需要写到/etc/vg

        是否自动VARYON:chvg -ay newvg

         当在进行LVM时,会锁VG,打开:chvg -u newvg

         mkvg -y myvg -d 10 -s 8 hdisk1 hdisk5

         extendvg newvg hdisk3(smitty vgsc)

        reducevg myvg hdisk3(也可以是PVID号)

         -d:在移出VG前会将PV上的所有LV删除,这样可能会影响到其他PV

         -f:在移出VG前会将PV上的所有LV删除,这样可能会影响到其他PV,但是交互式的

45.              exportvg myvg(smitty exportvg)

          importvg -y myvg hdisk12(smitty importvg)

          换名:varyoffvg vg00

exportvg vg00

importvg -y cadsvg hdisk1

          EXPORT一个paging_space时,需停paging_space:chps -a n paging_space_name

        Export和import时会更改/etc/filesystems

46.              syncvg

        varyonvg

         -f:强制varyon

         -n:不调用syncvg命令,防止将坏的复制到好的

         -s:在维护模式下

47.              smitty varyoffvg

48.              lsvg

        lsvg –o

        lsvg rootvg

        lsvg –l rootvg

        列出VG中的PV状态

49.              先运行chlv –r

         不能改组条带化的

         必须有空余的PP

         smitty reorgvg

         reorgvg vg02 lv03 lv04 lv07

          reorgvg -i vg02 lv203 lv205

50.              同步硬盘:syncvg -p hdisk04 hdisk05

         同步VG:syncvg -v vg04 vg05

51.              mklv

        参数:

        -c copies:每一个LP对应的PP数,默认是1,可以1-3

        -i:当PV是标准的输入时

        -L:设置LV的LABEL,默认没有

        -P Modes:指定权限

        -t Ty p e:JFS、JFSLOG、paging、boot(用户不能用),如果创建JFSLOG,需要运行:logform /dev/logdev

        -y NewLV:指定LV名

        例:mklv -y newlv -c 2 rootvg 10(smitty mklv 在选择PV时如果不选,将默认建在第一个PV上)

52.              rmlv

        参数:-f:删除并无须确认

-p PhysicalVolume:仅移动这个PV上的LV

        例:rmlv newlv(smitty rmlv)

53.              扩展LV:extendlv(smitty extendlv)

         如果已经创建文件系统,可以直接chfs(smitty chjfs)扩大文件系统

         加3个LP:extendlv newlv 3

54.              cplv -v myvg -y newlv oldlv(如果不指定VG将创建在OLDLV的同一个VG上

         cplv -e existinglv oldlv(拷贝到存在的LV上)(smitty cplv)

        如果报错:cplvestination logical volume must have type set to copy

chlv -t copy Destination_Logical_Volume_Name然后在做

55.              不推荐拆分LV,拆分LV之前需先CLOES文件系统

        原来OLDLV有3个COPY,拆分后NEWLV为1个,OLDLV变为2个:splitlvcopy -y newlv oldlv 2

56.              HD1-------/home文件系统

HD2--------/usr文件系统

        HD3-------/tmp文件系统

HD4--------/文件系统

        Hd5--------仅在启动时有效

HD6-------默认的paging spaceLV

        HD8--------默认的日志文件系统

        HD9VAR-/var文件系统

        看VG的LVlsvg |lsvg -il

57.              lslv newlv

58.              Total LV size=PP size * LPs assigned to LV * Number of copies of the LV

59.              文件系统包含:a boot block, a superblock(1-31), bitmaps, and one or more allocation groups(由data blocks and i-nodes组成)

        文件系统分为:Journaled File System、Network File System、CD-ROM File System

60.              需要MOUNT的文件系统会写在/etc/filesystems中

61.              Number of i-nodes:在一个文件系统中的最大文件数,从512—131072

Allocation group size:从8MB—64MB

File system fragment addressability:支持512、1024、2048、4096

The Journaled File System log:4MB,如果文件系统超过2GB,默认会增长,但不超过256MB

Maximum Journaled File System size:the minimum of NPBI * 2 24 or Fragment Size * 2 28

62.              smitty crjfs

         AIX所有的I/O为4KB blocks,空间为512 byte block

         例:crfs -v jfs -g rootvg -a size=8192 -m /dummy

63.              mount后,如做PWD权限至少是111

        mount all

        smitty mount

        如果设置为自动mount,会在/etc/filesystems中添加mount=automatic,并写入/etc/rc,如果属于自动MOUNT的文件系统,在执行mount all时不会重复MOUNT,如果执行umount all也不会受到影响。chfs –A  yes file_system

         还有一种自动MOUNT的类型是用户控制的,mount all命令可以影响,在/etc/filesystems中会添加为mount=true        

64.              smitty rmjfs

         rmfs filesystem_name

          加-r参数可以移除MOUNT POINT

65.              chfs -a size=new_size_in_512-byte_blocks file_system_name Filesystem size changed to new_size_in_512-byte_blocks

          smitty chjfs

         如果要减少需要备份、删除、重建

         如果用mksysb恢复,有一个shrink选项可以收缩文件系统

66.              fsck

        参数:

-f :快速检查,不检查MOUNT等

-p: 不显示小问题

-tFile :指出一个文件

-y :自动回答YES

正常情况该命令只是提交正常报告

如果不指明文件系统,该命令只检查/etc/filesystems中check=TRUE的文件系统

/, /usr, /var, and /tmp在/etc/filesystems中check=false,因为在启动时已检查,而且该命令不检查MOUNT的文件系统

67.              logform LogName

         执行这个命令将清除原LOG

         最好可以将JFSLOG放在其他PV

68.              In file systems enabled for large files, file data stored before the 4 MB file offset is allocated in 4096 byte blocks and the file data stored beyond the 4 MB file offset is allocated with large disk blocks of 128 KB in size. The large disk blocks are actually 32 contiguous 4096 byte blocks

        For example, a 132 MB file in a file system enabled for large files has 1024 4 KB

disk blocks and 1024 128 KB disk blocks. In a regular file system, the 132 MB file

would require 33 single indirect blocks (each filled with 1024 number of 4 KB disk

addresses). However, the large file geometry requires only two single indirect

blocks for the 132 MB file.

查看文件系统情况:lsfs -q file_system

69.              如果FSCK报错:fsck:Not a recognized file system type

mount:invalid argument

dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00

         fsck -p /dev/lv00

         fsck /dev/lv00

         如果仍未解决需重新创建

         如果报错:Device busy或A device is already mounted or cannot be unmounted

         fuser -xc /tmp显示涉及的进程

         然后分别kill

         如果仍未解决,可以用genkex检查所有涉及的kernel

         也可以:find /home -type d -exec fuser -u {}\;用-u参数检查属主

           

70.              一个PAGE可以HOLD住4KB的数据

        hd6是主换页空间,4.2.1至少32M,4.3至少64M,可以用不多余20%的硬盘空间;HD6:如果内存小于256MB,PS是内存的2倍;如果大于256MB,PS是512MB

71.              vmstat和topas可以查看PS的情况

72.              总的PS=512 MB + (memory size - 256 MB) * 1.25

        主PS应该稍微大一些

73.              chps:改变PS的属性

        lsp:显示PS

        mkps:添加一个PS

        rmps:删除一个未激活的PS

        swapon:激活一个PS

        swapoff:关闭PS

74.              Swapon在系统初始化(/sbin/rc.boot)时已做

        在4.3,chps更改完成后,系统重启,然后即可用rmps删除;在5.1版本的AIX中用swapoff命令动态关闭PS,然后即可用rmps删除。不要将PS添加到容易移动的DISK

75.              swapon –a:/etc/swapspaces

        mkps –a    rmps     chps –a

        PS的信息在/etc/rc中

76.              按简易显示PS的状况:lsps -a -c

        按表显示PS的状况:lsps -a

          显示总空间和使用状况:lsps -s

77.              smitty mkp

         chps:可以定义在下次重启后是否激活PS,增加PS的大小

         在5L中不用重启即关闭PS和缩小PS

         smitty chps

         在5L中可以用swapoff /dev/paging03(smitty swapoff)动态关闭PS

         在5L中可以用chps –d先减小空间

         例:chps -d 2 paging03

shrinkps:Temporary paging space paging04 created.

shrinkps:Paging space paging03 removed.

shrinkps:Paging space paging03 recreated with new size.

78.              删除一个PS(除HD6)的步骤

        首先检查DUMP位置:sysdumpdev –l,不能移动主DUMP驱动器,首先要改变DUMP驱动器:sysdumpdev -P -p /dev/new_dump_device

         smitty chps改变启动激活属性

         SHUTDOWN系统

         Smitty rmps

         如果为5L:swapoff /dev/paging00

rmps paging00

79.              HD6不能减小到32MB以下,否则系统将不能启动;

        如果要减小HD6必须有足够的匹配内存大小的硬盘空间用于运行应用;lsattr -E -l sys0 -a realmem

         创建临时的PS:mkps -a -n -s 30 rootvg hdisk0

         chps -a n hd6

         编辑/sbin/rc.boot文件,将swapon /dev/hd6改为swapon /dev/paging00

         检查主DUMP区:sysdumpdev –l

         primary /dev/hd6

         secondary /dev/sysdumpnull

         copy directory /var/adm/ras

         forced copy flag TRUE

         always allow dump FALSE

         变换主DUMP区:sysdumpdev -P -p /dev/paging00

         重新创建HARD DISK IMAGE(将更改rc.boot):bosboot -d /dev/hdisk0 –a

         shutdown –r

         然后删除HD6:rmps hd6

         创建新的PS:mklv -t paging -y hd6 rootvg 30

         lsps –a

         改变主DUMP:sysdumpdev -P -p /dev/hd6

         编辑/sbin/rc.boot文件,将swapon /dev/paging00改为swapon /dev/hd6

         重新创建HARD DISK IMAGE(将更改rc.boot):bosboot -d /dev/hdisk0 –a

         定义自动启动:chps -a y hd6

         chps -a n paging00

         shudown –r

         rmps paging00

         如果为5L,可以直接chps –d更改,系统将自动保护不要小于32MB和删除

80.              不推荐将HD6移动到其他VG,如果需要创建PS在其他VG,最好将HD6调整的越小越好,等同于内存大小,另外VG的PS创建大一些

        如果需要将HD6从ROOTVG的HDISK0到HDISK1:migratepv -l hd6 hdisk0 hdisk1无须重启

81.              性能的调节:fixed disk:LV的分布,PS的建立,分析磁盘的I/O请求;real memory:虚拟管理及内存的泄露;running thread:运行的线路;通讯的I/O控制:communications I/O:工作的类型及通讯的连接,调节通讯驱动、协议、NFS

82.              Workstation:用户的响应时间最重要

        Multiuser:最大的系统吞吐量,平均每个要最短的响应时间或适合的响应时间

        Server:磁盘的I/O、数据库、应用、 打印等等

83.              多CPU利于多进程

        多I/O卡和多磁盘可以提高I/O应用

        内存多多益善

        硬件或软件的镜像将增加数据的可靠性

        机器的镜像

84.              

iostat 统计CPU和I/O的报告

vmstat 虚拟内存的统计报告

netstat 显示网络关联的数据结构内容

ps 显示进程状态

lsattr 显示驱动器属性

lslv 显示LV信息或LV在PV的位置信息

nfsstat 显示NFS状况和Remote Procedure Call (RPC) 情况

nice 一个命令的优先权

no 显示或设置网络选项

renice 改变进程的优先权

reorgvg 在VG中改变PP的位置

sar 收集、报告系统的活动信息

schedtune 设置CPU的计划和内存的进程管理

svmon 捕获、分析虚拟内存的快照

time 显示执行时间和用户或系统的进程时间

tprof 报告CPU的程序运行、系统运行的使用情况

trace 记录、报告系统事件

85.              vmstat:报告kernel threads, virtual memory,disks, traps, and CPU

        -f:自从启动后的fork数

        -i:显示每个驱动器使用的中断数

        -s:显示写到标准输出的结构数

        例:

        在两秒内记录5次:vmstat 2 5

        显示两块盘:vmstat hdisk0 hdisk1

        forks统计:vmstat –f

        显示各个事件数:vmstat –s

        Kthr: Kernel thread state

         r:运行队列等待的内核线程数,空闲为0

         b:等待队列上的内核线程数

         Memory: Usage of virtual and real memory

         avm:换页空间的的页数

         fre:内存页的空余数

         Page: Page faults and paging activity

         re:输入输出记录

         pi:进入PS的记录数

         po:输出PS的记录数

         fr:记录空闲情况

         sr:遵循页置换法则的检测

         cy:遵循页置换法则的时间周期

         Faults: Trap and interrupt rate averages per second

         in:驱动器中断

         sy:系统呼叫

         cs:内核线程转换

         CPU: % usage of CPU time

         us:使用时间

        sy:系统时间

        id:CPU空闲时间

        wa:CPU判断系统等待和磁盘输入输出的循环

        Disk:每秒中交易的数字

86.              iostat用于监控输入输出设备的传输率,PV、TTY、CPU、DISK

        iostat

        显示2秒内的硬盘报告:iostat –d hdisk1 2

        在2秒内显示6份报告:iostat –d hdisk1 2 6

        在2秒内显示6份报告为所有盘:iostat –d hdisk1 2 6

        在2秒内显示6份报告为所有盘:iostat –d disk1 disk2 disk3 2 6

        TTY、CPU报告:

        tin:所有TTY的读属性总数

tout:所有TTY的写属性总数

% user:应用(用户级)对CPU的利用率

% sys:内核(系统级)对CPU的利用率

% idle:CPU的空闲率

% iowait: 显示在系统利用I/O时的CPU的空闲率

磁盘报告:

% tm_act:显示被激活的时间百分比

Kbps:指出每秒钟数据传输的多少KB

Tps:物理硬盘的每秒传输数,一个传输是只一个I/O请求到磁盘,多个逻辑请求可能组成一个I/O请求

Kb_read:读的KB数

Kb_wrtn:写的KB数

87.              /bin/netstat –D显示通讯包数

        -n:显示网络地址

        -r:显示路由表:

         参数:

         U:UP     H:路由到一个主机胜于到一个网络    G:路由是一个网关

         D:路由改变方向被动态的创建   M:路由被改变   L:连接级别地址

         c:复制一个路由     W:一个克隆路由

         Gateway:显示地址      Refs:为路由当前激活的数量   Use:发送包的数量

         PMTU:路径最大传输单元 Interface:指出网卡类型  Exp:显示停止的剩余时间

         Groups:提供一个组ID的列表   Netmasks:列出掩码

        -s:为每个协议显示统计表

        /etc/networks

        NS地址由12位数组成,其中4位网络数、6位主机数、2位端口数

        -i:显示网络配置、错误、碰撞(除以太)、包传输

88.              svmon:更好的内存分析工具

        sar:系统的各种累计数输出,-A为所有的

        tprof:跟踪CPU的情况

        schedtune:更改系统默认的计划

89.              nice和renice提高或降低进程的优先权,ROOT用户可以随意更改,其他用户只能降低自己的优先权

        例:nice -n 15 cc -c *.c

              renice -n 5 16304

90.              WLM  VMM

91.              Total CPU Idle Time % = wait % + Idle Time %

92.              换页率:pi/po

93.              tar The tar command manipulates archives by writing files to, or

retrieving files from, an archive storage medium. The files used by

the tar command are represented by the File parameter. If the File

parameter refers to a directory, then that directory and, recursively, all

files and directories within it are referenced as well.

-x Extracts the files from the archive.

-c Creates a new archive and writes the files

specified.

-t Lists the files in the order in which they appear in

the archive.

-f Archive Uses the Archive variable as the archive to be read

or written. For example, /dev/fd0.

-p Says to restore fields to their original modes

ignoring the current umask.

-v Lists the name of each file as it is processed.

cpio The cpio command copies files into and out of archive storage and

directories.

-i Reads from standard input an archive file created

by the cpio -o command and copies from it the files

with names that match the Pattern parameter.

-o Reads file path names from standard input and

copies these files to standard output.

-c Reads and writes header information in ASCII

character form. If a cpio archive was created using

the -c flag, it must be extracted with a -c flag.

-v Lists file names.

-d Creates directories as needed.

-u Copies unconditionally. An older file now replaces a

newer file with the same name.

-m Retains previous file modification time. This flag

does not work when copying directories.

-B Performs block input and output using 512 bytes to

a record.

dd The dd command reads the InFile parameter or standard input, does

the specified conversions, then copies the converted data to the

OutFile parameter or standard output. The input and output block

size can be specified to take advantage of raw physical I/O.

if=InFile Specifies the input file name; standard input is the

default.

of=OutFile Specifies the output file name; standard output is

the default.

skip=SkipInput

Blocks

Skips the specified SkipInputBlocks value of input

blocks before starting to copy.

pax The pax command should be the archive of choice for system dumps

and images greater than 2 GB in size.

-a Appends files to the end of an archive.

-f Archive Specifies the path of an archive file to be used

instead of standard input (when the -w flag is not

specified) or standard output (when the -w flag is

specified but the -r flag is not).

-r Reads an archive file from the standard input.

-v Writes information about the process. If neither the

-r or -w flags are specified, the -v flag produces a

verbose table of contents; otherwise, archive

member path names are written to standard error.

-w Writes files to the standard output in the specified

archive format.

-x For mat Specifies the output archive format. If no format is

provided, pax uses the pax format by default.

mksysb The mksysb command creates an installable image of the root volume

group either in a file or onto a bootable tape.

-e Excludes files listed in the /etc/exclude.rootvg file

from being backed up.

-i Calls the mkszfile command, which generates the

/image.data file automatically during a backup.

-m Calls the mkszfile command to generate map files.

-X Automatically expands /tmp as necessary.

savevg The savevg command saves non-root volume groups.

-i Creates the data file by calling the mkvgdata

command.

-f Device Specifies the device or file name on which the

image is to be stored. The default is the /dev/rmt0

device.

-e Excludes files specified in the /etc/exclude.vgname

file from being backed up by this command.

backup The backup command creates copies of your files on a backup

medium, such as a magnetic tape or diskette. The copies are in one

of the two backup formats: Either specific files backed up (using the -i

flag), or the entire file system backed up by i-node.

-i Specifies that files be read from standard input and

archived by file name.

-p Specifies that the files be packed, or compressed,

before they are archived. Only files of less than 2

GB are packed. This option should only be used

when backing up files from an inactive file system.

Modifying a file when a backup is in progress may

result in corruption of the backup and an inability to

recover the data. When backing up to a tape device

that performs compression, this option can be

omitted.

-q Indicates that the removable medium is ready to

use. When you specify the -q flag, the backup

command proceeds without prompting you to

prepare the backup medium. Press the Enter key to

continue.

-u Updates /etc/dumpdates with time, date, and level

of the last incremental backup.

-v Causes the backup command to display additional

information about the backup.

restore The restore command reads archives created by the backup

command and extracts the files stored on them. These archives can

be in either file-name or file-system format.

-d Indicates that, if the File parameter is a directory, all

files in that directory should be restored. This flag

can only be used when the archive is in filename

format.

-f Device Specifies the input device. To receive input from a

named device, specify the Device variable as a path

name (such as /dev/rmt0). To receive input from the

standard output device, specify a - (minus sign).

-q Specifies that the first volume is ready to use and

that the restore command should not prompt you to

mount the volume and press Enter.

-r Restores all files in a file system archive.

-s SeekBackup Specifies the backup to seek and restore on a

multiple-backup tape archive. The -s flag is only

applicable when the archive is written to a tape

device. To use the -s flag properly, a

no-rewind-on-close and no-retension-on-open tape

device, such as /dev/rmt0.1 or /dev/rmt0.5, must be

specified.

restvg Use the restvg command to restore a volume group.

-f Device Specifies the device name of the backup media.

The default is /dev/rmt0.

-p PPsize Specifies the number of megabytes in each

physical partition. If not specified, restvg uses the

best value for the PPsize, dependent upon the

largest disk being restored to.

-s Specifies that the logical volumes be created at the

minimum size possible to accommodate the file

systems.

tctl Use the tctl command to control a tape device.

-b Specifies, in bytes, the block size used to read and

write to the tape device.

-f Specifies the tape device to use.

94.              mksysb:用户定义的PS和裸设备将不被备份

95.              首先mksysb在第一个块(512)用bosboot创建system’s kernel and device drivers,形成BOS boot image;在第二个块mkinsttape image中有三个./tapeblksz(记录块的大小), ./bosinst.data(记录BOS的安装情况)and ./image.data(包括rootvg的大小、名字、LV、文件系统等等的相关信息,在备份期间可以用-I参数调用mkszfile命令,重新生成一个新的)文件;第三个块dummy table of contents (TOC);第四块为rootvg data,mksysyb将调用backup命令备份JFS的数据,但不包括裸数据。

96.              ./image.data文件每个节中有三个重要的区域:SHRINK:如果设为YES可以缩小相应的文件系统;BOSINST_FILE:提供文件的全路径名或命令的执行;EXACT_FIT:如果设为YES将严格根据物理分区图创建LV

97.              如果不想备份哪个文件系统,通过编辑/etc/exclude.rootvg,添加相应的文件系统名,用-e参数,即可使exclude.rootvg文件生效

备份其他卷不能用mksysb,可以用savevg , tar ,cpio , or backup .

98.              savevg要备份的VG,必须是VARYON的,并且文件系统被MOUNT,备份数据时调用mkvgdata命令。备份一个USERVG:savevg -if /dev/rmt0 uservg,并创建uservg.data文件

99.             备份当前目录:tar -cvf /dev/fd0 *,c创建一个备份,v列出备份文件的内容,f指定驱动器,参数前可不跟减号。

100.         备份当前目录:find .-depth |backup -i -f /dev/rmt0,恢复时要先进入目录,-depth同-print相同

101.         备份当前目录:find /userdirectory -print |cpio -o -c -v -B >/dev/rmt0

102.         backup -0 -uf /dev/rmt0 /data:-u参数用于升级/etc/dumpdates文件,记录备份时间;0级备份为全备份,每级备份从前一级备份开始,一共有9级备份,系统默认为9级

103.           tctl可以操作流设备,tctl [ --f Device ] [ eof ||weof |fsf(向后多少,结尾EOT) |bsf(向前多少,BOT)BO |fsr |bsr |rewind(重绕) |offline(弹出) |rewoffl |erase |retension |reset |status(状态) ] [Count ]

104.           tctl -f /dev/rmt0 rewind

         restore -T -d -v -q -s4 -f /dev/rmt0.1

         tctl -f /dev/rmt0 rewind

         restore -x -d -v -q -s4 -f /dev/rmt0.1 ./etc/hosts

         tar -x -v -f /dev/rmt0 /etc/hosts

           cpio -i -c -v -d -u -m -B </dev/rmt0 "/etc/hosts"

           restore -x -d -v -q -f /dev/rmt0 /etc/hosts

           restore -x -v -q -f /dev/rmt0 /etc/hosts

           恢复目录:

           tctl -f /dev/rmt0 rewind

           restore -x -d -v -s4 -f/dev/rmt0.1 ./var/dt

           tar -x -v -f /dev/rmt0 /var/dt

           cpio -i -c -v -d -u -m -B </dev/rmt0 "/var/dt/*"

           restore -x -d -v -q -f /dev/rmt0 /var/dt

           restore -x -v -q -f /dev/rmt0 /var/dt

105.           块不一致:

        #tar -tvf /dev/rmt0

tar:0511-193 An error occurred while reading from the media.

There is an input or output error.

检测块的大小

#tcopy /dev/rmt0

tcopy :Tape File:1;Records:1 to 7179 ;size:512

tcopy :Tape File:1;End of file after :7179 records;3675648 bytes

tcopy :Tape File:2;Records:1 to 2900 ;size:512

tcopy :Tape File:2;End of file after 2900 records,76890 bytes

或dd if=/dev/rmt0 bs=128k count=1 |wc –c

chdev -l rmt0 -a block_size=512

106.           显示支持的启动:bootinfo –p或lscfg -vp |grep Arch

107.           如果在软盘中有./bosinst.data文件和SWITCH_TO_PRODUCT_TAPE=yes,将根据需要提示放入安装介质

108.           BOS的安装日志:cd /var/adm/ras/devinst.log

109.           克隆的机器微处理器的内核必须是一致的

110.           dd if=/dev/fd0 of=/tmp/ddcopy

111.           tcopy /dev/rmt0 /dev/rmt1

112.           系统初始化时读取/etc/inittab,调用/usr/sbin/srcmstr

113.           mkitab -i fbcheck srcmstr:2:respawn:/usr/sbin/srcmstr

         telinit q(通知/etc/inittab被更新)

114.           telinit:

        0-9 运行级别

S,s,M,m 维护模式

a,b,c 检查

Q,q 重新检查/etc/inittab文件

N 发送停止信号

115.           如果杀掉srcmstr进程,他将会自动重启;-r参数防止远程请求,-B运行在4.3.1版本之前,加这两个参数后需要init –q重新检测/etc/inittab

116.           

startsrc -s srctest -a "-D DEBUG"

startsrc -s srctest –e "TERM=dumb HOME=/tmp"   环境变量

startsrc -g nfs           组

          startsrc -s srctest         子系统

          startsrc -g nfs -h itsosmp   主机,但远程主机需支持

          startsrc -t tester          类型

          startsrc -o tester -p 1234   目标

          startsrc -t tester -p 1234    PID号

117.           syslog在IPL中被srcmstr调用,配置/etc/syslog.conf

        可以通过odmget –q subsysname=syslogd SRCsubsys查看

118.           如果希望获取所有警告信息:在/etc/syslog.conf中添加*.warning /var/spool/syslog

         创建一个:touch /var/spool/syslog

         允许所有用户写chmod 666 /var/spool/syslog

          刷新syslogd进程:refresh -s syslogd

#stopsrc -s syslogd

#startsrc -s syslogd

119.           允许用户打开新的目录:

        startsrc -s httpd

         pass /*/newdir/*

         refresh -s httpd

120.           事件定义在/var/adm/cron/queuedefs中

121.           CRON的日志在/var/adm/cron/log

122.           Crontab,at,batch,sync,ksh,csh

123.           Crontab格式:minute hour day_of_month month weekday command (weekday为0 through 6 for Sunday through Saturday)

124.           每月15日做全备份:crontab –e:0 1 15 **/fullbackup

125.           /var/adm/cron/cron.allow and /var/adm/cron/cron.deny记录允许和禁用的crontab命令;一个用户不能用crontab命令有三种情况:cron.allow和cron.deny文件不存在,标志只允许ROOT使用;cron.allow存在,但用户名不在其中;cron.deny存在,用户名在其中

126.           如果用ROOT登陆,用crontab –l命令将列示:

        #0 3 ***/usr/sbin/skulker

#45 2 **0 /usr/lib/spell/compress

#45 23 ***ulimit 5000;/usr/lib/smdemon.cleanu >/dev/null

可以注释掉,相关的#

127.           Skulker命令可以定期清除/tmp,a.out,core,ed,hup等文件

128.           在skulker之前可以先运行xargs -p

129.           /var/spool/cron/crontabs/root

130.           /usr/lib/spell/compress 压缩掉/usr/lib/spell/spellhist中重复的字段

131.           smdemon.cleanu负责清理sendmail和/var/spool/mqueue/log

系统在IPL阶段将运行/etc/rc.tcpip:将运行inetd 、gated、routed、named、timed、rwhod、 lpd、portmap、sendmail、syslogd,可以用startsrc和stopsrc启动停止进程;也可以用脚本sh /etc/tcp.clean停止TCP/IP进程:ndpd-host、lpd、routed、gated、sendmail、inetd、named、timed、rwhod、iptrace、snmpd、rshd、rlogind、telnetd、syslogd,并且会删除/etc/locks/lpd TCP/IP锁文件;但是不能停止protmap和nfsd进程,需要手工执行stopsrc –s portmap和stopsrc -s nfsd

132.           不能用startsrc -g tcpip开始进程,那样会启动routed和gated,这两个进程不能同时启动

133.           如果不想启动,需从/etc/inittab中删除rc.dt和rc.tcpip

134.           /usr/sbin/inetd负责提供网络的Internet service,配置文件为/etc/inetd.conf

135.           如果通过SMIT更改inetd.conf,将会自动更新;如果通过编辑器,需要用refresh -s inetd 或 kill -1 InetdPID更新

136.           inetd可以自动启动ftpd, rlogind, rexecd, rshd, talkd, telnetd, uucpd进程,tftpd, fingerd, comsat需要人工启动,可以通过更改/etc/inetd.conf启动,可以通过lssrc –ls inetd检查

137.                                                             /etc/services记载通讯窗口,如果编辑了该文件,需refresh –s inetd

138.           用stopsrc –s inetd停止进程

139.           RPC启动将注册portmap进程, nfsd也是一个RPC SERVER

140.           用BC换算十进制到二进制

        bc

obase=2

195

11000011

141.           用BC换算二进制到十进制

        #bc

ibase=2

11001100

204

142.           私网地址

        Class A 10.0.0.0 to 10.255.255.255

Class B 172.16.0.0 to 172.31.255.255

Class C 192.168.0.0 to 192.168.255.255

143.           

#ifconfig lo0

lo0:

flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>.inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255

inet6 ::1/0



#lsattr -El lo0

netaddr 127.0.0.1 Internet Address True

state up Current Interface Status True

netmask Subnet Mask True

mtu 16896 Maximum IP Packet Size for This Device True

netaddr6 ::1 N/A True

prefixlen Subnet Mask True

144.           netstat –rn,ifconfig en0

145.           /etc/netsvc.conf

        hosts =bind,nis,local

         export NSORDER=bind,nis,local

         /etc/resolv.conf记录域名配置

         lssrc -s named

146.           检测域名服务:

        #nslookup 207.25.253.26

Server:dhcp001.itsc.austin.ibm.com

Address:9.3.240.2

Name:service.boulder.ibm.com

Address:207.25.253.26

#nslookup service.software.ibm.com

Server:dhcp001.itsc.austin.ibm.com

Address:9.3.240.2

Non-authoritative answer:

Name:service.boulder.ibm.com

Address:207.25.253.26

Aliases:service.software.ibm.com

147.           用smitty inet配置地址,不能用smitty mktcpip,第一次才用

148.           smit chgenet、chgtok

149.           no -o ipforwarding=1

150.           添加路由smit route or smit mkroute

         route add -net 192.168.1 -netmask 255.255.255.0 9.3.1.124

         跟踪一个路由:traceroute 192.168.1.1

151.           有三个:inet、inet6(Ipv6)、ns(Xerox Network Systems)可以使用ifconfig

alias 附加一个网络地址

delete 删除一个网络地址

detach 移动一个网络地址

down 激死一个网卡

mtu Val ue 设置IP的流量

netmask Mask 子网掩码

up激活一个网卡

152.           查看所有网卡状态:lsdev -Cc if

153.           查看激活网卡状态:ifconfig –a或单查一个ifconfig tr0

154.           激活网卡:ifconfig tr0 up

ifconfig lo0 127.0.0.1 up

ifconfig tr0 10.1.2.3 netmask 255.255.255.0 up

155.           激死网卡:ifconfig tr0 down

156.           删除一个网卡:ifconfig tr0 delete,但不会DOWN

157.           删除网卡IP:ifconfig tr0 detach

158.           附加一个地址:ifconfig tr0 10.1.2.3 netmask 255.255.255.0 alias这个命令不写入ODM中,重启后将丢失,除非加入/etc/inittab文件;再删除:ifconfig tr0 10.1.2.3 netmask 255.255.255.0 delete,删除时必须指定地址,否则默认删除主地址

159.           默认16MB的TOKINGRING的MTU为1492bytes,以太为1500bytes

160.           查看传输包

        #lsattr -El tr1

mtu 1492 Maximum IP Packet Size for This Device True

mtu_4 1492 Maximum IP Packet Size for 4 Mbit ring speed True

mtu_16 1492 Maximum IP Packet Size for 16 Mbit ring speed True

mtu_100 1492 Maximum IP Packet Size for 100 Mbit ring speed True

161.           变化MTU:ifconfig tr1 mtu 12000,如果在使用不能改变,而且在LAN都要改变

162.           ftpd、rexecd、telnetd属于信任进程,rshd、rlogind、tftpd属于不信任进程

163.           $HOME/.netrc的权限是600,最大4096 bytes.

164.            /etc/hosts.equiv 、$HOME/.rhosts,权限只能为600

165.           

toaster  允许toaster上的所有用户登录

machine bob  允许bob从machine上登录

+lester  允许lester从任意主机上登录

tron -joel

tron -mik

tron  允许tron上所有用户登录,但joel、mik需输入密码

-@forum   forum组所有成员禁止登录,netgroup是5L中的概念

166.           在/etc/security/config中加入:

        tcpip:

netrc =ftp,rexec /*functions disabling netrc */

然后执行killall

securetcpip,最后重启

167.           FTP在5L中:/usr/samples/tcpip/anon.ftp

168.           记录FTP的记录:编辑/etc/syslog.conf,加入daemon.info FileName

         refresh -s syslogd

        /etc/inetd.conf:ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd –l

         refresh -s inetd

        可以通过ps –fp PID查看

169.           uname   显示操作系统名

        uname –n显示主机名

        uname –x 显示操作系统名、主机名、The machine ID number of the hardware、The release number of the operating system、The operating system version、The system model name

170.           NFS:SERVER端:/usr/sbin/rpc.mountd,CLIENT端:/usr/sbin/mount,通过读/etc/xtab

SERVER端:/usr/sbin/nfsd     ,CLIENT端:/usr/sbin/biod

SERVER端:/usr/sbin/rpc.bootparamd

SERVER端:/usr/sbin/rpc.pcnfsd

/etc/networks、/etc/pcnfsd.conf、/etc/rpc、/etc/xtab

171.           smitty mknfs

172.           开始NFS:

        #mknfs -N

0513-059 The portmap Subsystem has been started.Subsystem PID is 23734.

Starting NFS services:

0513-059 The biod Subsystem has been started.Subsystem PID is 27264.

0513-059 The nfsd Subsystem has been started.Subsystem PID is 30570.

0513-059 The rpc.mountd Subsystem has been started.Subsystem PID is 28350.

0513-059 The rpc.statd Subsystem has been started.Subsystem PID is 15298.

0513-059 The rpc.lockd Subsystem has been started.Subsystem PID is 30976.

173.           NFS参数

        -B 立刻开始NFS daemons /etc/rc.nfs,并加入inittab

-I 加入inittab

-N立刻开始NFS daemons /etc/rc.nfs

174.           分别开始:startsrc -s nfsd

         全开始:startsrc -g nfs,查询lssrc -g nfs

         如果/etc/exports不存在,rpc.mountd将不能开始

        如果touch /etc/exports创建一个空文件,nfsd和rpc.mountd也可以开始

175.           smitty mknfsexp,如果不填写允许的CLIENT将默认每一个

        /usr/sbin/exportfs –a

         showmount -e HOSTNAME

         也可以通过编辑/etc/exports

176.           exportfs -i /dirname为临时输出一个目录

177.           Mount –v nfs      ,  /etc/vfs

178.           smitty rmnfsexp也可以exportfs -u dirname

179.           NFS MOUNT有三种:

        预定义的:在/etc/filesystems会记录

        直接的:临时的MOUNT

        自动的:用automount命令,/tmp/mount.map,/usr/samples/nfs

                lssrc -s automountd

                  /usr/sbin/automount -v /backup /tmp/mount.map

                  stopsrc -s automountd

                kill automountd_PID

180.           NFS需要存在一个MOUNT点

181.           smitty mknfsmnt,如果是BG在失败后会继续尝试

182.           smitty chnfsexp

183.           NFS命令:chnfs、mknfs、nfso、automount 、chnfsexp、chnfsmnt、exportfs、lsnfsexp、lsnfsmnt、mknfsexp、mknfsmnt 、rmnfs、rmnfsexp、rmnfsmnt

184.           List of NFS daemons

/usr/sbin/rpc.lockd 通过RPC的锁进程

/usr/sbin/rpc.statd 提供NFS的锁服务的crash-and-recovery功能

/usr/sbin/biod 发送读写请求

/usr/sbin/rpc.mountd 回应客户端的请求

/usr/sbin/nfsd 开始客户端的请求

/usr/sbin/nfsstat 显示机器接收的信息

/usr/sbin/portmap RPC端口图

/usr/bin/rpcgen 产生C编码执行RPC请求

/usr/bin/rpcinfo 报告RPC状态

/usr/sbin/rpc.rstatd返回执行统计

/usr/bin/showmount 显示MOUNT的系统

/usr/sbin/rpc.pcnfsd从PC-NFS端请求服务

185.           在CLIENT端执行/usr/bin/rpcinfo -p server_name可以检查

                        /usr/bin/rpcinfo -u CRoom mount

/usr/bin/rpcinfo -u CRoom portmap

/usr/bin/rpcinfo -u CRoom nfs

186.           nfsstat –c,nfsstat -s

187.           如果为hard-mount ,如出问题为:NFS server hostname not responding,still trying

         如果为soft-mount,如出问题为:Connection timed out

188.           如果传输BUFFRR不足,会报nfs_server:bad sendreply,通过smitty commodev增加

189.           如果rpc.mountd进程死掉可以:

1. Telnet to the server and log in as root.

2. cd to the /etc directory

3. Enter stopsrc -g nfs .

4. Enter stopsrc -s portmap

5. Enter rm -rf state sm sm.bak xtab rmtab .

6. Enter startsrc -s portmap .

7. Enter startsrc -g nfs .

8. Enter exportfs -a .

9. showmount -e servername.

190.           /etc/passwd 、/etc/security/passwd

组分为三种:用户组、系统管理员组、系统定义组(可用chsec 更改/usr/lib/security/mkuser.default

191.           常用命令:mkuser、passwd、chuser、lsuser、rmuser、chsec(改变安全描述)、login、who、dtconfig设置桌面自动开始的特征

192.           相关文件:

/etc/security/environ 包含用户的环境属性

/etc/security/lastlog 包含用户的最后一次登录描述

/etc/security/limits 用户的程序资源限制

/etc/security/user 用户的扩展属性

/usr/lib/security/mkuser.default 新建用户的默认属性

/usr/lib/security/mkuser.sys 定制新用户的帐目

/etc/passwd 用户的基本属性

   Name:Password:UserID:PrincipleGroup:Gecos:HomeDirectory:Shell,如果密码为*,表示还没登录过,如果为!表示密码在/etc/security/passwd,可以通过passwd or pwdadm添加密码 ,chfn 、 chsh

/etc/security/passwd 密码信息

/etc/security/login.cfg 登录配置信息和用户证明

/etc/utmp 用户的日志记录(who –a)

/var/adm/wtmp 连接时间记录

/etc/security/failedlogin 失败登录记录

/etc/motd 每一时间的日志

/etc/environment 所有进程的基本环境

HOME HOME路径

LANG 当前的场所名

NLSPATH 信息全路径

PATH 目录的顺序

LPDEST 打印

TERM 终端类型

EDITOR 默认编辑器

TZ 时区,改变时区需重新REBOOT

/etc/profile所有用户的附加环境

$HOME/.profile用户的环境设置

/etc/group 组的基本属性

/etc/security/group 组的扩展属性

193.           

histsize 定义密码的字数

histexpire 定义密码使用的周期

maxexpired 密码使用的最长时间

maxage 密码的最长寿命

minage密码的最短寿命

minlen 密码的最少数

minalpha 最少字母数

minother 最少的非字母数

maxrepeats 重复密码的最大数

mindiff 旧密码同新密码的最小相同数

194.           创建管理用户:mkuser -a smith

          更改SU属性:mkuser su=false smith

          创建普通用户:mkuser smith

195.           passwd -f smith

196.           chuser rlogin=true smith

         改变到期时间:chuser expires=1201080098 smith(1998年12月1日8点)

         chuser groups=programers smith

197.           

#lsuser -f -a id pgrp home root

root:

id=0

pgrp=system

home=/

198.           lsuser -c -a id home groups smith

         lsuser ALL

199.           rmuser smith

         rmuser -p smith,从/etc/security/passwd中也移掉

200.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics