IBM Global Services

AIX 6.1 System Administration-I

Prepared By : Arun Kumar Mishra

© Copyright IBM Corporation 2005

IBM Global Services 

      

Introduction AIX Strengths AIX 6.1 installation process SMIT (System Management Interface Tool) Managing Storage and File Systems Paging Space Job Scheduling Backup & Restore

2

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Introduction 
AIX (Advance Interactive Executive) is an operating system which is run only on the machines with RISC (Reduced Instruction Set Computing) architecture type. The machines like System/6000, System P, PowerPC, PowerMac and SUN SPARC work with the RICS architecture.  IBM has enhanced the standard RISC technology by introducing the newer Performance Optimizer With Enhanced Risc (POWER) architecture. The Power architecture offers impressive performances, using the last technology of circuit engineering and multiprocessor technologies.  Hardware Configuration The AIX system cannot be installed on a traditional computer, such as a PC. It is necessary that the computer is equipped with a system RISC System/6000 or System P server, with at least min 256 MB RAM (1 GB recommended) and Hard disk of 2 GB to 5 GB of free space.

3

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX strengths 
It is based on UNIX System V and has much in common with other versions of UNIX.  System Management Interface Tools smit and smitty. These are very good system admin tools and cover 95% of your admin work.  Built in Logical Volume Manager (LVM) - AIX was developed from day one assuming large systems and lots of disks and so has an LVM to manage groups of disks  AIX has a Journaling Filesystem (JFS2) which supports multi-TB filesystems. The older JFS filesystem is still available, too. Both are delivered with base AIX.  Workload Manager (WLM) allows multiple applications to be segregated into classes and resources (CPU time, memory, and disk I/O) assigned to the classes, which allows coexistence, monitoring, and management of multiple workloads on a single OS image.  Logical Partitions (LPARs) - machines with POWER4 and POWER5 CPUs can be partitioned to run multiple copies of AIX (and/or Linux) at the same time.  Virtualization - LPARs can share disks (and disk & network adapters) to reduce costs.

4

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process (from CD) 
Steps to install the AIX 6.1 Operating system. First, insert the first CD of AIX 6.1 in the CD-Rom. Then restart the computer.  Next you will see the page which displays a menu, as the following picture below. Now we will choose to start on the CDRom in order to begin the procedure of installation. In order to do that, choose from the menu-Main Menu, the System Power Control Menu.

5

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process 
Next choose the Boot Mode Menu, by pressing the key 7 of your keyboard.  Finally change the state of the Boot to SMS Menu. This option will allow you to start installation with the CD. Thus, activate the option by typing the key 1 of your keyboard, in order to pass from the Disabled state to the Enabled state.  Once the operation is made, you can start again the machine, in order to be able to follow the installation procedure of the operating system from the CD.

6

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process 
Installation menu and maintenance  Do not choose the Start Install Now with Default Settings option, if you want to have a blank system. Because this option saves certain configuration files of the previous system, and restore them for the new AIX system. Preferably choose the Change/Show Installation Settings and Install option. You will thus be able, to check or modify the parameters, and the type of the installation. 

7

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process 
Installation and Settings  In this menu you have the possibility: - To define the parameters as the method of installation, or the disk targets where the system will be installed. - To define the language of the system. - To define additional options.  Configuration of the language  To change the language which will be on your system, choose Primary Language Environment Settings.

8

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process 
Method of installation  This page permits to define the method of installation. You can choose from three following methods which are:  - New and Complete Overwrite : it save none data. It replaces all the files of the system.  - Preservation Install : if you have already an AIX system installed, you should choose this option. It permits to preserve certain files existing on the disk. So it preserves the paging unit, the repertory /home and the files systems.  -Migration Install : upgrades the Base Operating System to current release. Other product (application) files and configuration data are saved.  We will perform a complete installation of the system. So it will replace all the data of the system, if there is an AIX system already installed. In order to do that choose the option New and Complete Overwrite.

9

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

AIX 6.1 installation process 
Choice the installation disk  Next choose the disk on which you will install the system. We will choose to install in the hdisk0, the rootvg volume group. Enter 0 and then Enter to continue.  Once the installation has completed, the system automatically reboots from the newly installed operating system on disk.  The Configuration Assistant and Installation Assistant provide step-by-step instructions for completing each customization task like setting the system date and time, setting root¶s password and configuring the network.  Once the installation is finished, we can check the version of the AIX system which was installed, with the oslevel command.  # oslevel  6.1.0.0
10 Application Management Services © Copyright IBM Corporation 2005

IBM Global Services

SMIT (System Management Interface Tool)
The AIX System Management Interface Tool (SMIT) provides a menu-based alternative to the command line for managing and maintaining the AIX operating system. To access it,
use SMIT or SMITTY command.

