Tuesday, September 23, 2014

How to convert from a JFS to a JFS2 filesystem?

How to convert from a JFS to a JFS2 filesystem?

Is it possible to convert from a JFS to a JFS2 filesystem?

No, a JFS filesystem cannot be converted to become a JFS2 filesystem.
The two types of filesystems have completely different structures and inode allocation methods. There are three recognized methods to move data from a JFS to a JFS2 filesystem.

1. Copy With Parallel Filesystems


If you have the space, creating a second filesystem and simply copying the data is the easiest way.
# crfs -v jfs2 -g myvg -a size=20G -A yes -m /newfilesystem
This will create a 20GB filesystem in volume group "myvg" with mount point "/newfilesystem".

Mount the filesystem:
# mount /newfilesystem

Copy the data from your existing filesystem to it, with a command similar to:
# cd /mydata; pax -w * | (cd /newfilesystem; pax -v -r )

Unmount the current filesystem and rename it:# unmount /mydata
# chfs -m /oldfilesystem /mydata

Rename the mount point of the new filesystem and mount it::# chfs -m /mydata /newfilesystem
# mount /mydata

At this point test your application or check over your data. If all is well remove the old filesystem:# rmfs /oldfilesystem


2. Backup and Recreate


Back up your data on the original filesystem, remove it and recreate as JFS2. Use this when you do not have enough disk space to have the same filesystem existing in parallel.
Back up the data using whatever command you usually use to back up the files.

Unmount and remove the old filesystem:
# umount /mydata
# rmfs /mydata

Create the filesystem again:# crfs -v jfs2 -g myvg -a size=20G -A yes -m /mydata
# mount /mydata

Restore your data to /mydata

3. Alternate Disk Copy for Rootvg


If your filesystems are rootvg ones, neither of these methods will work. However you can use alt-disk copy to create a new rootvg. Using the -T flag will recreate the filesystems as JFS2:

Indicates that you want to convert JFS file systems to JFS2 file systems during the process of recreating the rootvg volume group on target disks.

# alt_disk_copy -T -d hdiskX

where hdiskX is an unused disk not belonging to any volume group.


Thursday, August 28, 2014

Content of BLV in aix

What is the content of BLV in aix?

The following is the content of BLV
ü  Aix Kernel
ü  Rc.boot
ü  Reduced ODM
ü  Boot commands

AIX kernel
The kernel is always loaded from the BLV. There is a copy of the kernel in
/unix (soft link to /usr/lib/boot/unix_mp or unix_up). This version is used to
build the hd4 file system where the kernel image is read during system
boot.

rc.boot
         This is the configuration script that will be called three times by the init process during boot.

Reduced ODM
          Device support is provided only to devices marked as base devices.

Boot commands

          For example, cfgmgr and bootinfo.

Boot process in aix

Boot process in aix

If you are going to attend any interview, there might be the chance of asking the question about boot process at that time you can explain the boot process like the below. (Instead of telling all the detailed steps, we can tell the important thing to make the interviewer understand easily)

 Remember this is only for interview purpose


1.       Three phases are there in the boot process
1.       Ros kernel init phase

2.       Base device configuration

3.       System boot phase


1.       ROS (Read only storage) kernel init phase:

        Problem of the mother board checked

        POST (Power on self test) {all the peripheral devices are checked}
        Boot list is found and boot image is loaded into memory

        System initialization start 

2.       Base device configuration:

         All the devices and FS are configured with the help of cfgmgr.



3.       System boot phase:

         All the logical volumes are ‘varied on’

         Paging is getting started

         Process defined in /etc/inittab file are initiated by init process
         The system is getting up with the default runlevel 2.

------------------------------------------------------------------------------------------------------------
Notes:
ü  After the BLV is loaded into RAM, the rc.boot script is executed three times to configure the system.
ü  During rc. Boot1, Base devices to activate rootvg is configured
ü  During rc.boot 2, rootvg is varied on.
ü  In rc.boot3, remaining devices are configured.
ü  Content of BLV: AIX Kerne, Boot commands, rc.boot, Reduced odm


