Monday, 7 May 2012

configure NTP Server on AIX

1.Verify that you have a suitable NTP server.

#lssrc -ls xntpd

Note : sys peer should show a valid server or 127.127.1.0
If the server is "insane", you should need to correct it by adding a server line into /etc/ntp.conf and restarting xntpd.

Following these steps

#vi /etc/ntp.conf

Add server :

server 127.127.0.1

Double check that "broadcastclient" is commented.

#stopsrc -s xntpd
#startsrc -s xntpd


Note : If the server runs databases, use the -x flag to prevent the clock from changing in a negative direction. Enter the following:

#startsrc -s xntpd -a "-x"

2.Enter

#lssrc -ls xntpd

to verify that the server is synched. This process can take upto 12 minutes.


configure NTP Client on AIX

1. Verify that you have a server suitable for synchronization, Enter:

#ntpdate -d ip.address.of.server

The offset must be less than 1000 seconds for xntpd to synch. If the offset is greater than 1000 seconds, change the time manually on the client and run ntpdate -d again.

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server (see above )and that no firewalls are blocking port 123.

2. Specify your xntpd server in /etc/ntop.conf, Enter

#vi /etc/ntp.conf

comment "broadcastclient" line and add

server ip.address.of.server prefer

leave the driftfile and tracefile at their defaults.

3. start the xntpd daemon,

#startsrc -s xntpd

( use the -x flag if it is appropriate in your environment.)

4. Uncomment xntpd from /etc/rc.tcpip so it will start on reboot.

#vi /etc/rc.tcpip

Unconmment the following line

start /usr/sbin/xntpd "$src-running"

If using the -x flag, add "-x" to the end oof the line. you must include the qoutes around "-x"

5. verify that the client is synched.

#lssrsc -ls xntpd

Note: sys peer should display the IP Adress or name of your xntpd server.This process may take 12 minutes.




* Source Article from : Internet

Link Aggregation in AIX or Network bonding

Link aggregation means you can give one IP address to two network cards and connect to two different switches for redundancy purpose. In this only one network card will be active in one time, and when it got failed the other network card goes active and let us continue our work.

It is better to use through SMIT.

#smit

then goto

Devices > Communication > EtherChannel / IEEE 802.3ad Link Aggregation > Add An EtherChannel / Link Aggregation

here select the network card that you want to use, ie active.

Eg: select ent0

IMP : then select Mode as 8023ad

then select backup adapter for redundancy.(press F4 to show N/W adapters.)

Eg: ent1

press enter.

now ent0 and ent1 got bonded.

then automatically a virtual adapter will be created named ent2.

then put IP address and all to this virtual adapter.

#smit

Communications Applications and Services > TCP/IP > Minimum Configuration & Startup

here select ent2 ( new bonded virtual adapter )

put IP Address and all,

give start now option.

Now you are successfully completed Link aggregation and check whether it works or not by removing the 2nd cable to the network card and check ping, then put the 2nd cable and remove 1st cable. 2 - 3 drops normally occurs in my experience.


Example 

Question
How do I setup Link Aggregation?

Answer
Question: How do I setup link aggregation?
In order to get this to work correctly LACP must be enabled on the switch. Also make sure that the adapters do not have an ip address already configured on them because it will not work.

Step 1: Type smitty etherchannel
Step 2: Select Add An EtherChannel / Link Aggregation

Setup Link Aggregation

Step 3: Select your primary adapters. In our example we will use ent1 and ent3. To select your primary adapters you will use F7 to select the adapters. Hit enter when done.

Setup Link Aggregation

Step 4: To use Link Aggregation you must change the mode to 8023ad for link aggregation. Scroll down where you see Mode and hit F4 where it will give you your options. Hit enter after you have selected 8023ad.

Setup Link Aggregation


Step 5: Your etherchannel should have been created in our example it created ent5. Now you can configure the new interface with an ip address and verify that all is working.

 * Source Article from : Internet
How to configure the passwordless  ssh authentication ?

Step 1: .. Firstly we need to create  public and private keys using "ssh-key-gen" command  on server1.



[abhi@server1] $   ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/abhi/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Pess enter key]
Your identification has been saved in /home/abhi/.ssh/id_rsa.
Your public key has been saved in /home/abhi/.ssh/id_rsa.pub.


The key fingerprint is:
34:b3:de:af:56:68:18:18:34:d5:de:67:2fdf2:35:g7 abhi@server1


This command will  create two files in ".ssh" directory inside your's home directory (in this case it will  be /home/abhi/.ssh)


 1.   id_rsa
 2.   id_rsa.pub --  this file will contain the public/private   key.


