Monday 28 November 2016

Difference Between JFS and JFS2 in AIX

In this post you will know differences between JFS(Journal FileSystem) and JFS2 (Enhanced Journal FileSystem) . Before going to create JFS or Enhanced JFS filesystem you want to create JFS or Enhanced JFS logical volumn.TO avoid the JFS/JFS2 logical volumn creation seperatly you can create JFS or Enhanced JFS filesystem on the top of volumn group(rootvg,datavg) it automatically create JFS/JFS2 logical volumn and LOG logical volumn. Advantage of of JFS/JFS2 log LV is, it track and store the information of JFS/JFS2 filesystem. Incase filesystem crashed or corrupted you can recover by using log devices(log LV).

Your volumn group having JFS and Enhanced JFS2 filesystems, two individual LOG LV's were created to store transactions.Here are the differences between JFS and Enhanced JFS.

JFS (Journal File System) :
1.  Kernel size is 32 bit
2.  Maximum file size is 64 gigabytes(GB)
3.  Maximum file system size is 32 terabytes(TB)
4.  Number of I-Nodes are fixed
5.  Need to enable large file
6.  Supports online defragmentation
7.  Supports compression
8.  Only increase the filesystem, it not supported to decrease filesystem
9.  Supports quotas
10. Supports direct I/O operations

JFS2 (Enhanced Journal File System) :
1.  Kernel size is 64 bit
2.  Maximum file size is 4 petabytes(PB), currently it supporting up to 16terabytes(TB)
3.  Maximum file system size is 4 petabytes(PB)
4.  Dynamically increase I-Node size, based on disk space
5.  By default large file
6.  Supports online defragmentation
7.  Not supports compression
8.  Supports increase and decrease the file systems
9.  Supports quotas
10. Supports direct I/O operations




Thanks for reading this Post

Sunday 27 November 2016

Installation Methods in AIX

Three available installation methods in AIX
1. New and Complete Overwrite
2. Preservation
3. Migration

1. New and Complete Overwrite :
To build a new LPAR/Standalone server New and Complete Overwrite is only way to install the operating system.In this method if you want to install OS on existing version, it will completely overwrite the data.Take the backup before going to install OS on existing version.This is the default option when you newly installing the server.It is useful to overwrite the rootvg and resize the rootvg. Insert the CD/DVD or assign NIM resources like lpp_source and SPOT or mksysb and SPOT

How to select New and Complete Overwrite :

Insert the CD/DVD or assign NIM resources like lpp_source and SPOT or mksysb and SPOT

a). Goto to installation and Maintenance menu
b). Select 2 for Change Method of Installation
c). Select 1 for New and Complete overwrite

Change Method of Installation
Type the number of your choice and press Enter.

1 New and Complete Overwrite
Overwrites EVERYTHING on the disk selected for installation.
Warning: Only use this method if the disk is totally empty or there is nothing
on the disk you want to preserve.

2 Preservation Install
Preserves SOME of the existing data on the disk selected for installation.
Warning: This method overwrites the user (/usr), variable (/var), temporary
(/tmp), and root (/) file systems. Other product (application) files and
configuration data will be destroyed.

3 Migration Install
Upgrades the Base Operating System to current release. Other product
(application) files and configuration data are saved.
88 Help ?
99 Previous Menu
>>> Choice [1]: 1

If you want to go back to previous menu select 99.

2. Preservation :
This installation method is used to preserve user data in root volume group.It will removes data under /(root), /usr, /var and /tmp ,take the backup before going to install preservation BOS installation method.It will preserves user specified filesystems,/home and dump devices.You want to save additional files during the Preservation Installation add the entries into /etc/preserv.list.

How to select Preservation Method :
Insert the CD/DVD or assign NIM resources like lpp_source and SPOT or mksysb and SPOT

a). Goto to installation and Maintenance menu
b). Select 2 for Change Method of Installation
c). Select 2 for Preservation

