Showing posts with label BASIC CONCEPT. Show all posts
Showing posts with label BASIC CONCEPT. Show all posts

Saturday, September 1, 2018

How to find out WWPN number of the HBA (FC) card in aix?

How to find out WWPN number of the HBA (FC) card in aix?


More often, We are in the situation to find out the wwpn number of the hba card in aix.

we are normally using "lscfg -vpl fcs(X)", or somebody using "lscfg -vpl fcs(X)|grep -i network"

But using the below for loop, we can easily identify all the hba card and its wwpn number of the server immediately.

Please keep this in your notepad, so that you can use it whenever it required.


for i in $(lscfg |grep fcs |awk '{print $2}'); do echo $i && lscfg -vl $i|grep Network;done


The output is like below. 

fcs0     Network Address.............10000000ABCD1234
fcs1     Network Address.............10000000EFGH4567
fcs2     Network Address.............10000000IJKL88900
fcs3     Network Address.............10000000ABEF4567




Wednesday, April 25, 2018

How to create a ISO image using mksysb and perform the restoration in aix?

How to perform the AIX restore using the ISO image in aix?



Assume the server name is "testserver"


Taking the mksysb on the /mnt directory. (it can be nim server nfs filesystem)
mksysb -i -e -X /mnt/testserver.mksysb     


To confirm the mksysb backup is good for restore.
listvgbackup –f /mnt/testserver.mksysb


To create a iso directory to hold the iso image and go inside it.
mkdir /mnt/testserver/iso
cd /mnt/testserver/iso


To create iso image using mksysb
mkcd -L -S -I /mnt/testserver/iso -m /mnt/testserver.mksysb


cd_image_12345 file has been created, we can rename it 


Rename the iso image for the better naming convention.
mv cd_image_12345 testserver.iso


Confirm the rename is successful
ls -l testserver.iso 


Now the iso can be stored in the /home/padmin directory of the VIO server.
scp testservcer.iso padmin@vioserver:/home/padmin/.


To Lists and displays information about the Virtual Media Repository.
lsrep


To create the media repository
mkrep -sp rootvg -size 10G


To confirm the media repository created
lsrep


To copy the iso image to the repository image
cp testserver.iso /var/vio/VMLibrary/


To create a optical device and map it on the proper vhostX
lsmap -vadapter vhost0
mkvdev -fbo -vadapter vhost0 -dev testserver_opt0
lsmap -vadapter vhost0


To load the virtual media on the optical device
loadopt -disk testserver.iso -vtd testserver_opt0
lsmap -vadapter vhost0


Now the output should be like


VTD testserver_opt0
Status Available
LUN 0x8200000000000000
Backing device /var/vio/VMLibrary/testserver.iso
Physloc
Mirrored N/A


Now we can able to restore the iso image to the corresponding lpar.

Login to the hmc and Activate the AIX server “testserver” to the SMS Menu
And choose the below options.

(5) Select boot option
(1) Select install/ Boot device
(7)  List all devices
(2) SCSI-CD ROM  (location code lun id match with the lun id of the mapped vhost - 0x8200000000000000)
(2)  Select normal boot
(1) Yes  (to exit system management service)

Once exiting from the sms menu, the server “testserver” will boot up from the virtual optical device to the AIX Installation Menus

Now the install /restoration aix operating system.starts



Note:

Sometimes, 2 ISO images created due to the large size of mksysb. In that case, while perform the restoration first we have to add the first iso image and after sometime we need to load the second .iso image. (The system will let you know to add the second iso image - "Please remove volume 1, insert volume 2, and press the ENTER key.")


Follow the below procedure if you are in the situation to add the second iso image.


lsmap –vadapter vhost0
unloadopt -vtd testserver_opt0
loadopt -disk testserver2.iso -vtd testserver_opt0
lsmap –vadapter vhost0



Friday, February 3, 2017

How to check the apar installed in aix?

How to check the particular apar is installed in aix?


Many times we are in the position to check or install the specific apar in aix.

Below is the way to check whether the particular apar is already installed or not.

Example: APAR IZ97457


syntax: #instfix -ik <apar_name>

#instfix -ik IZ97457

All filesets for IZ97457 were found.

The above output shows that the APAR IZ97457 is already installed on the server.



Suppose if the apar is not installed on the server then we have to get the apar first and then installed it.

To list of fixes/apar that are on a directory or CD, then we can use the following:
# instfix -Td <directory>     (or)   # instfix -Td /dev/cd0