Step 2: You need  to Copy the public key to  the second server(let it's  ip be 192.168.20.1)   using "ssh-copy-id" command.

[abhi@server1] $ ssh-copy-id -i  ~/.ssh/id_rsa.pub  192.168.20.1

abhi@server2's password:
Now try logging into the machine, with "ssh 'remote-host'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

Note: ssh-copy-id appends the keys to the remote-host’s .ssh/authorized_key.

Step 3: Login to remote-host(192.168.20.1) without entering the password

[abhi@server1]  $ ssh  192.168.20.1
Last login: Sun April16 12:18:12 2012 from 192.168.20.1




it dosesn't ask's for password.

* Source Article from : Internet

AIX installation methods

AIX installation methods

there are three types if AIX installation methods

          1. new and complete overwrite installation
          2. migration installation
          3. preservation  installation.

new and complete overwrite installation
we use new and complete overwrite installation when -:

a.  if we have new machine
b.  when you want to completely overwrite your's rootvg
c. you want to reassign your hard disks, i.e. you want to make ur's rootvg  size
smaller.

migration installation

we use this method to upgrade AIX version 4.2 to 4.3 ,aix 5.2 to 5.3 or 6.1

the installation process determines which optimal software products must be installed.

except /tmp ,this method preserves most filesystems including rootvg, logical volumes and system configuration files.

preservation installation

we use preservation installation when you want to preserve user data in the rootvg.

this method overwrites the /usr ,/var ,/tmp  and /root filesystem.

the /etc/preserve.list"  file contains the list of system files to be copied and saved during a preservation BOS installation.
                 the" /etc/filesystems" file is listed by default.

you can add full path names of any additional files that you want to save during preservation installation to the preserve.list file.


trusted computing base(TCB)
the trusted computing base is the part of the system that is responsible for enforcing the information security policies of the system.

by installing the system with the TCB option, we can enable the trusted path,trusted shell,trusted processes and system-integrity checking.

every device is a part of TCB ,every file in /dev directry is monitored by TCB.

TCB automatically monitors over 600 addtional files ,storing ritical information about this files in the "/etc/security/sysck.cfg" file.

it is recommended to backup this file after BOS installation.

you can enable TCB only at the installation time.

TCB can be removed by removing "bos.rte.security" fileset from your system.

#usr/bin/tcbck

if this command shows usage details..then TCB  is enabled in your system.

 * Source Article from : Internet

mksysb and savevg backup & restore

mksysb and savevg backup & restore


A mksysb is a bootable backup of your root volume group.

 The mksysb process will backup all mounted JFS and JFS2 filesystem  data.

 The file-system image is in backup-file format. (bff)



First check whether the filesystems you want to backup is mounted.

#lsvg –l rootvg

Check for state that should be open and also check for mountpoint (last column)

Or use

#mount

Check all the filesystems are there in the output that you want to backup.
If you don,t want to take backup of particular userdefined filesystem in rootvg,
Unmount it .

----- Check for the available tape drives

#lsdev –Cc tape

rmt0 available

Then you can use below command.




Creating a mksysb to a tape drive in AIX V6

. Using SMITTY :

# smitty mksysb

Backup DEVICE or FILE.........................[/dev/rmt0]    @
Create MAP files?.............................no
EXCLUDE files?................................no (-e)
List files as they are backed up?.............no
Verify readability if tape device?............no
Generate new /image.data file?................yes (-i)       @
EXPAND /tmp if needed?........................yes (-X)         @
Disable software packing of backup?...........no (-p)
Backup extended attributes?...................yes
Number of BLOCKS to write in a single output..[]
Location of existing mksysb image.............[]
File system to use for temporary work space...[]
Backup encrypted files?.......................yes
Back up DMAPI filesystem files?...............yes

It will take around 1 hour …

To verify the readability of your backup run the following command :

# listvgbackup -Vf /dev/rmt0

Any errors that occur while reading the headers of any of the files willbe displayed,
otherwise only the initial backup header information will
be displayed. Keep in mind that this check tests the readability of the file only,  not the writeability.

---------------------------------------------

For checking the whether all the files,filesystems are backed up, you can view the table of content 
Use this command

#restore -s4 –Tvqf /dev/rmt0 >/tmp/mksysb.log

It will create one file in /tmp.
Then,

#cd /tmp
#more mksysb.log

Check the table of content.





RESTORING THE BACKUP

To restore a mksysb image you simply need to boot from the tape and  verify your selections in the BOS menus. Next, we’ll cover two  booting scenarios.

When  your system is currently up and operational
1. If your system is currently running and you need to restore your  mksysb, simply change the bootlist to reflect the tape drive and reboot the system.

# bootlist -m normal rmt0
# shutdown -Fr

 If your system is in a down state

 You should boot to the SMS menus from AIX CD. and set your bootlist to reflect the tape drive. The SMS menu options are listed below. Your menu options may be different (depending on your level of firmware), however it should be clear enough by following
this document to figure out what options should be chosen if yours differ.

SMS - SYSTEM MANAGEMENT SERVICES -
1. Select Language
2. Change Password Options
3. View Error Log
4. Setup Remote IPL (RIPL (Remote Initial Program Load))
5. Change SCSI Settings
6. Select Console
--> 7. Select Boot Options

The next menu should come up :
--> 1. Select Install or Boot Device
2. Configure Boot Device Order
3. Multiboot Startup

FOR SETTING BOOTLIST YOU HAVE TO GO TO “CONFIGURE BOOT DEVICE ORDER”

The next menu will have the following :
Select Device Type :
1. Diskette
2. Tape
3. CD/DVD
4. IDE
5. Hard Drive
6. Network
--> 7. List all Devices
The system will scan itself to determine which devices are available to boot from.

it will display all bootable devices. 



The next screen will offer you three choices :
1. Information
--> 2. Normal Mode Boot
3. Service Mode Boot

Restore menus


I. From the Installation and Maintenance Menu, select (2):
1)Start Installation Now with Default Settings
2)Change/Show Installation Settings and Install
3)Start Maintenance Mode for System Recovery



