Friday, August 31, 2018

Expand AIX disk using chvg

How to expand volume group space without extending new disk to volume group?? So this post is helpful for AIX setup where addition of new disk is time consuming, so instead of adding new disk it will always good option to expand disk from storage end and then expand volume group on AIX level using chvg –g command.Consider situation where there is no free PP available on volume group and AIX admin want to immediately add additional free PP to volume group

There are 2 option to add space to AIX volume group,
1. Add new disk to volume group.
2.Expand existing disk size in volume group.
If situation demand immediate space addition to volume group then 2nd option is the best option.

Which details storage admin need to expand existing disk on AIX ??
Storage admin need Lun Id and Lun name for expanding disk from storage end.

Storage specific command to find Lun details.

EMC storage disk – powermt display dev=hdiskpowerX
IBMstorage - mpio_get_config –Av |grep hdiskX
XIV storage - xiv_devlist |grep hdiskx
Also admin can use lspv –u command to see PV details.
There may be different type of storage, so use command according to storage type to identify Lun ID details

After finding Lun id by AIX admin, provide the same to storage admin and ask to expand same disk with required size. Next step is, execute chvg –g vgname by AIX admin on server. confirm volume group expansion by command 
#lsvg vgname

What if chvg –g vgname command not expanding current disk space ??
 Answer to this question is, admin need to varyoffvg vg and then vary on vg. Here need downtime, because while varyoff VG admin first need to umount corresponding filesystem.

How to handle following error message ??
"chvg -g not supported in the rootvg"
0516-1380 chvg: Re-sizing of the disks is not supported for the rootvg.
0516-732 chvg: Unable to change volume group rootvg.
This error mesage will appear on AIX 5.3 and AIX 6.1 TL lower than 03.

chvg -g rootvg  command supported version are like below.
AIX V6.1 TL3 and higher (6100-03-00) resizing rootvg disks is now supported. on lower version this command will not work for AIX rootvg volume group.

Next query is how AIX admin expand volume group disk on AIX HACMP environment??
Step 1: First provide Lun details to storage team.
Step 2:/usr/es/sbin/cluster/sbin/cl_chvg -g datavg.
Step 3: Observer whether volume size is by using command 
#lsvg vgname


Wednesday, August 29, 2018

VIO update using alternate clone method

Hello everyone today, I am sharing VIO update using alternate disk cloning method. In this method, we will do update on dual VIO environment . Alternate cloning method first clone VIO OS on alternate disk and then start applying update on cloned disk. In dual VIO environment admin need to switch SEA(primary operational) to secondary VIO SEA and do update on primary VIO and after successful update on primary VIO do same for 2nd VIO

First verify VIO fileset consistency.
#errpt |more    - To check errpt alerts.
#lppchk -v   - To check inconsistency.
#installp –C   - Remove the inconsistency file sets. 
Check following fileset is installed on VIO or not, this fileset needed while doing update.
#lslpp –l |grep –i alt_disk_install.rte
Also most important thing take VIO backup before starting update. 
Command for taking VIO backup:
#su – padmin
$backupios –file /tmp/VIOImage
$viosbr -backup -file /home/padmin/`hostname`
Once backup completed transfer it to backup server. This backup need in case of recovery requirement. Before starting VIO update make sure that there is spare disk available which must be same size of rootvg of VIO server and that disk is not part of any volume group. It is always good to switch network traffic to secondary VIO while doing VIO update on Primary.  For single VIO setup admin need downtime and all client LPAR must be shut down before starting update.

For SEA setup do fail-over to secondary VIO by using following command and then proceed for VIO update. Below mentioned SEA adapter change according to SEA setup so please first identify SEA in dual VIO environment then change attribute to “standby”.

Step 1:
# lsdev -C | grep -i  "Shared Ethernet Adapter"
ent11          Available      Shared Ethernet Adapter

$entstat -d ent11 |grep -i state 
LAN State: Operational
LAN State: Operational