Change Method of Installation
Type the number of your choice and press Enter.

1 New and Complete Overwrite
Overwrites EVERYTHING on the disk selected for installation.
Warning: Only use this method if the disk is totally empty or there is nothing
on the disk you want to preserve.

2 Preservation Install
Preserves SOME of the existing data on the disk selected for installation.
Warning: This method overwrites the user (/usr), variable (/var), temporary
(/tmp), and root (/) file systems. Other product (application) files and
configuration data will be destroyed.

3 Migration Install
Upgrades the Base Operating System to current release. Other product
(application) files and configuration data are saved.
88 Help ?
99 Previous Menu
>>> Choice [1]: 2

If you want to go back to previous menu select 99.


3. Migration :
This installation method is use to migrate server from one operating system to other operating system like from AIX5.3 to AIX6.1 or AIX7.1 .It will preserves content in root volume group,logical volumes,filesystems and system configuration files except /tmp .It clean up content under /tmp filesystem. You configured sendmail,message of the day(/etc/motd) ...etc before going to install in this method take backup of /etc/sendmail.cf , /etc/motd ..etc . If you are migrating from AIX5.3 to AIX6.1/ AIX7.1 by default option will be Migration.

How to select Migration Method:
Insert the CD/DVD or assign NIM resources like lpp_source and SPOT or mksysb and SPOT

a). Goto to installation and Maintenance menu
b). Select 2 for Change Method of Installation
c). Select 3 for Migration

Change Method of Installation
Type the number of your choice and press Enter.

1 New and Complete Overwrite
Overwrites EVERYTHING on the disk selected for installation.
Warning: Only use this method if the disk is totally empty or there is nothing
on the disk you want to preserve.

2 Preservation Install
Preserves SOME of the existing data on the disk selected for installation.
Warning: This method overwrites the user (/usr), variable (/var), temporary
(/tmp), and root (/) file systems. Other product (application) files and
configuration data will be destroyed.

3 Migration Install
Upgrades the Base Operating System to current release. Other product
(application) files and configuration data are saved.
88 Help ?
99 Previous Menu
>>> Choice [3]: 3

If you want to go back to previous menu select 99.


Thanks for reading this Post








AIX Migration from AIX5.3/6.1 to AIX 7.1 Using NIMADM



NIMADM is a facility to move the server from one operating system(AIX 5.3) to another operating system(AIX6.1 or 7.1).The nimadm is an utility having more advantages to compare CD/DVD migration.
In CD/DVD migration method will override /tmp, means whatever the data exist inside /tmp will removed be in new OS version.
NIMADM takes a copy of client server rootvg to spare disk(hdisk5) and simultaneously migrate the server to new OS version.This can be done without downtime and no disruption to client.mksysb backup is optional.

Minimum downtime: Once OS migration completed, downtime required for reboot the client to take into new OS version(AIX6.1 or 7.1). It will take 30-45min per the system.

No Outage : NIMADM is online migration,during the migration process no impact to applications and database.

Easy to Rollback: If applications/Databases are not running as ealier, it very simple to rollback to old level.Just change the bootlist and reboot client server. NIMADM failes in middle whatever the changes are made in altinst_root. It won't impact to original rootvg.

NIM Master take the workload, this will reduce the overhead on client

For example : Consider the naming conventions as below
NIM Master : aixnim
NIM Client  : aix45
lpp_source   : aix7134_lpp
SPOT          : aix1734_spot
Spare disk   : hdisk5

Pre-Checks and Implementation on NIM Master :
1. NIM master running AIX7.1 or latest level of Technology Level/Service Pack.
   # oslevel -s

2. Same level of bos.alt_disk_install.rte fileset must be installed on NIM master rootvg and SPOT
   # lslpp -l|grep -i bos.alt_disk_install.rte

3. NIM resources lpp_source and SPOT level must be same or lower version of NIM Master OS level. We won't migrate higher than NIM Master.
   # lsnim -l aix7134_lpp
   # lsnim -l aix7134_spot