once you find out then installed the fix with the below command
# instfix -k <fix> -d <directory>
# instfix -k IZ97457 -d /export/filesets      (or) use # smitty update_by_fix





Thursday, December 22, 2016

How to solve current boot logical volume /dev/hd5, does not exist on /dev/hdisk# in aix?

How to solve current boot logical volume /dev/hd5, does not exist on /dev/hdisk# in aix?



Many cases we could receive this issue when we run mksysb command or run alt_disk copy or create/recreate the bosboot image on the disk.

Please follow the below procedure to fix the issue.


#cd /usr/bin
#cp mkszfile mkszfile.old
#vi mkszfile

search for the argument "-qv" and find the following line


BOOT_BLKS=`LC_MESSAGES=C ${bosboot} -qv | ${tail} -1l | ${awk} '{print $2 * 2}'` 


Add the  -d /dev/ipldevice. The line should look like this when finished


BOOT_BLKS=`LC_MESSAGES=C ${bosboot} -qvd /dev/ipldevice| ${tail} -1l | ${awk} '{print $2 * 2}'` 


then save it and run mksysb or alt_disk again.

or


change mkszfile to use  #bosboot -qvd /dev/ipldevice

****************************************************************************************************************************************



Another blv error

==============


If /dev/ipldevice vary with the boot disk, need to follow the below steps to correct it. We will do the first step for sure and it will end up with error as below, proceed with the next steps.

bosboot -ad /dev/ipldevice
0516-602 lslv: Logical volume name not entered.
0301-168 bosboot: The current boot logical volume, /dev/hd5,   does not exist on /dev/hdisk0.

Solution:
lsvg -p rootvg - hdisk0
lslv -m hd5 -->
hdisk0 on PV1 1st partition
savebase -v - successful

will remove/recreate hd5 – no need to worry it worked good

# rmlv hd5
# mklv -y hd5 -t boot -a e rootvg 1 hdisk0
# cd /dev
# rm ipldevice
# ln /dev/rhdisk0 /dev/ipldevice
# bosboot -ad /dev/ipldevice - same error

# bootinfo -B hdisk0 - 1
# ln /dev/rhd5 /dev/ipl_blv
# cd /dev -
same maj/min numbers
# bosboot -ad /dev/ipldevice

Now we got the same minor and major number for hdisk0

# ls -ld /dev/ipldevice
crw-------    2 root     system       20,  0 Oct 31 2019  ipldevice
# ls -ld /dev | grep -i "20,  0"
# ls -l /dev | grep "20,  0"
brw-------    1 root     system       20,  0 Mar 31 08:54 hdisk0
crw-------    2 root     system       20,  0 Oct 31 2019  ipldevice
crw-------    2 root     system       20,  0 Oct 31 2019  rhdisk0
#
alt_disk_install was able to proceed now

****************************************************************************************************************************

Another blv error

=============


0301-162 bosboot: savebase failed with /dev/hdisk0.

0301-165 bosboot: WARNING! bosboot failed - do not attempt to boot device.


Solution
=======

Boot the sever into maintenance mode
Remove the corrupted blv - #rmlv –f hd5
recreate the new hd5 blv logical volume - # mklv -y hd5 -t boot -a e rootvg
create a bootimage - # bosboot -ad /dev/hdisk0
Shutdwon -Fr 


Thursday, September 15, 2016

How to reset the unknown root password in aix?

How to reset the unknown root password in aix?


1. Ground work:

Get the hmc details
Get the hscroot password of the HMC
Make sure CD available on the server.
Login to hmc and reboot the server from sms mode


2. Implementation

(Boot the server in sms mode and follow the below steps)

5. Select boot options
1. Select install/Boot device
4. IDE
1. IDE-CDROM
3. Service mode boot
1 Yes (Exit sms)
1. Type 1 and press enter to have english during install
3. Start maintenance mode for system recovery
1. Access a root volume group
0 Continue
1 (Select the boot device)
1. Access this volume group and start a shell

# passwd
Changing password for "root"
root's New password:
Enter the new password again:
sync;sync;sync;reboot
                     
3. Validation

login to the server with the new password and confirm you can logon successfully.

4. Downtime
Yes downtime required for this task.

Note: If you dont have CD to boot up the server in maintenance mode, then you can use the NIM server to get maintenance mode. Please see the link below.
http://howtoaix.blogspot.in/2015/04/how-to-boot-server-into-maintenance.html


Friday, July 15, 2016

How to upgrade HACMP version in aix?

How to upgrade HACMP - Cluster version in aix?