Friday, June 20, 2014

How to find out the hacmp cluster version in aix?

How to find out the hacmp cluster version in aix?


Using the below command we can find out the hacmp cluster version easily in the new version of hacmp. (it will give you a clear output  like oslevel command  ). For the older version, we can check with "lslpp" command

        

              halevel -s



output:  6.1 SP 2


Monday, June 16, 2014

How to change the word in the file in aix?

How to change the word in the file in aix?


Using the below commands we can change the particular word in the file. 

Note: we can replace the word and save into the other file. NOT on the target file itself. if we try to replace the word on the same file itself, the file will be nullified automatically.


      sed "s/ <target_word> / <replacing_word> /g" newfile > newfile-backup


In the above commands, we can replace the word from test_old to test_new on the newfile.

Ex: 

cat newfile

test_1
test_2
test_3
test_old
test_5
test_6
test_old

sed "s/test_old/test_new/g" newfile > newfile_backup

cat newfile

test_1
test_2
test_3
test_new
test_5
test_6
test_new


On the above newfile, test_old has been replaced by test_new. (So whereever the word "test_old" is there in the file, it has been replaced by the new word "test_new")




How to solve the 11 digit character issue while taking alt_disk clone in aix?

How to solve the 11 digit character issue while taking alt_disk clone in aix?