II. From the System Backup Installation and Settings,
you’ll see the default options that are taken from your “bosinst.data” file.

If these are correct select (0) .

* If you need to change any options such as the disks you would like to install to select (1):

Setting:Current Choice(s):
1. Disk(s) where you want to install... hdisk0
Use Maps............................ No
2. Shrink File Systems................. No
0. Install with the settings listed above.

III. Change Disk(s) Where You Want to Install.
Type one or more numbers for the disks to be used for
installation and press Enter. The current choice is indicated by >>>.
At least one bootable disk must be selected. Choose the location by its SCSI ID.
Name Location Code Size (MB) VG StatusBootable
>>>1. hdisk 000-01-00-0,0 600456 rootvg yes
>>>2. hdisk 100-01-00-1,0 600456 rootvg yes

0. Continue with the choices indicated above
After the desired disks have been chosen, select (0) to continue.

IV. System Backup Installation and Settings, select (0 to continue)
             Setting:                                Current Choice(s):
          1. Disk(s) where you want to install......... hdisk0...
          2. Use Maps.................................. No
          3. Shrink File Systems....................... No
          0. Install with the settings listed above.
Backup extended attributes?...................yes
Number of BLOCKS to write in a single output..[]





after giving lsvg command ,it will show all volume group.


#lsvg

rootvg
dev-qa
DBbackup

here we are having three volume group, rootvg ,dav-qa,DBbackup.

for taking rootvg backup we are using mksysb command

for taking backup of customized vg(i.e. dev-qa,DBbackup)we are using savevg command


remember that savevg command doesn,t create bootable image.

Non-rootvg Backup

here I an considering the scenario for taking backup on file and after that pushing it into tape.

create a file in /abhi/asdir named savevg-dev-qa-11-6.22


#cd /abhi/asdir
#touch savevg-dev-qa-11-6.22


check the ulimit 
#ulimit 


set the fsize to unlimited.
#ulimit -f unlimited 




now run savevg command


# smit savevg

Back Up a Volume Group to Tape/File type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
WARNING: Execution of the savevg command will
result in the loss of all material
previously stored on the selected
output medium.


  • Backup DEVICE or FILE [ ] +/ /dev/rmto or any directory(/abhi/asdir/savevg-dev-qa-11-6.22)

* VOLUME GROUP to back up [ ] + (dev-qa) or DBbackup
List files as they are backed up? no +
Generate new vg.data file? Yes +
Create MAP files? no +
EXCLUDE files? no +
EXPAND /tmp if needed? no +
Disable software packing of backup? no +
Number of BLOCKS to write in a single output [ ] #


(Leave blank to use a system default)

F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do




check whether the savevg backup is successfully completed.

For that check the file savevg-dev-qa-11-6.22 in the directory /abhi/asdir is available.


#cd /abh/asdir

#pwd
/abhi/asdir

You can list the content of file
# cat /abhi/asdir/savevg-dev-qa-11-6.22


after that you have to push the file to tape.


For that use

#smit backfile

but before running this command check the below mentioned steps

Kindly check that while running this command you are in /