1. Ground work:

#lslpp -l|grep -i cluster.es.server.rte     --> To check the current version of the cluster
#./clRGinfo                            --> Check if the RG is online status.
#lssrc -ls clstrmgrES               --> check if the cluster manager is stable on both nodes
#smitty hacmp ->
    Extended configuration
      snapshot configuration
        Create a snapshot of the cluster configuration  (Mandatory -snap name and description)
             output: .info and .odm file created (Required this for restoration)

#/var/hacmp/clverify/clverify.log   --> check clverify has no errors
#emgr -l                                          --> Check if the emergency fixes there on the server
#emgr -rL                                          --> To remove the emergency fix.
Check Download the hacmp upgrade filesets from fixcentral and save it in rootvg directory.

2. Implementation steps

Stop the cluster services on both the nodes.
#lssrc -ls clstrmgrES                    --> check if the cluster manager is st_stable on both nodes
#smitty hacmp
     system management (c-spoc)
         manage hacmp services
             stop cluster services  (now, select node/noes and bring resource groups offline)

#lssrc -ls clstrmgrES                    --> Now the cluster manager demon should be ST_INIT
#lslpp -l|grep -i cluster.es.server.rte   --> To check the current version of hacmp
#cd <package_located directory>
#smitty update_all        -- > Do the preview first and commit next, once done follow below
#lslpp -l|grep -i cluster.es.server.rte    --> To confirm the version has been upgraded.
Reboot the node and perform the upgrade on the other node.
#smitty hacmp
     system management (c-spoc)
         manage hacmp services
             start cluster services  (now, select node/node names, automatically)

#/tmp/hacmp.out                      --> To check any error and warnings


3. Validation

#lslpp -l|grep -i cluster.es.server.rte    --> To confirm the version has been upgraded.
#lppchk –v                                           --> No output should displayed, only the prompt
#./clRGinfo                                         --> To check the RG is online as before.
#lssrc -ls clstrmgrES                            --> To check if the cluster manager is stable (ST_Stable)



Sunday, May 8, 2016

Network concepts in aix?

Network concepts in aix?


To configure the ethernet card
#cfgmgr




To Assign IP address to the NIC
smitty tcpip

#ifconfig en0 inet 192.168.4.75 netmask 255.255.255.0 up




To add IP alias temporarily to the NIC
#ifconfig en0 alias 192.168.4.75 netmask 255.255.255.0 up
To delete temporarily created IP alias
#ifconfig en0 delete 192.168.4.75 




To add IP alias permanently to the NIC
 #chdev -l <interface> -a alias4=<IP_address>,<Netmask>
To delete permanently created IP alias
 #chdev -l <inteface> -a delalias4=<IP_address><Netmask>




To Disable IP address
#ifconfig en0 down (Turns off network card en0)




Enable IP address
#ifconfig en0 up (Turns on network card en0)




Remove IP address
#ifconfig en0 detach




Check status of the NIC
#ifconfig –a




Check the NIC device status
#entstat en0

#entstat –d en0    (for detailed information)




To change the hostname temporarily
#hostname <new hostname>
To change the hostname permanently
#chdev –l inet0 –a hostname=<new hostname>




Trace the HOST
#traceroute <server name>




. Assign gateway to network
#route add  192.168.0.1




Clear the gateway
#route –f (To clear the gateway)




List out all connections
#netstat -a
To list out only tcp connections
#netstat -at
To list out only udp connections
#netstat -au
To disable reverse dns lookup
#netstat -ant
To list out only listening connection
#netstat -tnl
To list process/user id of listening connection
#netstat -nlpt
To list out statistics of all packet 
#netstat -s
To display kernel routing info
#netstat -rn
To print out network interface
#netstat -i
To Detailed info of network interface
#netstat -ie
To get netstat continuous output
#netstat -ct
To display the multicast group info
#netstat -g
(To show the network buffers cache)
#netstat –c
(To show the net drops of packets)
#netstat –D
(To show routing table
#netstat –rn

#mktcpip -i en1 -h power1 -g 192.168.X.X -a 192.168.X.X -m 255.255.255.0
#ifconfig en1 down detach
#rmdev -dl en1
#ifconfig en1 up
#ifconfig en0 alias 192.168.X.X netmask 255.255.255.0 up
#ifconfig en0 delete 192.168.X.X
#chdev -l en0 -a alias4=192.168.X.X ,255.255.255.0
#chdev -l en0 -a delalias4=192.168.X.X,255.255.255.0