4. Get the new disk from SAN with same or higher size of NIM master rootvg. To create nimadmvg
   # mkvg -y nimadmvg -s 128 hdisk1

5. Update ip address and client name in /etc/hosts
   # vi /etc/hosts
    
6. Define nim client machine
   # smit nim_mkmac

7. Check rsh connectivity between NIM master and client. NIM master able to run commands through rsh.
   # rsh aix45 date

8. bos.alt_disk_install.rte fileset must be installed on NIM master and also in the SPOT.If not you have to add the fileset to SPOT.  
 # lslpp -l bos.alt_disk_install.rte
   # nim -o showres aix7134_lpp | grep -i bos.alt_disk_install.rte (Check on lpp_source)

   # nim -o showres aix1734_spot | grep -i bos.alt_disk_install.rte (Check on SPOT)

   # nim -o cust -a filesets=bos.alt_disk_install.rte -a lpp_source=aix7134_lpp aix7134_spot (add fileset to SPOT)


Pre-Checks and Implementation on NIM Client :
9. Verify oslevel, missing filesets and commit applied filesets
   # oslevel -s
   # lppchk -vm3
   # instfix -i | grep ML
   # instfix -i | grep SP
   # installp -c all   (commit applied filesets)

10. Check hardware,software and firmware levels must be support to required AIX level which you migrating
   # lsmcode -c

11. Get spare disk with same or higher size of client rootvg. If rootvg mirrored break it and use it for migration.
   # lspv

rootvg mirrored :

   # bootinfo -b
   # mirrorvg rootvg hdisk1
   # reducevg -df rootvg hdisk1
   # chpv -c hdisk1
   # bootlist -m normal -o
   # bootlist -ad /dev/hdisk0
   # bootlist -m normal -o

12. lv names must be less tham 11 characters
   # lsvg -l rootvg

13. rsh must be enabled on client. Check root user home directory weather it will be / or /home/root (ex: /home/root)
   # chsubserver -a -v shell -p tcp6 -r inetd
   # refresh -s inetd

   # cd /home/root
   # rm .rhosts
   # vi .rhosts (add as below)
     aixnim  root
   # chmod 600 .rhosts

Check following command on NIM master
   # rsh aix45 date

14. Take the backup of system configuration files like /etc/sendmail.cf , /etc/motd, netstat -rn,vmo -a, ioo -a ...etc