Sometimes we are facing the 11 digit character issue when we taking alt_disk (because the lv name's character is more than 11 digit). yes, we cant take alt_disk clone if the lv name is more than 11 character.

For example: If we have a LV name as testpurpose_lv (toally it has 14 character) If we are trying to take the alt_disk then surely it will end up with the 11 digit character issue. Hence we cant take the alt_disk.

Please find the solutions below:


* Generate image.data using mkszfile.


* Copy image.data to /tmp/image.data_old


* Edit /tmp/image.data_old (vi /tmp/image.data_old), go to LV stanza and change the LV name to the smaller one. i.e reduce the number of character in lv name.

 "testpurpose_lv"  to  "testlv"  (Note that the new lv name (testlv) character is below 11 digit)


* Run alt_disk_copy with "i" 

              alt_disk_install -i /tmp/image.data_old -C -B <hdisk_name>


Actually what happen: When alt disk reads the LV name in image.data, it will create the alt_disk LV with the new name as in the modified image.data file. i.e /tmp/image.data.old



Thursday, June 12, 2014

How to find out the vhost information easily in vio server in aix?

How to find out the vhost information easily in aix?

Using the below command we can find out the vhost information very easily. We can get all the vhost name information associated with our target lpar very easily. For that we need have the LPAR ID in hexa decimal.


* Find the lpar id and convert into hexa decimal.

     For ex: if your LPAR ID is 15, then the hexadecimal value is "f"  

Using the below command we can convert decimal no to hexa-decimal.

    printf "%x\n" 15           output is: "f"



* Execute the below command on the VIO server to find out the vhost info.

     lsmap -all | grep vhost | grep 0x0000000f


Note: totally 6 zeros are needs to put after the "x" on the command and last two digit ("0f") is for hexa decimal number.

Advantages of this command is, if you have 6 virtual disks on the lpar from the vios, then we  will get all the 6 virtual disks associated with the vhosts name on the VIOS..



How to find out the VHOST informaiton using VTD names?

How to find out the VHOST informaiton using VTD names?


Many ways are there to find out the vhost information. Sometimes we know the VTD name but dont know about the VHOST information. The below commands used to find out the VHOST information using the VTD name. 

      lsdev -dev <VTD_NAME> -field parent 


(execute the command in the aix prompt)

         /usr/ios/cli/ioscli lsdev -dev <VTD_NAME> -field parent |egrep -v parent



Saturday, October 12, 2013

How to find out the parent and child device in aix?

How to find out the parent and child device in AIX?

To find out the Parent device:

lsdev -l <device name> -F parent


Example: If we want to find out the parent device of the hard disk hdisk0, then

#lsdev -l hdisk0 -F parent 

Output: fscsi0


To find out the Child device:

lsdev -p <device name>


Example: If we want to find out the child device of the fscsi0, then pls execute below

#lsdev -p fscsi0

Output: hdisk0

Sunday, September 15, 2013

How to deal with Paging Space in AIX?

How to deal with Paging space in AIX?


PAGING SPACE TIPS:

Determining if more paging space is needed:

Allocating more paging space than necessary results in unused paging space that wastes disk space. However, allocating too little paging space can result in one or more of the avoidable symptoms listed below.

Use the following guidelines for determining the necessary paging space:

Enlarge paging space if any of the following messages are displayed on the console or in response to a command on any terminal:


ü INIT: Paging space is low

ü ksh: cannot fork no swap space

ü Not enough memory

ü Fork function failed

ü fork () system call failed

ü Unable to fork, too many processes

ü Fork failure - not enough memory available

ü Fork function not allowed. Not enough memory available.

ü Cannot fork: Not enough space

Add a paging space if the average of the %Used column in the output of the lsps -a command is greater than 80

Add a paging space if the %Used column in the output of the lsps -s command is greater than 80.


Note: Only extend a paging space as a last option.

Use the following commands to determine if you need to make changes regarding paging space logical volumes: 

Iostat:  Check the tm_act field for the hdisk containing the paging space for a high percentage relative to the other hdisks

vmstat : Assure fr/sr columns of the vmstat page field do not consistently exceed the ratio of 1:4.


lsps Use the -a flag to list all characteristics of all paging spaces. The size is given in megabytes. Use the –s flag to list the summary characteristics of all paging spaces. This information consists of the total paging space in megabytes and the percentage of paging space currently assigned (used). If the -s flag is specified, all other flags are ignored.

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

THINGS TO CONSIDER WHEN CREATING OR ENLARGING PAGING SPACE:

Before creating a new paging space or enlarging an existing paging space, consider the following:

Ø If a disk drive containing an active hd6 paging space logical volume is removed from the system, the system will crash.

   Ø Do not put more than one paging space logical volume on a physical volume.If you add more than one paging  space to one of the physical volumes, the paging activity is no longer spread equally across the physical volumes.

   Ø All processes started during the boot process are allocated paging space on the default paging space logical  volume (hd6). When additional paging space logical volumes are activated, paging space is allocated in a "round robin" manner, in 4KB chunks.

   Ø Avoid putting a paging space logical volume on the same physical volume as a heavily active logical volume, such as that used by a database.

   Ø It is not necessary to put a paging space logical volume on each physical volume.

   Ø Make each paging space logical volume roughly equal in size.

   Ø If paging spaces are of different sizes, and the smaller ones become full, paging activity will no longer be spread across all of the physical volumes.

   Ø Do not extend a paging space logical volume onto multiple physical volumes.

   Ø For best system performance, put paging space logical volumes on physical volumes that are each attached to a different disk controller.

   Ø It is technically supported to create default paging space (hd6) on ESS, EMC or RAID array, although it is not recommended, and should be avoided if possible.


   Ø NOTE: If system is paging enough to cause an I/O bottleneck, tuning the location of the paging space is not the answer.


DAY to DAY operation in aix:

LIST
How to list out all the paging space details?       #lsps –a       
How to list out the consolidate paging space size?  #lsps –s
CREATE
How to create the paging space
#mkps –s <no of pp> -n –a rootvg       mkps –s 8 –n –a rootvg
INCREASE
How to Increase the Paging space?
#chps –s <no of pp> <paging name>       chps –s 8 paging00
DECREASE
How to decrease the paging space?
#chps –d <no of pp> <paging name>      chps –d 4 pagin00
DELETE
How to delete the paging space?
#swapoff /dev/<paging name>               swapoff /dev/paging00
#rmps <paging name>                            rmps paging00
CONFIGURATION FILE
All the paging space is defined in /etc/swapspaces.       # cat /etc/swapspaces
ENABLE
How to enable the paging space?      #swapon /dev/pagin00
DISABLE
How to disable the paging space?     #swapoff /dev/paging00