SMIT can run in one of two modes: ASCII (non-graphical) or X Window (graphical). The ASCII mode of SMIT can run on either terminals or graphical displays. The graphical mode of SMIT (which supports a mouse and point-and-click operations) can be run only on a graphical display running an X Window manager. The ASCII mode is often the preferred method to run SMIT because it can be run from any machine. Here the command which permits to use the SMIT menu: F1 : Displays the help for the use of the SMIT. F2 : Permits to update the display of the screen. F3 : Cancels and returns to the previous screen. F4 : Lists the possible values. F5 : Restores the default value. F6 : Displays the command which will be executed. F7 : Displays a contextual list. F8 : Permits to save the image of the screen. F9 : Permits to access the SHELL. F10 : Exits the SMIT program. Enter : Validates the selection or executes the command.
11 Application Management Services © Copyright IBM Corporation 2005

IBM Global Services

SMIT Logs & script files
$HOME/smit.log :- Keep a log of all menu and dialog screens visited, all commands executed and their output. Also records any errors during the SMIT session. $ HOME/smit.script : Shell script containing all AIX commands executed by SMIT. $ HOME/smit.transaction : Keep all successfully executed scripts.

12

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Managing Storage and File Systems
Physical memory  The physical memory can be also called the physical volume term (PV). A physical volume is a hard disk which can installed inside or outside of the computer. It permits the storage of the data. To visualize physical volumes which are connected to the machine, it is necessary to go to the /dev directory. It will display all the active or inactive hard disks. # cd /dev # ls ±l  When a physical volume is added, a file hdiskn is being created. The n represents a number which is added by the system. Generally, it adds the first number available. Each physical volume must belong to a volume group in order to be able to use the logical volume manager (LVM). This manager permits to an administrator to manage his disks more effectively. Without this manager you could not for example change the size of a partition or a file system. If it was really necessary to modify the property, the data should be saved first, then the partition should be erased, then you should recreate the partition and finally you should restore the data. Thus this manager permits you to facilitate the management of the disks. And it is easier to increase the size of a file system dynamically, without the need to remove it.

13

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Managing Storage and File Systems
Volume groups  A volume group can contain one or more physical volumes. As you can see on the picture, there are two volume groups. These are rootvg and the datavg volume groups. The rootvg is created automatically during the creation of the system. Whereas the datavg volume group is a group which was created by a user. We can see that the rootvg volume group contains only one physical volume which is the hdisk0, whereas the datavg volume group has the disk hdisk1, hdisk2 and hdisk3.

14

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Managing Storage and File Systems
Physical partition (PP) 
All of the physical volumes in a volume group are divided into physical partitions (PPs). All the physical partitions within a volume group are same size, although different volume groups can have different PP size.

Logical volume (LV) 
Within each volume group, one or more logical volumes (LVs) are defined. Logical volumes are groups of information located on physical volumes. Data on logical volumes appears to be contiguous to the user but can be non-contiguous on the physical volume or can even be located on several physical volumes. Logical partition (LP)  Each logical volume consists of one or more logical partition (LPs). Logical partitions are the same size as the physical partitions within a volume group.

15

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Managing Storage and File Systems 
#lspv ± List of the disks on the system  # lsvg ± List the volume groups in the system  # lsvg ±p volumegroup command gives information about all of the physical volumes within the volume group.  # lsvg ±l volumegroup command gives information about all of the logical volumes within volume group.  # smit mkvg ± command can be used for adding a volume group  #smit reducevg ± to remove a volume group  # varyonvg volumegroup ± To activate a volume group  # varyoffvg volumegroup ± To deactivate a volume group  Move the contents of a physical volume  #migratepv [- l lvname] sourcePV tragetPV  #migratepv ± lv02 hdisk0 hdisk6
16 Application Management Services © Copyright IBM Corporation 2005

IBM Global Services

Managing Storage and File Systems 
File system 
A file system is a structure that allows you to organize your data. By placing data in separate files systems, it allows for ease of control and management of the data.  If file systems ever become corrupted, the other file systems are not affected. Also, administrator can take a file system offline without affecting other file system. This is also helpful when performing backups or when limiting user¶s access to file system for security reason.  During of the AIX installation, some files systems are installed by default:  / (root) : It contains the files and directories critical for system operations including the device directory and programs that complete the boot process.  /usr : It contains all operating system commands, libraries and application programs. Can be shared across the net work.  /var : contains some files which are regularly changing the sizes such as logs or email.  /home : store the personal data of the users.  /tmp : accessible to all users for temporary files and workspace. Temporary files should be cleared out frequently.  /opt : special file system to store freeware files.  /proc: special pseuedo file system kept in memory to support threads, or light weight processes.  /admin: there are two empty directories :lost_found & tmp. the permission on these directories is owned by root and the tmp directory has more securities for applications to use.  You can manage the files systems using SMIT and you will be able to add, remove or modify the file system size. To create a file system, proceed in this following way: we will first create a logical volume. Use the command smit lv to access to the logical volume menu. Then it will ask you to choose the volume group, the physical volume associated to the logical volume, and size. Once the logical volume created, now you can create a file system using smit fs command. Once the file system is created, it is necessary to mount it in order to make it visible.