# lsattr -El ent11 | grep ha_mode
ha_mode       auto     High Availability Mode    
# chdev -l ent11 -a ha_mode=standby
# lsattr -El ent11 | grep ha_mode
ha_mode       standby  High Availability Mode
After changing "ha_mode" to standby proceed for next step
Step 2: 
#updateios –commit    To Commit the current IOS level
Commit all applied state fileset before starting update .

Step 3:
Start update by using command "alt_root_vg" command
$alt_root_vg -target hdisk1 -bundle update_all -location /tmp/update

Step 4:
Once update done then check whether bootlist is updated new disk or not??
#bootlist -m normal -o
If bootlist is changed to new disk then admin need to take reboot.
$shutdown -restart
Step 5:
After reboot from new disk check VIOS OS level by using ioslevel command.
$license –accept   Accept license after VIO update
$ioslevel     // Check VIOS OS level after update.
#lppchk -v
Step 6:
After successful reboot of VIO, toggle SEA setting back to original.
Use following command to set SEA setting on Primary mode.

On Primary VIO
# chdev -l ent11 -a ha_mode=auto
# lsattr -El ent11 | grep ha_mode
ha_mode       auto  High Availability Mode

How to verify VIO OS level after update without reboot using chroot method??
Use command chroot to Wake up the cloned disk and change the shell prompt
            to verify the IOS level and oslevel of the VIO server.

chroot /alt_inst /usr/bin/ksh 
start the altinst_rootvg shell.
oslevel -s      check the oslevel of altinst_rootvg.
lppchk -m3 -v   To check inconsistency.
Installp –c all To commit the fileset

lppchk –vm3      -To again check the inconsistency.
su – padmin    - To switch to padmin.
ioslevel    - To check the iOS level on the VIOS.

For second VIO follow same approach while doing update.


Wednesday, August 22, 2018

Technology level update on AIX using smit_update and alt_disk_install method

AIX Technology level update
Let first Understand AIX oslevel command output before TL update.

#oslevel -r
7100 is AIX OS version.
04   is Technolgy level

# oslevel -s
7100 is AIX OS version.
04   is Technolgy level
1720  17 is year 2017 and 20 is week of 2017 year in which SP 04 was released.

What exactly AIX Technology update do??

In AIX TL update IBM add new features and support for new hardware and also fixing previous bugs which found or exist in current TL version. It’s always good to move to new TL version because of new feature and new hardware support.
Let’s see different method for updating TL on AIX.
There are multiple method to update AIX TL.

1. By copying AIX TL fileset to local filesystem on AIX LPAR and then use SMIT
update_all to update AIX TL.
2. Use alt_disk_install method to do AIX TL update (Recommended method).
3. From NIM server create resources for updating AIX LPAR TL and then initiate TL update from NIM server.
4. From NIM server share AIX TL fileset File system to AIX LPAR and then do update using SMIT update_all to update AIX TL
5. Use multibos method to AIX TL update.

Before updating AIX TL make sure that all required prerequisite are completed.

1. Take MKSYSB backup of AIX LPAR.
      2.Take configuration backup of AIX LPAR which include df -gt  ,ifconfig –a and all important configuration file backup. In case after update admin may require these backup.
      3.  Also most important note oslevel command output( oslevel –r and oslevel –s).
      4. Make sure that current OS level is consistent (lppchk -v)and no fileset are missing from current OS.

Let see some command which will verify that currently installed AIX TL is stable and AIX admin can proceed for new TL. It’s always recommended that “only proceed for AIX TL update when currently installed TL is stable and all pre-requisite are done.

For example if AIX admin want to update AIX TL to TL 07 and after executing below command he found that output message like “Not all filesets for 6100-06_AIX_ML were found”. So here  admin first bring AIX TL to  6100-06 to correct state and then only proceed for TL 07.
# instfix -i |grep ML
All filesets for 6100-00_AIX_ML were found.
All filesets for were found.
All filesets for 6100-01_AIX_ML were found.
All filesets for 6100-02_AIX_ML were found.
All filesets for 6100-03_AIX_ML were found.
All filesets for 6100-04_AIX_ML were found.
All filesets for 6100-05_AIX_ML were found.
Not all filesets for 6100-06_AIX_ML were found

