第六部分: 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
|