17

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Paging Space 
For a process to be actively running, it must be loaded into memory. When it is loaded into memory, it is assigned a number of 4 kb area called page frames. As more processes are loaded into memory, memory may become full. Not everything that reside in memory is active. When memory is full, memory is scanned to locate those page frames that are least-recently used. When one is located a 4kb block or page of disk space is allocated and the data from the page frame is moved to a special area on disk. This area on the disk is called paging space.  When the paged-out information is needed in memory again, the page is retrieved and brought back into memory.  In AIX environment, paging is managed by the Virtual Memory Manager (VMM)  If your system runs low on paging space, the system is unable to start any new processes until some running processes are terminated or release allocated memory. The following are the various error messages we get when there is low paging space.  ³Paging space is low´  ³cannot fork no swap space´  ³Not enough memory¶  ³unable to fork, too many processes¶  ³ Fork failure ± not enough memory available´
18 Application Management Services © Copyright IBM Corporation 2005

IBM Global Services 

# lsps ±a - to checking paging space.  # cat /etc/swapspace ± to check paging space activities at startup.  # smit mksp ± Adding paging space  # smit chps ± to change paging space  To remove an active paging space
- 1. Make inactive using (# swapoff /dev/paging00) - 2. Remove inactive paging space (# rmps paging00)

19

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Job Scheduling 
Use crontab file to schedule jobs on periodic basis. (Regularly scheduled jobs)  Use at command to schedule a job or series of jobs at some time in the future. (One time only execution at specified times)  All users by default have the privilege to set up scheduled jobs to be monitored by cron / at.  /var/adm/cron/cron.deny - lists users who cannot crontab  /var/adm/cron/cron.allow ± lists users who can use the crontab  /var/adm/cron/at.deny - lists users who cannot crontab  /var/adm/cron/at.allow ± lists users who can use the crontab  # crontab ±l - to view current crontab  #crontab -e  #crontab -l  #crontab -r
20

Edit your crontab file, or create one if it doesn¶t already exist. Display your crontab file. Remove your crontab file.

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services 

Crontab syntax :  A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval. 

in the value field above means all legal values as in braces for that column. The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).  Crontab Example A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM.  30
21

18

*

*

*

rm /home/someuser/tmp/*

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Job Scheduling
Example of at comand at 2300 "/acta_rpca0/opfiles/scripts/JOB_FMS_UPDATE.sh" Listing at Job  To list at jobs use the at ±l command or the atq command. The root user can look at another user¶s at jobs by using the command atq <user> Removing at jobs  To cancel an at job use at ±r or atrm followed by the job number. Use the command atrm ± to cancel all the of your jobs. The root user can cancel all jobs for another user using atrm <user>

22

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Backup & Restore
Why we need backup ? Data is very important ± Expensive to recreate. Disaster recovery ± Hardware failure, Damage due to installation/repair or Accidental deletion. There 3 types of backups 1. System backup ± Records image backup of the operating system. 2. Full backup ± A full backup is similar to a system backup, but it is for user data. 3. Incremental backup ± Records changes since previous backups. We can perform Backup & restore using the SMIT or Web-based System manager. Other backup commands tar (tap archive) :cpio (copy input to output) dd (device to device) ± the dd command is used to copy and convert data byte by byte. Tar command # tar ±cvf /dev/rmt0.3 /home ± generate a tar backup. # tar ±xvf /dev/rmt0 /home/team01/mydir ± restore a file from a tar image. # tar ± tvf /dev/rmt0 ± list content of a tar file. -c create a tar backup -x extract a files from a tar file -t reads the content of tar file -v verbose output - f identify the file or device holding the tar image -U alls archival and extraction of extended attributes.
23 Application Management Services © Copyright IBM Corporation 2005

IBM Global Services

Backup & Restore
cpio command #find /home | cpio ±ov > /dev/rmt0 - to generate a cpio backup #cpio ±idv < /dev/rmt0 ± to restore from a cpio image # cpio ±ivt < /dev/rmt0 ± list the content of a cpio image -o create a cpio image -i read from a cpio image(input) -t read the content of cpio image -v verbose output -d create necessary directories when recovering an image. dd command The dd command reads in standard input or the specified input file, converts it,and then writes to standard out To copy a files to diskette #dd if=/etc/inittab of=/de/rfd0 To convert a file from ASCII to EBCDIC #dd if=text.ascii of=text.ebcdic conv=ebcdic To convert data to uppercase characters #cat lcase.data |dd conv=ucase if= Specifies the input file of= Specifies the output file conv= Designates the conversion to be done.

24

Application Management Services

© Copyright IBM Corporation 2005

IBM Global Services

Thank You

25

Application Management Services

© Copyright IBM Corporation 2005