Here we found that for AIX 6100-06_AIX_ML some fileset are missing ,so using following command you can find missing fileset.

#lppchk -v Check installed fileset consistency
#instfix -cik 6100-06_AIX_ML | grep -v -e ":=:" -e ":+:"


Above command will show missing fileset name and level details ,like currently installed fileset level and required fileset level .

Method 1:
Before starting TL update make sure that application /database is down. So in this method we require downtime.

Here I am going to discuss AIX TL update using SMIT command “SMIT update_all”.
In this method AIX admin copy AIX TL update fileset to Local filesystem which having sufficient space to store these fileset.
Here I am taking local filesystem name as /TLupdate/AIX61TL07

Step 1. Cd / TLupdate/AIX61TL07

Step 2.
#smit update_all
Then choose   . (Current working directory) and press enter.

On next screen choose
Software to update to       “update_all”
Preview only   to           “yes”
Choose preview to yes   To check whether any missing fileset or any missing prerequisite
Extend filesystem if space require to   “yes”
Accept new license agreement to         “yes”

Pres enter and if preview is OK then AIX admin can proceed for TL update.
switch back to previous screen (ESC +3) and then select preview to “no” and press enter  to start AIX TL update using SMIT update_all

Here TL update will start and generally it take 40-50 minutes.

Step 3 :
After TL update how AIX admin will confirm that  TL is updated or not ??
answer to this question is use following  command to check AIX OS health.

#oslevel –r   This command will show OS version and Technology level
#oslevel –s   This command will show OS version ,Technology level and service pack
#lppchk –v   command will show fileset details if its broken, if everything is ok then blank output will be displayed. in short it will check installed software consistency.

“Sometime after TL update when AIX admin executes oslevel –r command, he unable to get correct oslevel . Reason behind this is some fileset are not at correct level, their level is not correct and this causing incorrect AIX OS TL. Other reason for incorrect oslevel after TL update is broken fileset . admin can check broken fileset using command
#lppchek –v and remove broken fileset and install required level fileset again

"Here I am sharing one incident which I faced while updating AIX 6.1 TL, where AIX OS TL is not showing at correct level after update, I wondered why this is happened??

After analysis found that openssh and openssl fileset wasn’t correct level, so after bringing these fileset to correct level I able to see correct TL" and same issue i faced for java SDK fileset,
because of incorrect level of JAVA SDK fileset incorrect OS level shown by oslvel command.

Command which I used to check which fileset level causing incorrect OS level was,
****Below command is example purpose it’s not depicting actual fileset which was missing

#instfix -cik 6100-06_AIX_ML | grep -v -e ":=:" -e ":+:"

6100-06_AIX_ML:Fileset_name: 6100-06 Update

In above output Fileset_name is name of filset which need to bring correct level to bring AIX OS TL to required level.
Installed level(InstLevel)
Required Level (ReqLevel)

After TL update it’s always good to take OS reboot to check whether OS and application are in healthy state after TL update.

Important command to check OS health after TL update
# Oslevel –r   Show AIX version and Technology level.
#Lppchk –v    To confirm whether installed fileset in consistent state or not.
# instfix -i|grep ML   Show whether all fileset are installed or not for installed TL.
#instfix -icqk 6100-06_AIX_ML| grep ":-:"   Show information about incorrect fileset level like name, installed level and required level details.

Here I discussed AIX TL update using command SMIT_update .

Advantage of this type TL update over NFS share based update is it install TL in less time as compare to NFS share TL update. But drawback is if we require to revert back TL to previous TL then we need to restore MKSYSB of previous AIX OS.

If AIX admin want to avoid restore of AIX OS in case of TL rollback, then he must follow AIX TL update using alternate disk cloning method, which I am going to discuss in method 2.

Method 2 :
Before starting TL update perform all pre-requisite check which i discussed in method 1 and then only proceed for TL update.

AIX TL update using alternate disk cloning method.

This is the recommended approach for updating AIX TL.
In this approach AIX admin need new disk which having same size as rootvg disk.

