Saturday, May 7, 2011

Hot Plug SAS disk drive replacement Procedure

Hot Plug SAS disk drive replacement Procedure
Check the “Hardware Location Code” of the failed hard disk



Run Diag



Select “Task Selection” and press enter


Select “Hot Plug Task” and press enter


Select “SCSI and SCSI RAID Hot Plug manager” and press enter


Select “Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device” and press enter


Select the Failed disk( Example: hdisk1) and “don’t press enter” and inform to Onsite team .
Onsite team replaces the Hard disk and will inform to you.



Once you get the confirmation from onsite team press enter
Then slot 2 is populated.





Perform cfgmgr, check the new hard disk using lspv.
Change the PVID.





Assign it to rootvg using extendvg





Mirror the rootvg



Sync the rootvg












Moving Disk from one VIO client to another

Moving Disk from one VIO client to another


  • If you want to move hdisk1 from VIO_ClientA to VIO_ClientB.

  • Take the backup of /etc/filesystems on VIO_ClientA

  • Stop the DB and APP on VIO_ClientA

  • Move all the LP's from hdisk1 to hdisk2 and hdisk3 using migratepv hdisk1 hdisk2 hdisk3.

  • Check any LP's left in hdisk1 or not using lspv -l hdisk1

  • Take the PVID of hdisk1 using lspv grep -i hdisk1

  • Remove the hard disk from VIO_ClientA using rmdev -Rdl hdisk1

  • On VIO server find the related disk using lspv grep -i "hdisk1 PVID"

  • Find the VTD of Physical volume.

  • From VIO remove the VTD using rmvdev -vtd vtscsi10

  • On VIO Create virtual device with the hdisk on VIO_ClientB using mkvdev -vdev hdisk10 -vadapter vhost3

  • On VIO_ClientB run cfgmgr and assign the new disk to volume group using extendvg datavg

AIX Patch Upgradation

AIX Patch Upgradation


  • Take TSM backup for all File systems on AIX servers

  • Take mksysb backups .

  • Take all Configuration backup .

  • Take snapshot of HACMP configuration: smitty cm_cfg_snap.

  • Upload all downloaded file sets from IBM web site .

  • Remove the second disk from the mirror: # unmirrorvg rootvg hdisk1

  • Check if there are any LVs left on the second disk: # lspv -l hdisk1

  • If exists migrate the remaining LVs to the first disk: # migratepv hdisk1 hdisk0

  • Remove the second disk from the root VG, to do this need to clear the boot record of the second PV: # chpv -c hdisk1

  • Check if the bootlist is first set of the disk with the current rootvg, and on second place of the disk with the alt_disk_install: # bootlist -m normal hdisk0 hdisk1

  • Remove the second PV from rootvg # reducevg rootvg hdisk1

  • Run alternate disk installation: # nohup alt_disk_install -B -C hdisk1 &

  • After successful end of above operation test alternate disk installation (using wakeup key) # alt_disk_install -W hdisk1

  • List the content of PV # lspv -l hdisk1

  • Once all is fine, start the installation with the following commands “sleep” # alt_disk_install –S

  • Run the preview using smitty update_all and check the required /usr file system space and increase it.

  • Add new boot image to the first PV to have “fresh” boot record: # bosboot -ad /dev/hdisk0

  • Stop the cluster services using smitty cl_stop with option both[ Note: check the cluster log in /tmp/hacmp.out and the servers login with the boot IP.]

  • Before start installation should commit all the softwares, installed on the server to make easy roll-back in case of any problems during installation. # smit commit or # installp -c all

  • Update all the software from TL and Service pack # smit update_all

  • Set only apply package, but not commit and keep the copy of replaced files.

  • Reboot both the servers

  • Start the cluster using smitty cl_start. Check the logs in /tmp/hacmp.out
    Roll Back Plan

  • If any problem occurs change the boot disk: bootlist –m normal –o

  • Reboot the server.

  • Start the cluster services

Tuesday, April 26, 2011

Script for finding more than 7 days old files and remove permanantly

Script for finding more than 7 days old files and remove permanantly
find "Source Directory" -type f -mtime +7 -exec rm {} \;

Script for Finding more than 7 days old files and perform compression and move it to destination folder

Script for Finding more than 7 days old files and perform compression and move it to destination folder

find "Source Directory" -type f -mtime +7 | \
> while read file
> do
> compress $file
> mv $file.Z "Destination Directory"
> done


Saturday, April 23, 2011

How to restore non bootable mksysb image

Never use restbyname command in NIM server.
If you want to restore in client use below
tctl -f /dev/rmt0.1 rewind
tctl -f /dev/rmt0.1 fsf 3
restbyname -xqf /dev/rmt0.1

Removing duplicate default route



lsattr -El inet0 -> sees bad route
chdev -l inet0 -a delroute=
lsattr -El inet0 -> bad routes removed