15. Verify the /etc/niminfo file. NIM Master details must updated on this file. If not exist run (#smit nim) and enter NIM master details.
    # cat /etc/niminfo
    # smit nim (to create /etc/niminfo file)

16. Take the mksysb backup if you want.
   # mksysb -i <destination path>


Run NIMADM Command on NIM Master:

# nimadm -j <nimadmvg> -c <clientname> -l <lpp_source> -s <SPOT> -d <spare disk> -Y

# nimadm -j nimadmvg -c aix45 -l aix7134_lpp -s aix7134_spot -d hdisk5 -Y

  -j VG specified on NIM Master
  -c client machine name defined in NIM Master
  -l Name of lpp_source defined in NIM Master
  -s Name of SPOT defined in NIM Master
  -d spare disk for alternate rootvg(altinst_rootvg)
  -Y Accept license

Once migration starts cache file systems create the in nimadmvg and removes the after successful migration.
The migration process will takes in 12 phases .The following is the output of 12 phases while migration is going on

Post Migration :

1. After NIMADM completed,check the bootlist and set to hdisk5(altinst_rootvg)
   # bootlist -m normal -o
   # bootlist -m normal hdisk5 hdisk0

2. Inform to application/database team to stop  applications/database

3. Reboot the server and once it came up check the oslevel
   # oslevel -s

   # shutdown -Fr (It will take few minutes to Power UP)
   # oslevel -s
   # lppchk -vm3
   # instfix -i | grep ML
   # instfix -i | grep SP

4. Inform to application/database team to start  applications/database

5. Disable rsh after the migration
   # chsubserver -d -v shell -p tcp6 -r inetd
   # refresh –s inetd
   # cd /home/root
   # rm .rhosts
   # ln -s /dev/null .rhosts


NIMADM 12 Phases :

Initializing the NIM master.
Initializing NIM client aix45.
Verifying alt_disk_migration eligibility.
Initializing log: /var/adm/ras/alt_mig/aix45_alt_mig.log
Starting Alternate Disk Migration.

+-----------------------------------------------------------------------------+
Executing nimadm phase 1.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 1.
Client alt_disk_install command: alt_disk_copy -j -M 6.1 -P1 -d "hdisk5"
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5
Creating logical volume alt_paging00
Creating logical volume alt_hd8
Creating logical volume alt_hd4
Creating logical volume alt_hd2
Creating logical volume alt_hd9var
Creating logical volume alt_hd3
Creating logical volume alt_hd1
Creating logical volume alt_hd10opt
Creating logical volume alt_lg_dumplv
Creating logical volume alt_hd11admin
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files
for backup and restore into the alternate file system...
Phase 1 complete.

+-----------------------------------------------------------------------------+
Executing nimadm phase 2.
+-----------------------------------------------------------------------------+
Creating nimadm cache file systems on volume group migvg.
Checking for initial required migration space.
Creating cache file system /aix45_alt/alt_inst
Creating cache file system /aix45_alt/alt_inst/admin
Creating cache file system /aix45_alt/alt_inst/home
Creating cache file system /aix45_alt/alt_inst/opt
Creating cache file system /aix45_alt/alt_inst/tmp
Creating cache file system /aix45_alt/alt_inst/usr
Creating cache file system /aix45_alt/alt_inst/var

+-----------------------------------------------------------------------------+
Executing nimadm phase 3.
+-----------------------------------------------------------------------------+
Syncing client data to cache ...

+-----------------------------------------------------------------------------+
Executing nimadm phase 4.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.

+-----------------------------------------------------------------------------+
Executing nimadm phase 5.
+-----------------------------------------------------------------------------+
Saving system configuration files.
Checking for initial required migration space.
Setting up for base operating system restore.
/aix45_alt/alt_inst
Restoring base operating system.
Merging system configuration files.
Running migration merge method: ODM_merge Config_Rules.
Running migration merge method: ODM_merge SRCextmeth.
Running migration merge method: ODM_merge SRCsubsys.
Running migration merge method: ODM_merge SWservAt.
Running migration merge method: ODM_merge pse.conf.
Running migration merge method: ODM_merge vfs.
Running migration merge method: ODM_merge xtiso.conf.
Running migration merge method: ODM_merge PdAtXtd.
Running migration merge method: ODM_merge PdDv.
Running migration merge method: convert_errnotify.
Running migration merge method: passwd_mig.
Running migration merge method: login_mig.
Running migration merge method: user_mrg.
Running migration merge method: secur_mig.
Running migration merge method: RoleMerge.
Running migration merge method: methods_mig.
Running migration merge method: mkusr_mig.
Running migration merge method: group_mig.
Running migration merge method: ldapcfg_mig.
Running migration merge method: ldapmap_mig.
Running migration merge method: convert_errlog.
Running migration merge method: ODM_merge GAI.
Running migration merge method: ODM_merge PdAt.
Running migration merge method: merge_smit_db.
Running migration merge method: ODM_merge fix.
Running migration merge method: merge_swvpds.
Running migration merge method: SysckMerge.

+-----------------------------------------------------------------------------+
Executing nimadm phase 6.
+-----------------------------------------------------------------------------+
Installing and migrating software.
Updating install utilities.
+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
+-----------------------------------------------------------------------------+
Executing nimadm phase 7.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.

+-----------------------------------------------------------------------------+
Executing nimadm phase 8.
+-----------------------------------------------------------------------------+
Creating client boot image.
bosboot: Boot image is 49152 512 byte blocks.
Writing boot image to client's alternate boot disk hdisk5.

+-----------------------------------------------------------------------------+
Executing nimadm phase 9.
+-----------------------------------------------------------------------------+
Adjusting client file system sizes ...
Adjusting size for /
Adjusting size for /admin
Adjusting size for /home
Adjusting size for /opt
Adjusting size for /tmp
Adjusting size for /usr
Adjusting size for /var
Syncing cache data to client ...
Expanding /alt_inst/tmp client filesystem.
Filesystem size changed to 11796480
Filesystem size changed to 2883584
Filesystem size changed to 6029312
Filesystem size changed to 262144
+-----------------------------------------------------------------------------+
Executing nimadm phase 10.
+-----------------------------------------------------------------------------+
Unmounting client mounts on the NIM master.
forced unmount of /aix45_alt/alt_inst/var
forced unmount of /aix45_alt/alt_inst/var
forced unmount of /aix45_alt/alt_inst/usr
forced unmount of /aix45_alt/alt_inst/usr
forced unmount of /aix45_alt/alt_inst/tmp
forced unmount of /aix45_alt/alt_inst/tmp
forced unmount of /aix45_alt/alt_inst/opt
forced unmount of /aix45_alt/alt_inst/opt
forced unmount of /aix45_alt/alt_inst/home
forced unmount of /aix45_alt/alt_inst/home
forced unmount of /aix45_alt/alt_inst/admin
forced unmount of /aix45_alt/alt_inst/admin
forced unmount of /aix45_alt/alt_inst
forced unmount of /aix45_alt/alt_inst
Removing nimadm cache file systems.
Removing cache file system /aix45_alt/alt_inst
Removing cache file system /aix45_alt/alt_inst/admin
Removing cache file system /aix45_alt/alt_inst/home
Removing cache file system /aix45_alt/alt_inst/opt
Removing cache file system /aix45_alt/alt_inst/tmp
Removing cache file system /aix45_alt/alt_inst/usr
Removing cache file system /aix45_alt/alt_inst/var

+-----------------------------------------------------------------------------+
Executing nimadm phase 11.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 3.
Client alt_disk_install command: alt_disk_copy -j -M 7.1 -P3 -d "hdisk5"
## Phase 3 ###################
Verifying altinst_rootvg...
Modifying ODM on cloned disk.
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk5 blv=hd5

+-----------------------------------------------------------------------------+
Executing nimadm phase 12.
+-----------------------------------------------------------------------------+
Cleaning up alt_disk_migration on the NIM master.
Cleaning up alt_disk_migration on client aix45.





 Thanks for reading the Post

Saturday 19 November 2016

Test script in AIX

Test script for repeat output, with in time interval it will show the output of command which you given in script. This script is very useful when you are monitoring the CPU, Memory, Disk input and output and moving or copying files from one to other you will see the slight difference.

while true
do
<command>
sleep 10
done

Example 1 :
It will show "lsvg rootvg" command every 20 seconds.To stop the script run ctrl+d

while true
do
lsvg rootvg
sleep 20
done

 Example 2 : 
It will show "sar" command every 5 seconds.To stop the script run ctrl+d

while true
do
sar
sleep 5
done

Friday 18 November 2016

How to upgrade TL and SP in AIX using alternate disk(alt_disk_copy)


Many method available to upgrade/patch AIX technology level(TL) and service pack(SP) to latest level.This is perfect method to update the AIX server using alternate disk, there is no impact to original rootvg whatever the upgrade you are performing that will goes into alternate disk.To restart the server you have to take downtime from customer or application/database team then you can say it will take minimum downtime. For upgrade/update/migration activities you must take mksysb backup, this backup will useful to restore AIX OS if incase any issues. This mksysb image you can restore by creating NIM resource like mksysb and SPOT .

I may suggest you mksysb backup is optional for alternate disk upgrade(alt_disk_copy) . If you face any issues during or after the upgrade its very easy to backout, just to change the bootlist and restart the system to old rootvg. You must install latest level of bos.alt_disk_install.rte and bos.alt_disk_install.boot_images filesets to current AIX OS, you do not install most cases AIX TL upgrade will fail.

Advantages :
1. Server up and running you can do the OS upgrade/Patching
2. Minimum downtime
3. Easy to backout/rollback to previous version.


Pre-Checks:


1. Verify current operating system version
   # oslevel -s

2. Check currently installed AIX TL and SP levels consistency, make sure no missed filesets for AIX technology level(ML) and service pack(SP)
   # instfix -i | grep ML
   # instfix -i | grep SP

3. Need to check if any filesets missed
   # lppchk -vm3

4. List the installed ifixes/emergency fixes.
   # emgr -l

5. To remove the ifixes/emergency fixes
   # emgr -l
   # emgr -rL <fix>

6. Commit all applied filesets installed on current AIX level
   # installp -s
   # installp -c all

Download the new packages from IBM Fix central(https://www-945.ibm.com/support/fixcentral/) , copy to destination server through ftp or winscp.
In this method mksysb backup not must to take, because upgrading is going on alternate disk. It wont impact to original rootvg

6. Install latest level packages of bos.alt_disk_install.rte and bos.alt_disk_install.boot_images
   # smit installp

Implementation Steps :
If rootvg mirrored follow the below steps, not ignore step 1

1. Reduce the disk from rootvg and use it for upgrade OS using alt_disk_copy
   # unmirrorvg rootvg hdisk5
   # reducevg -df rootvg hdisk5
   # chpv -c hdisk5
   # ipl_varyon -i (To check bootable devices)
   # bootlist -m normal -o
   # bosboot -ad /dev/hdisk0

2. Not mirrored get the new disk(equal or higher size of rootvg disk) from storage team.
   Run following command to take alt disk clone and upgrade to latest level.
   # alt_disk_copy -d <altdiskname> -b update_all -l <TL Location>

   # alt_disk_copy -d hdisk5 -b update_all -l /mnt/AIX_TL

   -d represents alternate disk name
   -b represents bundle
   -l represent location of the TL or SP packages.

Recommended : Execute the command in nohup, to avoid the network issues while doing activity

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

 To verify the output
   # tail -f /tmp/altinst_log

3. Verify the "altinst_rootvg"  created on hdisk5
   # lspv

Once step 2 completed, bootlist automatically set to target disk hdisk5 and reboot the server.

Post-Checks and Verification :

1. Change the bootlist, if not updated to target disk
   # bootlist -m normal hdisk5 hdisk0

2. Reboot the server, it should came up with new oslevel
   # shutdown -Fr
   # oslevel -s

3. Verify installed AIX OS ML(TL) and SP levels consistency, install if any missed
   # instfix -i | grep ML
   # instfix -i | grep SP
   # lppchk -vm3

4. If any filesets missed, check what all missed TL or SP
   # oslevel -rl <TL>
  Example : oslevel -rl 7100-04

  # oslevel -sl <SP>
  Example : oslevel -rl 71-04-011543


alt_disk_copy issues :
You got the below error while doing alt_disk_copy, must check the bos.alt_disk_install.rte and bos.alt_disk_install.boot_images filesets updated to latest level or not.
If not install or update it to latest version.

0301-150 bosboot: Invalid or no boot device specified!
usage:  bosboot {-a | -v} [-d device] [-p proto] [-k kernel] [-l lvdev]
                [-b file] [-M primary|standby|both] [-D|-I] [-LTq]










Thanks for reading this post, any queries please write a comment


Privacy Policy

  Privacy Policy for UNIX TECH INFO At UNIX TECH INFO, accessible from https://unixworld4admin.blogspot.com/, one of our main priorities is ...