***If there is mirrored rootvg then AIX admin first need to break that mirror using unmirrorvg command and take out one disk for alternate disk install purpose.

How to break mirror rootvg disk for alternate disk install and TL update.

#unmirrorvg rootvg hdisk1
#reducevg rootvg hdisk1
#chpv -c hdisk1
#bosboot -a -d /dev/hdisk0
#bootlist -m normal hdisk0

then to make sure that hdisk1 is out of rootvg by command 

#lsvg -p rootvg

Suppose current rootvg disk size is 50 GB then ask storage guy need to assign same size disk as rootvg  // This applicable when rootvg having only 1 disk.

#lsvg –p rootvg

lsvg -p rootvg
hdisk0            active      

New disk will be hdisk1 and size is same as rootvg hdisk0.
Command to update TL using alternate disk install method

# nohup alt_disk_copy -d hdisk1 -b update_all -l /mnt/AIX_TL > /tmp/altinst_log &

**double check that u r not using current rootvg disk which holding current running OS 

Above command run in background until TL update completed. Advantage of running alt_disk_copy command using “nohup” is if console is accidentally closed or user log out then  also this command run in background without stop.

This command will take 40-50 minutes after completion do AIX OS health check using following command ,After TL update on alternate disk bootlist will automatically set to new disk and admin need to take reboot of AIX server to test whether correct TL is installed or not and application and database is in healthy state and performing well.

Health check command after AIX TL update

#oslevel –r  This command will show OS version and Technology level
#oslevel –s  This command will show OS version ,Technology level and service pack
#lppchk –v command will show fileset details if its broken if everything is ok then blank output will be displayed
Command which I used to check which fileset level causing incorrect OS level was,
#instfix -cik 6100-06_AIX_ML | grep -v -e ":=:" -e ":+:"


TL update using NIM server ,will discuss in new POST.

Thanks !!!!!

No hostkey alg error on RED Hat Linux 7

No hostkey alg  error on RED Hat Linux 7

After new RED Hat Linux 7 installation when admin tried to ssh from Jump server getting error like “No hostkey alg “

#ssh servername(RHELclinet)
Error :“ no hostkey alg”

Step 1:
vi /etc/ssh/sshd_config
Then remove comment from following highlighted entry

# HostKey for protocol version 1
HostKey /opt/dcx/openssh/etc/ssh_host_key
# HostKeys for protocol version 2
HostKey /opt/dcx/openssh/etc/ssh_host_rsa_key
HostKey /opt/dcx/openssh/etc/ssh_host_dsa_key
PidFile /var/run/

Step 2:
Generate RSA and DSA keys using following command.
# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key ;ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

Step 3: 
Then restart sshd using following command.
#service sshd restart

Step 4:
Try ssh from remote jump server it must work
#ssh servername(RHELclinet)
By using above mentioned steps we sorted out “No hostkey alg “ error.

Monday, August 20, 2018

How to solve backspace delete problem on korn and C SHELL

How to solve backspace delete problem on korn and cshell(.cshrc) ??


While executing linux command sometime UNIX/Linux admin need to use backspace key.
IF SHELL type is korn and C SHELL then backspace key will not work,if admin use backpspace key then backspace character(^?^?^?^?^?^?) will appear on
terminal and it always annoy UNIX/Linux admin. So solution to this problem is simply add line  stty erase '^?' in .profile or .cshrc file.

Steps for korn shell type

1 Execute command #ls -a in user home directory and edit .profile and add below entry .
stty erase '^?'

2 Save .profile and reload file using command #. .profile or other option is "logout and login in user account and it will reload user profile.

Steps for C SHELL

1 Execute command #ls -a in user home directory and edit .cshrc and add following entry

 stty erase '^?'

2 save .cshrc and reload using command #. .cshrc or other option is "logout and login in user account and it will reload user profile.

For AIX OS default shell is korn so backspace will not work while deleting command from terminal so solution is to use key ctrl+h to delete command from terminal or
use above mentioned solution.

Thanks !!!!!