#pwd
/abhi/asdir

here it is showing that you are in directory /abhi/asdir


then give
#cd /

again check present working directory. It should be /

#pwd
/

then give the command #smit backfile






# smit backfile

Backup a File or Directory
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields] This option will perform a backup by name.


* Backup DEVICE [/dev/rmt0] +/
* FILE or DIRECTORY to backup [/abhi/asdir/savevg-dev-qa-11-6.22 .]
Current working DIRECTORY [ ] /
Backup LOCAL files only? yes +
VERBOSE output? no +
PACK files? No +


F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=D




after that check the content of tape.whether backup was successfull

# restore -Tvf /dev/rmt0

















Restoring a non-rootvg Volume Group


for restoring savevg backup we are using restvg command.

#smit restvg

Remake a Volume Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]


* Restore DEVICE or FILE [/dev/rmt0/savevg-dev-qa-11-6.22] /+
SHRINK the filesystems? no +
PHYSICAL VOLUME names [ ] +
(Leave blank to use the PHYSICAL VOLUMES listed
in the vgname.data file in the backup image)
Use existing MAP files? yes +
Physical partition SIZE in megabytes [ ] +#
(Leave blank to have the SIZE determined
based on disk size)
Number of BLOCKS to read in a single input [ ] #
(Leave blank to use a system default)


F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do

There are three types of backup methods:

1.     . Full backup
2.      .Incremental backup
3.      .Differential backup

FULL BACKUP
All the files are backed on the media using this.

DIFFERENTIAL BACKUP
Differential backup strategy first looks for modification time of the file and compares it with
The last full backup.

Only modified files are backed up, but only if they are changed after the latest full backup.

INCREMENTAL BACKUP
Incremental backup checks the difference between the modification time and the
Last backup time.
                                If the modified time is more recent than the  last backup date
The file is backed up.


SAVEVG

Savevg command is used to backup the user-defined volume group.
It doesn’t create bootable image.
The vg must be varied on and the filesystems to be backed up should be mounted.

Examples:
#savevg –i abhivg

It takes backup of abhivg to the default tape drive(/dev/rmt0)

#savevg –mf  /dev/rmt1 abhivg
This command backs up the abhivg and also create map file along with
a new abhivg.data file on rmt1 device

#savevg –ief /dev/rmt1  abhivg
This command backs up abhivg excluding the files listed in /etc/exclude.abhivg

#savevg –f /dev/rmt0 –V abhivg
This command backs up abhivg on tape /dev/rmt0 and also verifies the readability of file header.


Important files
/image.data – contains information about the rootvg.
 The savevg  command uses this file to create a backup image
That can be used by NIM to reinstall the VG to current system
Or to the new system.

/tmp/vgdata/vgname/vgname.data-
Contains information about the user defined volume group.
Savevg uses this file to create a backup image that can be used
By restvg command to remake that user defined VG.

RESTVG
This command restores the user defined volume group .

#restvg –f /dev/rmt0 hdisk hdisk3
To restore the VG image from /dev/rmt0 onto hdisk2 hdisk3

#restvg –r –f /dev/rmt0
To recreate the VG logical volume structure without restoring any files .

#restvg –l –f /dev/rmt0
To display VG information about the VG backed on the tape /dev/rmt0


BACKUP COMMAND
Backup command creates copies of your files on the backup media.

Backup command can be used for taking backup using :

1.                              Backing files By name( we use –i flag for this)
2.                             .Backing filesystems by i-node(we use –level flag for this)

Backing up files by name

The backup command reads the standard input for the names of the files to be
Backed up.
  File types can be special file,regular files or directories.
*if –p flag is specified only files of less than 2 gb are backed.

#find /home –print|backup –I –f /dev/rmt0
To backup all the files and directories in /home


#cd /home/abhi
#find . –print |backup –ivq

To backup all the files and subdirectories in the /home/abhi using the relative path.

Backing up filesystems by inode
To backup the filesystem by i-node , specify the “-level”
And “filesystem” parameter.

·        You must first umount the filesystem before backing up by i-node.

#backup -0 –u –f /dev/rmt0
-0 means all root filesystem files are to backed .
To backup root filesystem

#backup -1 –u –f /dev/rmt0
To backup all the files in root filesystem that are modified since the last
Level 0 backup.

RESTORE COMMAND
Restore command extracts the files backed up using the backup command.

#restore –xvqf abhi.bkup  system.data
To restore system.data file into the current directory from archieve
Abhi.bkup.the archieve is also in current directory.

#restore –xvdqf /dev/rmt0 /home/abhi/aks
To restore specific directory and its content from a file-name archieve.

