第一部分、系统启动问题
cfgmgr : configures devices and optionally installs device software into the system
last : display all the previous logins and logoffs that still have entries in /var/adm/wtmp file
uptime : show how long the system has been up
要在maintenance mode作 installing new or updated software and running diagnostic checks
alog : trace the boot process and find out if sht went wrong,alog命令调用rc.boot脚本将启动信息导入/var/adm/ras/bootlog中
# alog -L 显示定义在alog Database中的logs
# alog -o -t 显示启动日志
cfgmgr命令:
在系统启动阶段,cfgmgr命令配置对使用系统必须的所有设备
系统启动包括两个阶段:
阶段一: cfgmgr –f 一旦系统启动就不能运行了
阶段二: cfgmgr –s ( second boot phase for normal boot )
阶段三: cfgmgr –p ( second boot phase for service boot )
# cfgmgr –i /usr/sys/inst.images 该命令尝试自动安装设备的软件 FOR 新检测到的设备
-I 选项指定安装的媒质在哪里
在此处有一个seq field ,该field 是一个整数指定了优先权,值越小,优先级越高,0的优先级最低,1的优先级最高
# cfgmgr –l scsi0 ( 配置检测到的连接到SCSI0适配卡的设备 )
-
如果你想查找root用户什么时候logged on and off from the console
# last root console
如果你想决定系统上次shutdown是什么时候
# last shutdown
为了显示一个启动列表
# bootlist –m normal –o
如果你想改变你的启动列表
# bootlist –m normal fd0 hdisk0 cd0
注意:加到bootlist的每一个设备必须处于Avalable的状态
如果你怀疑你的系统被shutdown或restarted,你可以使用uptime命令去查明,uptime命令显示系统已经运行了多长时间
# mpcfg –df To find out what the status is of your diagnostic flags
# mpcfg –cf 11 1 如果你想Fast IPL system,你可以改变diagnostic flag的值
注意: mpcfg 和 service information相关
shutdown
-v 或 –h Halt the operating system completely
-k Avoids shuting down the system
-m Bring the system down to maintenance mode
-I specifies interactive mode , Display interactive messages to guide the user through the shutdown
注意 : /etc/rc.shutdown文件由 /usr/sbin/shutdown script调用来关闭在关机的时候想中断的进程,该文件的必须是可执行的才能被正确调用
安装媒质有问题的征兆:
1、安装时意外挂起 2、 无法从介质读数据 3、意外重起
如果安装媒质没有问题的话,在你的系统中两个设备可能共享相同的SCSI地址
LED Error Code
LED 201 --- Damaged boot image
解决方法:
1、访问你的rootvg ( 进入 system maintenance 模式 )
2、检查 / 和 /tmp文件系统,看看他们是否已经满了,如果是创建更多的空间
3、决定 bootdisk 通过用命令 lslv –m hd5
4、重新创建 boot image 使用 bosboot –a –d /dev/hdisk0
5、检查 CHECKSTOP errors in the error log , 如果这样的错误发现的话可能是失败的硬件
6、关机 重起
LED 223-229 --- Invalid boot list
1、决定启动磁盘 lslv –m hd5
2、创建新的bootlist 使用 bootlist命令
LED 551,555,and 557 --- Errors Including corrupted file system and corrupted JFS log
1、进入维护模式 access rootvg before mounting and file system
2、fsck –y /dev/hd1
fsck –y /dev/hd2
fsck –y /dev/hd3
fsck –y /dev/hd4
fsck –y /dev/hd9var
3、再次Format the JFS log
/usr/sbin/logform /dev/hd8
4、使用 lslv –m hd5 去决定 boot disk
5、重新创建boot image
bosboot –a –d /dev/hdisk0
LED 552,554,and 556 --- Super block corrupted or corrupted customized ODM database
Fsck
1、Repeat steps 1 and 2 for LEDs 551 555 and 557
2、If fsck inidicates that block 8 is corrupted, the super block for the file system is cororupted and needs to be repaired , Enter the command :
Dd count=1 bs=4k skip=31 seek=1 if=/dev/hdn of=/dev/hdn
3、rebuild your JFS log by using the command :
/usr/sbin/logform /dev/hd8
4、if this solves the problem, stop here ; otherwise ,continue with step 5
5、Your ODM database is corrupted ,restart your system and 进入 maintenance mode
6、Mount the root and usr file system
Mount /dev/hd4 /mnt
Mount /usr
7、copy system configuration to a backup directory
mkdir /mnt/etc/objrepos /backup
cp /mnt/etc/objrepos/Cu* /mnt/etc/objrepos /backup
LED 553 --- corrupted /etc/inittab file
1、进入系统维护模式
2、检查 / /var /tmp 使用 df命令
3、检查 /inittab文件
4、检查 execution problems
/etc/environment
/bin/sh
/bin/bsh
/etc/fsck
etc/profile
/.profile
5、shutdown and reboot
第二部分、硬件相关
为了列出系统中的磁带(盘),使用 # lsdev –C –c tape(disk)
列示在预定义ODM数据库中的设备 # lsdev –P –H
列示在定制定义ODM数据库中的设备 # lsdev –C –H
# lspv 显示在系统中的每一个PV along with its physical disk name ,PVID,and with VG it belongs to.
# lspv pvname 仅仅显示该PV的信息 eg: # lspv hdisk0
# lspv –p hdisk0 列示 range , state , region , LV name , type , and mount point for each PP on the PV
cfgmgr 配置设备在软件层
SMS检查和配置系统在硬件层
如何进入SMS:
1、关机
2、如果需要的话插入 SMS 软盘 ,启动机器
3、Press F1 得到一个图形化的 SMS菜单或 Press F4去得到一个ASCII SMS菜单
( 要眼疾手快 )
你可以改变访问的口令在SMS菜单,从而只有授权的人才可以访问SMS工具,但如果你忘了这个口令,唯一的解决方法是给主板放电(将电池拿掉)
当显示一个定制设备的有效属性时,信息的获得是从 Configuration daabase 而不是设备本身,一般来说,chdev with –P or –T flag 将刷新设备的配置,如果没有的话,lsattr 命令显示设备的信息有可能是不准确的,一直到重起后
· # lsattr –El rmt0 显示磁带的当前的属性
· # lsattr –l rmt0 –D 显示磁带默认的属性
· # lsattr –l scsi0 –a bus_intr_lvl –E
· # lsattr –l tty0 –a login –R To list possible values of the login attribute for the TTY device tty0
# smitty devices 该命令可以使用smit菜单
1、安装或配置设备(在IPL之后)
2、删除设备
3、列示存在的设备
4、改变或显示设备的属性
5、执行设备相关的问题的决定
# /usr/lib/errdemon 启动errdemon
# /usr/lib/errdemon –l 决定系统错误日志文件的路径
# errpt 产生错误报告 # errpt –a # errpt –a –s 0828093001
# errpt –a –j AA8AB241(最后为 error identifier )
# errloger 命令允许你记录管理员的信息到系统错误日志中
# diag 执行硬件问题诊断
AIX使用syslogd记录系统的信息,在这里有一个/etc/syslog.conf配置文件,该文件控制syslogd进程的行为,系统日志应该被升级通过编辑/etc/syslog.conf文件,在你编辑并增加了条目在/etc/syslog.conf文件,你需要重新启动syslogd进程
# smitty tty 增加一个TTY
第三部分、系统和软件的安装
为了安装BOS,应该启动系统进入Maintenance mode
三种安装方法的区别:
(1)New and Complete Overwrite Installation
情形一、一台新的机器
情形二、你想安装到那个硬盘(包含在一个已经存在的卷组)你想完全覆盖掉,或者rootvg已经损坏
情形三、你想重新分配你的硬盘,使你的rootvg更小,分配少些磁盘空间给它
安装后要使用 Configuration Assistant application手工配置系统相关设置,该程序也可以手工运行,/usr/sbin/install_assist
(2)Migration Installation (升级安装)
使用该安装方法去升级AIX 3.2 4.1 4.2 4.3 To AIX 5L Version 5.1 升级时保留了已经存在的rootvg卷组,除了/tmp,该方法保留了所有的文件系统,包括rootvg,lv和系统配置文件,同时保留了用户配置文件。
(3)Preservation Installation
该方法覆盖了/usr , /tmp, /var, 和 / 文件系统,在这些目录中任何用户数据将丢失,任何其他的LPP和Filesets将会丢失,系统配置将重做在安装结束后
有一个 /etc/preserve.list文件,在该文件中的条目将会被保留
# bootinfo –y 标示系统硬件的类型 ( 32bit或64bit )
oslevel 的运行
# oslevel ( to see the current maintenance level of your system )
4.3.3.0
软件的组成以及各部分的含义
vv.rr.mmmm.ffff
vv : 两个数字 标示 version number
rr : 两个数字 标示 release number
mmmm: 四个数字 标示 modification lever
ffff: 四个数字 标示 fix level
在升级后,oslevle后,如果你的系统没有显示出新的维护层,使用
After an update, if your system is not showing the new maintenance level . use the –l flag with the oslevle command to detemine what filesets have note been upgraded to match the new BOS levle
# oslevle –l < Current Level 〉去决定还有什么filesets没有被升级到新的BOS Level
PTF and APARs
PTF : Program Temporary Fix , a PTF is an updated fileset or a fileset that fixes a previous system problem
PTF 的安装是使用 installp 命令
APAR: Authorized Program Analysis Report , An APAR is an emergency fix. Or e-fix . to a unique problem on the system , APARS will eventually become PTFs after tesing and verification.
APAR 的安装是使用 instfix 命令
Installp命令
-X 如果在安装过程中空间不够将扩展文件系统
-v 在安装结束后确认在文件集中的所有安装的文件备正确地检查过。可以同-a 和 –ac一起使用来确认一个成功的安装。
-a 应用一个或更多的软件产品或升级,该参数是默认的行为,该参数可以和 –c 一起使用来apply 和 commit一个软件的升级或安装
-p 执行一个安装预览,运行预安装的所有检查
-B 表示请求的行为被限制到软件的升级
-C 清除一个中断的安装和删除所有没有完成的安装
-c commit applied的升级到系统
-d 指定安装媒质
-F 强迫安装,无论是否存在,是否新旧
-f read the names of the software products from listfile
g 当用来install和commit的时候, 该选项自动安装或commit,
软件可以以两种方式进行安装:
applied state: 该状态安装软件到系统同时保留以前版本的软件 ,该状态是非常有用来测试新的软件,在有必要的时候可以返回到以前版本的软件
committed state : 安装软件同时删除以前的软件
例如:
1、安装在 bos.net软件包中的所有的filesets 到 /usr/sys/inst.images目录( in the applied state)
Installp–avX –d/usr/sys/inst.images bos.net
2、预安装在bos.net软件包中的所有的文件集到/usr/sys/inst.images目录( In the committed state )同时检查磁盘空间的需求
3、清除一个中断的安装和删除所有没有完成的安装
# installp –C
4、committing applied updates 命令: # installp –cgx all 或者是 smitty install_commit
这个命令将commit所有的updates同时删除以前版本的filesets
5、Rejecting applied updates 命令 # installp –rBfX ./reject.list或是smitty install_reject
该命令将删除所有uncommitted updates listed in ./reject.list 同时将系统带回到以前的maintenance level
6、删除一个安装的软件 # installp –ugp –V2 bos.net.ipsec.rte 运行该命令将显示一个将要删除的文件的列表,但并不真正删除它 或是 # smitty install_remove
7、列示在媒质上的所有的软件
# installp –L –d /dev/cd0
8、使用smitty安装软件 # smitty install_latest
注意: 在安装结束后,无论命令的状态报告是成功的还是失败的,都应该看看 $HOME/smit.log文件,因为你想安装的fileset系统可能并没有安装
A version number and a release number : 标示 release level
A modification level and a fix level number : 标示 the level of the update
用下面的步骤使一个系统升级到最新的maintenance level:
1、列示软件的 maintenance level
2、下载 fixs
3、显示并升级安装的软件到最新的level
为了看你当前运行的filesets的maintenance level ,使用下面的命令:
# lslpp –l
为了display all files installed with the bos.64bit fileset
# lslpp –f bos.64bit
为了显示filesets安装和升级的历史 : # lslpp –h bos.sysmgt.trace
下载 FIXs :
1、
2、通过fixdist的工具 访问:
通过fixdist 下载的软件BFF的格式的,是用backup命令创建的,如*.bff,可以用restore命令来读。
如果你经常应用升级并将所有的升级软件放在相同的目录中,.toc文件可能会过期,installp命令使用.toc文件来执行安装,为了当你执行安装的时候使正确并最新的软件安装,推荐重构.toc文件,命令如下:
# inutoc ; 还有一个 inutoc /usr/sys/inst.images/.toc
该命令在运行installp的时候自动调用
你可以使用fixdist工具下载个别的fix,为了决定一个fix是否安装在系统上或为了安装一个fix,使用instfix命令( 和fix有关)
instfix命令允许你安装一个fix或set of fixes without knowing any information 除了APAR号或唯一的关键字来标示这个fix
例一:为了列示在一个CD-ROM中的fixes
# instfix –T –d /dev/cd0
例二:为了决定是否APAR IX75893安装到系统
# instfix –ik IX75893
例三:To examine information about APAR IX75893 and what it does
# instfix –aik IX75893
例四:To list what maintenance levels have been installed on your system with the instfix command
# instfix –i | grep ML
例五:为了从/dev/cd0安装APAR IX75893
# instfix –k IX75893 –d /dev/cd0
例六:To view the new maintenance level of your software
# lslpp –l 主要还是显示 fix level
this will show you the latest maintenance level of the filesets including those you just updated
为了创建installation images on your hard disk
# smitty bffcreate
为了克隆rootvg到一个新的磁盘 # smitty alt_clone
条件: The target disk should be a stand-alone disk not belonging to a VG,同时,SSA disks cannote be used as your target disks
第四部分: ODM
大多数的系统 object classes 和 objects存储在/usr/lib/objrepos目录,然而,ODM信息存储在
1、/usr/lib/objrepos
2、/usr/share/lib/objrepos
3、/etc/bojrepos
ODM的相关命令:
odmadd: add objects to an boject class
odmcreate: create empty object classes
odmchange: change specific objects in a specified object class
odmdelete remove objects from an boject class
odmdrop remove an entire object class
odmget retrives objects from object classes
odmshow display the description of an object class
第五部分:存储管理和文件系统
VGDA:
The VGDA, located at the beginning of each physical volume,contain informatino that describes all the logical volumes and all the physical volumes that belong to the volume group of which that physical volume is a memober
The VGDA is allocated when the disk is assigned as a physical volume,When the PV is assigned to a VG ,The actual VG informationg is placed in the VGDA
VGSA:
The VGSA contains state information about PP and PV
LVCB:
The LVCB is located at the start of every LV , It contains information about the LV and users a few hundred bytes
Disk Quorum:
Each Physical disk in a VG has at least one VGDA/VGSA,
single PV in a VG: two VGDAs on one disk
two PV in a VG: two VGDAs on the first disk, one VGDA on the second disk
Three or more : one VGDA on each disk
Disk Mirroring :
disk mirroring is the association of two or three PP with each LP in a LV,在LV创建的时候就可以做Mirroring 。
mklv 命令允许你选择 one or two additional copied for each LV,Mirror也可以加在一个已经存在的LV,通过使用mklvcopy命令
mirrorvg命令镜像在一个给定VG中的所有的LV,相同的功能可以被完成通过mklvcopy命令,如果在一个VG中运行mklvcopy命令for 每一个单独的LV,注意此处就是目标磁盘必须和源磁盘等等在同一个VG中
例一:# mirrorvg -c 3 workvg 三重镜像一个卷组
例二:# mirrorvg workvg 以默认的方式镜像卷组
为了删除一个卷组中已经损坏的磁盘:
# unmirrorvg workvg hdisk7
# reducevg work hdisk7
# remdev -l hdisk7 -d
删除后添加一个新的磁盘(以同样的名称)
# extendvg workvg hdisk7
# mirrorvg workvg
同步新建的镜像
# mirrorvg -S -c 3 workvg
注意:在这个例子中,mirrorvg 将创建两个copy for the LV in workvg,他将创建新的镜像在新替换的磁盘上,但如果原来的系统被三重的镜像的话,将没有新的镜像创建在hdisk7上,因为其他的copy已经存在
为了创建一个卷组精确的映射
# mirrorvg -m datavg hdisk2 hdisk3
当rootvg mirroring完成后,下列的任务必须做:
一、运行bosboot命令 ( 从RAM磁盘文件系统和内核创建一个boot image )
二、运行bootlist命令
三、reboot system( 默认情况下,mirrorvg命令使quorum to be turned off, 为了 turn on the quorum on a rootVG,系统必须重启)
注意: 不要reboot 系统当 bosboot命令没有成功创建一个boot disk的时候
非rootvg的 mirroring:
当一个非rootvg的卷组被镜像时,the quorum state is deactivated,为了解决这个问题,all open LV must be closed, 然后vary off and vary on the VG for the changes to take effect
The dump device can be queried and modified with the sysdumpdev command
有三种方法用来配置一个新的disk ,如果你的LVM想用这磁盘的话,同时还必须做成一个PV
方法一:shutdown 然后Power on
# lspv 的输出结果中如果对应的hdiskx有PVID,说明该hdisk已经是PV了,可以被LVM使用,但如果没有PVID的话,就要使该disk成为PV
方法二:手工运行cfgmgr
一个新的磁盘只有被分配给一个VG才可以使用,必须作为一个PV才可以被LVM使用
相应命令: chdev -l hdisk1 -a pv=yes
The following command is used to turn off the allocation permission for the PV hdisk1
# chpv -a n hdisk1
To turn the allocation permission back on .use the following command
# chpv -a y hdisk1
当一个PV由于损坏要被从该系统删除时,该PV should be made unavailable :
# chpv -v r pvname
The following command will make a PV available to the system
# chpv -v a pvname
注意:当运行chpv命令失败了的时候,检查/tmp的空间
A PV must be unconfigured before it can be removed from the system,The following example shows how to unconfigure a PV and change its state from available to defined
# rmdev -l hdisk1
该PV的定义仍然保留在ODM中,使用 -d 将 remove the definition from the ODM
List PV on the system # lspv
List PV on the system along with the status of each PV # lspv -C -c disk
List PV characteristic # lspv hdisk1
List all the LV on the PV # lspv -l hdisk1
List PP allocation by PV region # lspv -p hdisk1
List PP allocation table # lspv -M hdisk1
下列的过程描述了如何从一个failing disk移出数据 before it is removed for repair or replacement
1、首先确定source and destinatino PV are in the same VG
# lsvg -p rootvg
2、a、make sure the disk is available
# lsdev -Cc disk
b、if the disk is listed and in the available state , make sure it does not belong to another VG
# lspv
c、if the disk is not listed or is not available,you need to check or install the disk
d、add the new disk to the Vg
# extendvg VGNAME hdisknumber
3、确定目标磁盘有足够的空间可以容纳源盘的内容
4、如果准备移动的数据所在的磁盘属于rootvg:
a、检查是否 boot logical volume(BLV)也就是hd5在 sourec disk中
# lspv -l sourcedisknumber | grep hd5
如果在的话: # migratepv -l hd5 SourceDiskNumber DestinationDiskNumber
注意: migratepv命令cannot migrate striped LV ,if htis is the case , to move data from one PV to another,use the cplv命令 to copy the data,and then use the rmlv command to remove the old copy
migratepv command is not allowed if the VG is varied on in a concurrent mode
b、在目标磁盘上执行bosboot命令
当BLV is migrated from a PV ,the boot record on the source should be cleared ,Failure to clear this record may result in a system hang
c、在源磁盘上执行bosboot -c命令 to clear the boot record on the source
# bosboot -a -d /dev/DestinationDiskNumber
# bootlist -m normal DestinationDiskNumber
# mkboot -c -d /dev/SourceDiskNumber
5、如果你要移动的数据所在的磁盘属于用户定义的卷组
# smitty migratepv
To remove source disk from the Vg ,such as when it is failing
# reducevg VGNAME SourceDiskNumber
在物理的卸掉Source disk之前,运行
# rmdev -l SourceDiskNumber -d
创建一个新的VG ,# mkvg 或 # smitty mkvg
当使用mkvg创建VG的时候,root filesystem 至少需要2MB的Free space才能够保证VG成功创建
To make a VG to be varied on automatically each time a system is restarted
# chvg -ay newvg
Turn off the automatic varying on of the VG at system restart
# chvg -an newvg
Unlock a Vg
# chvg -u newvg
Add the PV hdisk3 to Vg newvg
# extendvg newvg hdisk3
The Vg must be varied on before it can be reduced
# reducevg myvg hdisk3
Remove a PV reference
# reducevg VG PVID
To remove the system definition of a VG from the ODM database,the VG need to be exported using the exportvg command,This command will not remove any user data in the VG ,but will only remove its definition from the ODM database
# exportvg myvg
# importvg –y myvg hdisk12
你也可以使用exportvg 和importvg来给一个用户定义的卷组改名
# varyoffvg vg00
# exportvg vg00 (导出前要先varrry off)
# importvg –y cadsvg hdisk1
A VG that has a paging space volume on it cannot be exported while the paging space is active
在导出一个包含活动的paging space的卷组的时候,首先:
# chps –a n paging_space_name
然后重起系统,从而该paging space处于inactive的状态
if you don’t activate the VG that contains file systems, or if you activated the VG through smitty importvg,It is highly recommended that you run the fsck command before you mount the file systems, if you are moving the VG to another system,be sure to unconfigure the disks before moving them
The smitty exportvg command deletes references to file system in /etc/filesystems,but it leaves the mount points on the system
激活一个卷组:
# varyonvg newvg
Deactivate a Vg (The varyoffvg command will deactivate a VG and its associated LV,This requires that the LV be closed ,which requires that file systems associated with LV be unmounted,)
# varyoffvg myvg
List all the Vg known to the system
# lsvg
List the Vg that are currently active
# lsvg –o
List the characteristics of a VG
# lsvg rootvg
List the LV in a VG
# lsvg –l rootvg
List the PV status within a VG
# lsvg –p rootvg
使用reorgvg命令的两个必要的条件:
1、VG must be varied on
2、Must have free partitions
The relocatable flag of each LV must be set to y using the chlv –r command for the reorganization to take effect,otherwise, the LV is ignored
注意:对于LV的relocatable必须用chlv -r设置成 y ,reorgvg命令对含条带集的逻辑卷无效,同时在该卷组中至少包含一个自由的物理分区
To synchronize the copies on PV hdisk04 and hdisk05
# syncvg –p hdisk04 hdisk05
To synchronize the copies on VG vg04 and vg05
# syncvg –v vg04 vg05
# mklv newlv 创建逻辑卷
# rmlv newlv 删除逻辑卷
# extendlv newlv 3 扩展该逻辑卷的逻辑分区(增加了3个LP)
使用cplv命令来拷贝一个逻辑卷到另外的新的磁盘或已经存在的逻辑卷
# cplv –v myvg –y newlv oldlv 该命令将拷贝oldlv的内容到一个新的逻辑卷newlv ,如果卷组没有指定的话,该命令将在相同的卷组中创建一个新的逻辑卷
拷贝一个逻辑卷的内容到一个已经存在的逻辑卷(existinglv卷组中的数据将被覆盖)
# cplv –e existinglv oldlv
如果卷组is varied on in concurrent mode的话,使用cplv命令来创建一个新的LV将失败
# splitlvcopy –y newlv oldlv 2 (以前的oldlv的一个LP对应三个PP)
该命令执行后:
oldlv的一个LP对应两个PP
newlv的一个LP对应一个PP
Before splitting LV ,You must unmount file system and close the LV
下列的LV在系统安装的时候自动创建
hd5 :This is boot logical volume that holds the boot code, it is available only at system startup time
hd6: This is the default paging space logical volume that is used by the system to perform paging.
hd8 : This LV is used as the default logging space for the JFS,一个分区,4MB
hd2 : This LV is used by the /usr file system
hd4 : This LV is used by the / root file system
hd9var : This LV is used bye the /var file system
hd3: This LV is used by the /tmp file system
hd1 : This LV is used by the /home file system
# lslv newlv
每一个文件系统都对应一个LV
创建一个文件系统
# smitty crjfs
在加载文件系统的时候一个常规的错误是无法使用pwd命令,通过设置加在点目录的权限至少为111可以解决这个问题
有两种类型的automatic mounting
第一种:Those mounts that are required to boot and run the system,These file systems are explicitly mounted by the boot process. The stanzas of such file systems in the /etc/filesystems file have mount=automatic,
注意:
如果在/etc/filesystems文件中有定义且mount=automatic,则这些文件系统将不受mount all 和umount all 命令的影响
类型二:
The second type of automatic mount is user-controller,These file systems are mounted during initialization by the /etc/rc script when it issues the mount all command, The stanzas of user-controller automatic mounts contain mount=true in /etc/filesystem
显示当前所有加载的文件系统
# mount
如果想删除一个文件系统,首先要umount it
# umount filesystem_name
然后 # rmfs –r filesystem_name或使用 # smitty rmjfs
使用df命令显示当前文件系统的大小
使用mksysb去减小一个文件系统的大小
在通过mksysb来恢复rootvg卷组的过程中,一个选项就是 shrink在磁盘上安装的文件系统,当选中这个选项时,在该卷组的LV和FS将按照容纳数据的最小尺寸来重新创建LV和FS
用户定义的卷组也可以通过 # restvg –s 来调用这个shrink的选项。
在加载文件系统之前运行fsck,同时必须能够读the device file on which the file system reside
The logform command initializes a LV for use as a JFS log device
运行该命令在一个文件系统上将完全破坏该文件系统上的数据,if a log device is open due to its use by a mounted file system, the file system should be unmounted prior to running logform against the log device
Troubleshooting file system problems
1、Recovering from super block errors
If you receive one of the following errors from the fsck or mount commands,The problem may be a corrupted superblock
This problem can be resolved by restoring the backup of the superblock over the primary superblock using one of the following commands
dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00
The follow command works only for Aix version 4
fsck –p /dev/lv00
当恢复的进程结束后,使用 fsck /dev/lv00,在一般情况下,restoration of the backup of the superblock to the primary superblock will recover the file system ,if this does not resolve the problem, recreate the file system and restore the data from a backup
2、Cannot unmount file systems
情形一:、file are open within a file system
The fuser command is often the best way to determine what is still active in the file system,
# fuser –xc /tmp
情形二:A kernel extension that is loaded but exist within the source file system,此时fuser命令将无法显示kernel extension,通过genkex命令则可以显示
情形三:在该文件系统中仍然由文件系统处于加载的状态
情形四:一个进程正在使用该文件系统中的一个目录作为它当前的工作目录
第六部分: Paging space
Paging space 的大小在AIX安装系统定制的时候,要根据下列标准:
1、Paging space can use no less than 16MB,except for hd6,In AIX version 4.2.1,hd6 can use no less than 32 MB ,and in AIX Version 4.3 and later,no less than 64MB
2、Pagin space使用的空间不能超过总磁盘空间的20%
3、如果真实的物理内存小于256MB的话, Paging space is tow times real memory
4、if real memory is greater than or equal to 256MB, Paging space is 512MB
或者使用公式:Total paging space=512+(memory size-256)*1.25
理想情况下,There should be serveral paging spaces of roughly equal size each on a different physical volume
可以利用vmstat和topas这两个命令来获得Paging space的状态
# lsps -a 提供 a snapshot of the current utilization of each of the paging spaces on a system
# lsps -s 提供 a summary of the total active paging space and its current utilization
注意:避免增加paging space到一个便携式的硬盘上
Remove a disk that is online with an active paging space will require a reboot to deactivate the paging space and , therefore ,cause user disruption.
注意: In version prior to AiX 5L version 5.1,A VG that has a paging space volume on it cannot be varied off or exported while the paging space is active,Before deactivating a VG having an active paging space volume,ensure that the paging space is not activated automatically at system initialization and then reboot the system.
管理paging sapce的相关命令:
chps : change the attributes of a paging space
lsps: Display the characteristics of a paging space
mkps: creates an additional paging space
rmps: remove an inactive paging space
swapon: Activates a paging space
swapoff : Deactivates one or more paging space
考点: Active paging space cannot be removed .To remove an active paging space ,it must first be made inactive
在AIX version to AIX version4.3 ,使用chps命令 so the paging sapce is not used on the next system restart,Then restart the system,此时,The paging space is inactive and can be removed using the rmps cmmand, IN Aix version 5.1 ,使用swapoff命令去动态deactivate the paging space,Then use the rmps command
# swapon -a
Deactivate a paging space
AIX 5.1 deactivate a paging space and to decrease the size of a paging space without having to reboot
# swapoff DeviceName or # smitty swapoff
在AIX 4.3中:
# smitty chps ---->;>;reboot ----->;>; lsps -a
Decreasing the size of a paging space
AIX 5.1
# chps -d 2 paging03 不需要deactivate ,不需要reboot,
AIX4.3中
# 要deactivate it--->;>; reboot ---->;>; remove it --->;>; recreate it
如果要删除一个paging space
注意: remove default paging space incorrectly can prevent the system from restarting,You must deactivate the paging space before you can remove it , which require a reboot
check the primary dump device you are using by executing the command
# sysdumpdev -l
you cannot remove the default dump device,you must change the default dump device to another paging space or LV before removing the paging space
删除一个paging space ( except hd6 )
deactivate it--->;>; reboot ---->;>; remove it
如果在AIX 5L中
# swapoff /dev/paging00
# rmps paging00
管理默认的 paging space ( hd6 )
1、减小 hd6 paging space的大小 (在 AIX4.3或之前的版本 )
注意: 在AIX4.2.1 and later does not support reducing the size of hd6 below 32MB
第一步:mkps -a -n -s 30 rootvg hdisk0 (创建一个临时的paging sapce)
第二步:chps -a n hd6 ( deactivate the hd6 )
第三步:将 /sbin/rc.boot中的 swapon /dev/hd6改成 swapon /dev/paging00
第四步:sysdumpdev -l ( check the primary dump device designation)
第五步:sysdumpdev -P -p /dev/paging00 (change the primary ……to paging00
第六步:bosboot -d /dev/hdisk -a ( Create a bootable image
第七步:shutdown -r
第八步:rmps hd6
第九步:mklv -t paging -y hd6 rootvg 30
第十步:sysdumpdev -P -p /dev/hd6
十一步:在/sbin/rc.boot文件中将 ……改成 swapon /dev/hd6
十二步:bosboot -d /dev/hdisk0 -a
十三步:chps -a y hd6
十四步:chps -a n paging00
十五步:shutdown -r
十六步:rmps paging00
减小hd6 (在 AIX 5.1 )
# chps -d
Moving a paging space with the name hd6 from rootvg to another VG is not recommended because the name is hard-coded in serveral places
移动 hd6 paging space在相同的卷组中不需要重新启动系统
# migratepv -l hd6 hdisk0 hdisk1
第七部分:System Backup ,restores and availability
使用tctl命令控制磁带机
mksysb : create an installable image of the rootvg either in a file or onto a bootable tape
-e Excludes files listed in the /etc/exclude.rootvg file from being backup up
-i Call the mkszfile command , which generates the /image.data file automatically during a backup
-m Call the mkszfile command to generate map files
savevg : The savevg command saves non-root VG
The mksysb command creates a bootable image of all mounted file systems on the rootvg
The tape format include a BOS boot image ,a BOS install image and a dummy table of contents(TOC)follow by the system backup(rootvg)
用户定义的卷组和裸设备不能用mksysb来备份
The BOS boot image contains a copy of the system's kernel and device drivers needed to boot from the mksysb tape,It is created by the bosboot command
There are three important files in the mkinsttape image:
./tapeblksz contains the block size
./bosinst.data allow you to specify the requirements at the target system and how the user interacts with the target system
./image.data contain information describing the image installed during the BOS installation process,This information includes the size,names ,maps,and mount points of logical volumes and file systems in the rootvg
# mksysb -i 产生一个新的image.data on the tape during a backup( mkszfile命令产生的image.data)
The mksysb commmand creates a bootable image of the rootvg file system either in a file system directory onto a bootable tape,an is used to restore a system after a system failure or for system cloning
# savevg -if /dev/rmt0 uservg
使用tar备份目录:
进入该目录,运行: # tar -cvf /dev/fd0 *
使用backup备份目录:
进入该目录,运行: # find . -print ( or -depth ) | backup -i -f /dev/rmt0 (相对的路径)恢复时使用restore
使用cpio备份目录:
# cd /
# find /userdirectory -print | cpio -o -c -v -B >; /dev/rmt0 (恢复时使用cpio -i) (绝对的路径)
增量备份:
# backup -0 -uf /dev/rmt0 /home
# backup -1 -uf /dev/rmt0 /home
对于磁带机:
Rewind the tape to the beginning by using the following
# tctl -f /dev/rmt0 rewind ( mt 也可以 )
显示在一个备份的媒质上的内容
# restore -T -d -v -q -s4 -f /dev/rmt0.1
恢复一个文件:
# restore -x -d -v -q -s4 -f /dev/rmt0.1 ./etc/hosts
# tar -xvg /dev/rmt0 /etc/hosts
# cpio -i -c -v -d -u -m -B < /dev/rmt0 "/etc/hosts" (注意多了一个 -d )
The following shows how to restore the file /etc/hosts from a backup that was made using the -i flag option during a backup by file sytem , notice the -d flag is used to restore the file
# restore -x -d -v -q -f /dev/rmt0 /etc/hosts
The following shows how to restore the file /etc/hosts when a file system backup was used to make the backup
# 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 -xvf /dev/rmt0 /var/dt
# cpio -i -c -v -d -u -m -B < /dev/rmt0 "/var/dt/*"
考点: 一个典型的错误发生在磁带和系统之间移动数据的时候,是因为不正确的 Block size
使用 # tcopy /dev/rmt0 来决定 tape block size
# dd if=/dev/rmt0 bs=128k count=1 | wc -c 来决定 tape block size
改变 tape block size 使用 # chdev -l rmt0 -a block_size=512
复制磁带: # tcopy /dev/rmt0 /dev/rmt1
创建一个软盘的copy:
# dd if=/dev/fd0 of=/tmp/ddcopy
# dd if=/tmp/ddcopy of=/dev/fd0
第九部分: SRC
启动SRC:
涉及到一个 /usr/sbin/srcmstr 进程,Remove the srcmstr daemon from the /etc/inittab file would cause these startsrc command to fail
Make a record for the srcmstr daemon in the /etc/inittab file using the mkitab command
# mkitab -i fbcheck srcmstr:2:respawn:/usr/sbin/srcmstr
#telinit q
The syslogd daemon read the /etc/syslog.conf configuration file when it is activated or when it receives a hangup signal
If you decide to capture the warning messages from all users int hte /var/spool/syslog file,
1、 .warning /var/spool/syslog (在 /etc/syslog.conf中加入相关信息 )
2、 touch /var/spool/syslog ( 创建该文件 )
3、 chmod 666 /var/spool/syslog ( 改变权限使所有的用户都可以写信息到该文件 )
4、 refresh -s syslogd
安装skuler command只需要将/var/spool/cron/crontabs/root文件中的注释去掉
第十部分: Newwork adminsitration
At IPL time, the /init process will run /etc/rc.tcpip after starting the SRC
The script /etc/tcp.clean can be used to stop TCP/IP daemon, It will stop some daemons and remove the /etc/locks/lpd TCP/IP lock file
Note that the /etc/tcp.clean does not stop the portmap and nfsd daemons ( 要使用stopsrc 和 startsrc )
该命令调用方法: # sh /etc/tcp.clean
注意:不要使用 # startsrc -g tcpip 来启动TCP/IP daemons(它将同时启动routed和gated)
Remove the rc.tcpip条目在/etc/inittab中将在IPL阶段不会启动任何 server application,如果使用的图形终端,一定要确认删除了rc.dt和rc.tcpip条目,否则系统将挂起
Inetd进程调用了inet.conf文件,如果使用smit改变该/etc/inetd.conf的话,inetd进程自动refresh,如果使用vi来更新的话,则要使用refresh -s inetd 或者是 kill -l inetdPID来手工刷新
subserver controlled by inetd in the inetd.conf文件
# lssrc -ls inetd 列示启动的subserver
When the inetd daemon is stopped, The previously started subserver processes are not affected , However , new service requests for the subservers can no longer be satisfied,此时,就不能telnet 或 ftp了
如果Inetd进程停止,已经存在的session将不会受到影响,但不会产生新的session
The protmap daemon converts remote procedure call (RPC) program numbers into Internet port numbers
When an RPC server starts up , it registers with the portmap daemon
Since standard RPC servers are normally started by the inetd daemon,The portmap daemon must be started before the inetd daemon is invoked
注意: if the portmap daemon is stopped or comes to an abnormal end,all RPC servers on the hosts must be restarted, The nfsd is a common RPC server
The default order in resolving host names is : 1、 BIND/DNS (named) 2、NIS 3、/etc/hosts
通过创建/etc/netsvc.conf文件可以改变该顺序
通过设置NSORDER变量可以改变默认的和/etc/netsvc.conf文件中的顺序,NSORDER的优先级最高
一个/etc/resolv.conf的例子:
# cat /etc/resolvl.conf
nameserver 9.3.1.12
domain itsc.ibm.com
search itsc.ibm.com itse.ibm.com
确认named进程的状态: # lssrc -s named
插入一块新的网卡后需要的配置步骤:(基于硬件的配置)
1、必要的话重新调用cfgmgr命令来加载硬件
2、smitty devices安装驱动软件
3、# diag -a 确认新的网卡已经加入到硬件配置中了
4、再次运行cfgmgr
5、# lsdev -cl ent0 确认该网卡处于available的状态
6、使用 # smitty inet来配置nework interface,不要使用smitty mktcpip,It is used for configuration TCP/IP for the first time
To change advanced feature of network adapters
# smitty chgenet
To configure TCP/IP
# smitty tcpip
To change/show Characteristics of a nework interface
# smitty chinet
Enable IP forwarding:
no -o ipforwarding=1
配置IP地址: # smitty mktcpip
Identify network interface on your server
# lsdev -Cc if
This will list of all interfaces on the system,whether they are being actively or not
或者使用 # ifconfig -a
This will produce a list of all network interfaces on the system that have ip addresses and are actively
To get information about one specific network interface
# ifconfig en0
To activate a network interface
# ifconfig tr0 up
# ifconfig tr0 10.32.1.1 netmaski 255.255.255.0 up (同时分配一个IP address)
To deactivate a network interface
# ifconfig tro down
To delete an address from a network interface
# ifconfig tro delete ( this command does not place the interface in the down state,nor does it remove the interface from the work interface list )
To remove the interface tro from the network interface list
# ifconfig tr0 detach ( This command remove all network addresses assigned to the interface and removes the interface from the output of the ifconfig -a command,To add an interface back to the system , or to add a new interface to the newwork interface list , run # ifconfig Interface
考点: 给一块网卡绑两个IP address :
# ifconfig tr0 10.32.1.1 netmask 255.255.255.0 alias
删掉该IP # ifconfig tr0 10.32.1.1 netmask 255.255.255.0 delete
MTU to small :may be lost during transmission
MTU to length :may be collide with other packets
如何看一块网卡的MTU ( 同一个LAN中必须有相同的MTU)
# lsattr -El en0
调整MTU的大小:
# ifconfig en0 mtu 12000
Example of trusted daemons : ftpd , rexecd , telnetd
Example of non-trusted daemons : rshd , rlogind , tftpd
The $HOME/.netrc 文件
Contains information used by the automatic login feature of the rexec and ftp command , 该文件的权限必须设置成600
The /etc/hosts.equiv and $HOME/.rhosts 文件
Define the hosts and user accounts that can invoke remote commands on a local host without supplying a password,先检查/etc/hosts.equiv后检查$HOME/.rhosts
如果一个远程的命令由root用户所发出,/etc/hosts.equiv文件被忽略,只有 /.rhosts 文件被检查,同样,这两个文件的权限应该设置成600
为了安装匿名的FTP在一个服务器上(运行AIX 5L)
# /usr/samples/tcpip/anon.ftp
To enable FTP logging
1、编辑 /etc/syslog.conf文件增加该条目 daemon.info FileName ,在执行下一步之前该文件必须存在
2、运行 # refresh –s syslogd
3、编辑 /etc/inetd.conf 修改包含ftp的那一行
4、运行 # refresh –s inetd
可以使用 # uname –n 命令来显示系统的主机名
# uname 可以显示你使用的是什么操作系统
网络问题的决定:
考点:当 Paging space may be full or not enough memory 的时候,如果一个用户尝试telnet或者是ftp 到系统,There will be time out as the system cannot create additional processes
考点:一个文件系统可能满了
如果一个用户可以访问系统,但该用户不能启动 Web based system manager,可能是/tmp文件系统满了
第十一部分 Network File System administration
The /usr/sbin/nfsd daemon on the server
The /usr/sbin/biod daemon on the client
The /usr/sbin/rpc.mountd daemon on the server
The /usr/sbin/mount command on the client
要启动NFS daemon进程在每一个系统,无论是服务器还是客户机:
# smitty mknfs
或者使用 # mknfs –N
使用下面的步骤配置一个NFS Server
1、启动NFS daemon (如果没有启动的话)
# startsrc –s nfsd ( 启动 nfsd进程 ) 或使用 # startsrc –g nfs (启动 All of the NFS daemons )
注意: 如果/etc/exports 文件不存在的话,The nfsd 和 rpc.mountd进程将不会启动,你可以创建一个空的/etc/exports 文件 # touch /etc/exports ,从而nfsd和rpc.mountd进程就可以启动了
导出一个NFS目录方法一:
1、确认NFS进程已经运行了
# lssrc –g nfs
2、使用 # smitty mknfsexp 去导出目录
3、导出后,使用 # /usr/sbin/exportfs –a : tell the exportfs command to send all information in the /etc/exports file to the kernel
4、确认所有的文件系统已经被导出 # showmount –e CROOM
导出一个NFS目录方法二:
# vi /etc/exports 创建条目在该文件中,List each directory to be exported in the left margin,
OK 后 运行 # /usr/sbin/exportfs –a
临时导出一个目录:
# exportfs –i /dirname
Unexporting an NFS directory
# smitty rmnfsexp 从而该目录的条目从/etc/exprots文件中删掉
你也可以使用vi来Unexprot 一个目录 然后运行 # exprotfs –u dirname
Mounting an NFS directory
由三种类型的NFS Mount
1、预定义的加载指定在 /etc/filesystems文件中
2、explict mounts serve the needs of the root user,,不需要升级/etc/filesystems文件
3、Automatic mounts are controlled by the automount command,
NFS 加载的过程:
1、When the server starts , the /etc/rc.nfs script runs the exportfs command , which reads the server /etc/exports file and then tells the kernel which directory are to be exported and which access restrictions they require.
2、The rpc.mountd daemon and several nfsd daemons are then started by the /etc/rc.nfs script
3、When the client start, the /etc/rc.nfs script starts several biod daemons, which forward client mount request to the appropriate server
4、Then the /etc/rc.nfs script executes the mount command , which reads the file systems list in the /etc/filesystems file
5、The mount command locates one or more servers that export the information the client wants and sets up communication between itself and that server
6、The mount command then request that one or more servers allow the client to access the directory in the client /etc/filesystem file
7、The server rpc.mountd daemon receives the client mount requests and either grants or denies them , if the requested directory is available to that client
8、The client kernel then ties the file handle to the mount point by recording certain information in a mount record
加载方法一:
编辑/etc/filesystem
方法二: # smitty mknfsmnt
确认The NFS Server has exported the directory:
# showmount –e ServerName
自动加载一个文件系统
1、showmount –e ServerName
2、创建一个映射文件 /tmp/mount.map
3、# lssrc –s automountd 确认该进程已经启动
4、 /usr/sbin/automount –v /backup /tmp/mount.map
5、可以 # cd /backup了 ( 自动加载成功 )
6、
为了得到所有的NFS进程的状态
# lssrc –g nfs
改变一个导出的文件系统
在做改变时要先 unexport # exportfs –u /dirname
然后 # smitty chnfsexp
然后再次导出 # exportfs /dirname
使用文本编辑器改变一个导出的文件系统
1、exportfs –u /dirname
2、vi /etc/exportfs 改变相应的内容保存退出
3、重新导出 # exportfs /dirname
To Unmount an explicitly or automatically mounted NFS directory ,
# umount /backup
The rmfs command can be used to remove any file systems you created
相关的文件,命令和进程的参考:
/etc/exports List the directories that can be exported to NFS clients
/etc/xtab List the directories that are currently exported
/etc/filesystems List all file systems that can potentially be mounted and their mounting configuration.
在诊断NFS的问题的时候,如果要确认 the server is up and running (在客户端运行)
# /usr/bin/rpcinfo –p server_name
确认 the mountd, portmap ,and nfsd daemons are running on the NFS server
# /usr/bin/rpcinfo –u server_name mount
# /usr/bin/rpcinfo –u server_name portmap
# /usr/bin/rpcinfo –u server_name nfs
确认在服务器上的/etc/exports 文件列出了要加载的文件系统的名字
确认在服务器上已经导出了该文件系统 # showmount –e ServerName
nfsstat命令决定现在是否丢包 nfsstat –c and nfsstat –s 命令来决定客户机和服务器是否在重传大包, 重传率达到5%就是很高了
NFS 的错误信息
1、if a server fails to respond to a hard-mounted request
显示信息: ……………… not respond
2、If a server fails to respond to a soft-mount request
显示信息: ……………… time out
3、Bad sendreply error message
Insufficient transmit buffers on your network can cause the following error message
显示信息: nfs_server : bad sendreply
为了增加transmit buffers , # smitty commodev
4、Server not responding
首先看看NFS进程是否启动或是否停止了,如果mountd或者是nfsd进程被停止了或是没有启动在服务器上的话,当客户端欲mount filesystem的时候将会出错
如果rpc.mountd进程在启动后停止了,解决方法:
1、telnet 到服务器
2、cd /etc
3、# stopsrc –g nfs
4、# stopsrc –s portmap
5、rm –rf state sm sm.bak xtab rmtab
6、startsrc –s portmap
7、startsrc –g nfs
8、exportfs –a
9、showmount –e servername
考点:
A file system name that appears in the /etc/exports file but not in the output from the showmount command ,说明 a failure in the mountd daemon , either the daemon could not parse that line in the file , it could not find the directory, or the directory name was not a locally mountd directory, If the /etc/exports file looks correct and your network runs NIS , check the server’s ypbind daemon , it may be stopped or hung
NFS mounts and unmount are only allowed for root user and members of the system group
第十五部分 Sendmail and E-mail
Mail system provides two user interfaces : mail and mhmail
The sendmail command is a daemon that uses information in the /etc/sendmail.cf , /etc/aliases, /etc/sendmail.nl ,并通过syslogd daemon来记录邮件系统的活动,The syslogd daemon must be configured and running for logging to occur ( 看/etc/syslog.conf文件要包含mail.debug /var/spool/mqueue/log 这一行, ,还要有/var/spool/mqueue/log文件,如果没有的话用touch创建)
启动sendmail
# startsrc –s sendmail或者是 /usr/lib/sendmail
停止sendmail进程
# stopsrc –s sendmail 或者是 # ps –ef | grep sendmail 然后 # kill –9 sendmail_PID
刷新sendmail进程:
# refresh –s sendmail
得到sendmail 进程的状态
# lssrc –s sendmail
在系统启动时自动启动sendmail:编辑/etc/rc.tcpip,删掉和sendmail有关行的注释
注意在/etc/rc.tcpip中的QPI的值可以改变 ( Query Porcess Intervel )
To process the queue every 15 days
# /usr/sbin/sendmail –q15d
to process the queue every 15 hours
# /usr/sbin/sendmail –q15h
To process the queue every 15 miniutes
# /usr/sbin/sendmail –q15 (如果不指定的话,默认是minute 分钟 )
Mail Queue Directory : /var/spool/mqueue
如果你想打印该队列 : 用mailq 或者 sendmail –bp
Force the mail queue to run : # /usr/sbin/sendmail –q –v
/etc/aliases文件必须包含以下三个别名:
MAILER-DAEMON
Postmaster
Nobody
当编辑了/etc/aliases文件创建了别名列表后,要rebuild the alias database才可以使用别名
运行 sendmail –bi 或者是newaliases
在用户的宿主目录创建一个文件.forward同样可以用来转发邮件
mail 显示系统信箱
mail –f 显示个人信箱
mail –f+folder 显示一个邮件目录
mail 给用户发邮件
第十六部分 Online Documentation
For the client: (需要安装的软件)
A、A web browser
B、The bos.docsearch.client.*
For the documentation server
A、The entire bos.docsearch.package
B、The documentation libraries
C、A Web browser
D、A web server
安装Documentation 的方法:
方法一:configuration assistant taskguide 运行 # configassist
方法二:web_based systems service
方法三:SMIT
For a documentation clients,::
you need only a web browser , installation of the bos.docsearch.client fileset will give you the CDE desktop icon and the docsearch command
在客户端:
在命令行敲入该命令/usr/prod/bin/netscape将设置newscape为默认的浏览器
第十七部分 The AIXwindows font server
这一章主要记住:
当对/usr/lib/x11/fs/config文件做了改变时,首先要运行xfsconf ( 一个shell脚本 )然后启动fontserver
# startsrc –s xfg