* Source Article from : Internet

SHARE THE VIO CDROM TO LPAR

Share the VIO CDROM to LPAR


Scenario:
You have a VIO server installed on a P520, P550 or P570 and you desire to share the cd-rom to a LPAR.(works the same to Power 710, 720, 730, 740 and 750 systems.)

The optical device on the IBM Power 520, 550 and 570 systems is also attached to the internal SAS controller found and cannot be moved to another partition without also moving all the internal SAS drives. The same is valid to Power 710, 720, 730, 740 and 750 systems.


So rather than assigning the optical device (cdX) itself directly to the LPAR in question we'll need to create a virtual cdrom (vtoptX) from cdX within the VIO Server and present it to our LPAR client(s).


Sinking deeper on the technicalities  we'll need to:
  1. Create a Virtual Target Device type Optical Media from the physical cdX device. This new Virtual Target Device will be called vtoptX on the VIO SERVER. 
  2. Once the vtoptX device is available we'll then be able to present the virtual device vtoptX through a Virtual Server Adapter (vhostX) to your client LPAR via a Virtual Client SCSI adapter (vscsiX). All the Virtual SCSI Client/Server adapter creation can be done through the HMC console. (also via IVM.) The creation of Virtual SCSI target device consists of Client/Server Virtual SCSI adapters between the VIO SERVER and the client LPAP.

I will here try to describe as best as I can all this process.

 1 - VIO SERVER: Create a Virtual Target Device type Optical Media from cd0;

mkvdev -vdev cd0 -vadapter vhost1
vtopt0 Available

NOTE: Create your virtual device vtopt0 on separate Virtual SCSI server Adapter other then the one you used to connect your Virtual disks so the you can move the adapter around to different LPARs like the example above. If you keep it all in one adapter you will have to move all the disks with the cdrom around. You probably don't want that.


2 - HMC: Logon the HMC and create the Client/Server Virtual SCSI adapters;

Select the VIO SERVE and select > Manage Profiles
Goto Virtual Adapters Tab and click in Action > Create > SCSI Adapter...
Enter a Virtual SCSI adapter - Take note of this number... we need it later.
Select "Any client partition can connect"  NOTE : that makes it easier to use the CD/DVD from all your VIOCLIENTS
Click OKAY. and OKAY.



Select the LPAR CLIENT and select > Manage Profiles
Goto Virtual Adapters Tab and click in Action > Create > SCSI Adapter...
Enter a Virtual SCSI adapter - The one you toke note from...
Select the Server partition where cdrom resides (the VIO SERVER)
Enter the Server adapter ID: The one you toke note, again...
Click OKAY. OKAY. Close.

Done. Now you should be able to boot from the cdrom.

 * Source Article from : Internet

AIX FIX REPOSITORY



AIX FIX REPOSITORY:-

When working with modification or fixes, it is common to download the fixes to a directory on your hard disk before installation. This location is commonly referred to as the fix repository.
While /usr/sys/inst.images is a standard location for storing software images and will appear in the smit input device/directory (F4) list, you may use any directory for this purpose.


AIX Fix Central Web site:
www.ibm.com/servers/eserver/support/pseries/aixfixes.html.
Maintenance packages

Maintenance packages are released every four to six months.

Use the  oslevel –r  to determine your current level.

Specific fixes
These are generally available fixes that resolve specific problems.

Emergency Fixes
When resolution to a problem is urgent and it cannot wait for a generally available fix. IBM may provide a way around the problem in the form of an emergency fix.

Critical Fixes
IBM periodically publishes information about generally available fixes that may apply to your system.

Commands used to manage fixes:-

The command instfix allows you to install a fix or a set of fixes 
The same command can also be used to determine if a fix is installed on your system or not.


•Installs a fix: 
 # instfix -k IY58143 -d /dev/cd0 

•Searches for a fix: 
 # instfix -ik IY58143 
All filesets for IY58143 were found. 

•Searches for a fix by keyword: 
 # instfix -s SCSI -d /dev/cd0 

•List which AIX BOS maintenance levels are partly or full installed: 
 # instfix -i | grep ML 
 All filesets for 5.3.0.0_AIX_ML were found. 
All filesets for 5300-01_AIX_ML were found. 

•List which filesets are missing in a partly installed AIX BOS maintenance level: 
 # instfix -ciqk 5300-01_AIX_ML | grep :-:


Some useful options with this command are:-
-s – search for and show entries containing this particular string
-k – install filesets for a keyword
-T – just display table of contents
-I – Give information only
-d – to specify the input device.

Fix central Web-site:-



* Source Article from : Internet