Wednesday, November 28, 2012

IFIX


IFIX
=============

To list the emergency fix (ifix)?
# emgr -l

To Get some information from the downloaded ifix about itself?
# emgr -d -e <IFIX_Package>      (-d Display content, -e ifix package name/location)

To Preview install installation of the ifix?
#emgr -p -e <IFIX_Package>       (-p preview)

To actual installation of the ifix?
# emgr -e <IFIX_Package>

To view the ifix status?
#emgr -l

ID  STATE LABEL      INSTALL TIME      UPDATED BY ABSTRACT
=== ===== ========== ================= ========== ======================================
1   *Q*   IV16587s02 03/06/12 04:08:29            Ifix for IV16587@6.1TL7SP2

STATE codes:
 S = STABLE
 M = MOUNTED
 U = UNMOUNTED
 Q = REBOOT REQUIRED
 B = BROKEN
 I = INSTALLING
 R = REMOVING
 T = TESTED
 P = PATCHED
 N = NOT PATCHED
 SP = STABLE + PATCHED
 SN = STABLE + NOT PATCHED
 QP = BOOT IMAGE MODIFIED + PATCHED
 QN = BOOT IMAGE MODIFIED + NOT PATCHED
 RQ = REMOVING + REBOOT REQUIRED

So for the above ifix "REBOOT" is required. bcoz the state metioned as "*Q*"

Wednesday, November 21, 2012

Backup and restore the VIOS using mksysb image


Backing up the VIOS to a remote file system by creating a mksysb image

You can back up the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata to a remote file system by creating a mksysb file.
Backing up the VIOS to a remote file system will create the mksysb image in the directory you specify. The mksysb image is an installable image of the root volume group in a file.
Before you start, complete the following tasks:
  • If you plan to restore the VIOS from a Network Installation Management (NIM) server, verify that the NIM server is at the latest release of AIX®To find the latest updates, see the Fix Central website.
  • Ensure that the remote file system is available and mounted.
  • Ensure that the VIOS has root write access to the server on which the backup will be created.
To back up the VIOS to a remote file system, complete the following steps:
  1. Create a mount directory where the backup image, mksysb image, will be written. For example, to create the directory /home/backup, enter:
    mkdir /home/backup
  2. Mount an exported directory on the mount directory. For example, enter the following command from the VIOS command line:
    mount server1:/export/ios_backup /home/backup
    where server1 is the NIM server from which you plan to restore the VIOS.
  3. Run the backupios command with the -file option from the VIOS command line. Specify the path to the mounted directory. For example:
    backupios -file /home/backup/filename.mksysb -mksysb
    where filename is the name of mksysb image that this command creates in the specified directory. You can use the mksysb image to restore the VIOS from a NIM server.
  4. If you plan to restore the VIOS to a different host from which it was backed up, back up the user-defined virtual devices.

Restoring the VIOS from a NIM server using a mksysb file

You can restore the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata from a mksysb image stored in a remote file system.
Before you start, complete the following tasks:
  • Ensure that the server to which you plan to restore the VIOS is defined as a Network Installation Management (NIM) resource.
  • Ensure that the mksysb file (that contains the backup of the VIOS) is on the NIM server.
To restore the VIOS from a mksysb image in a file system, complete the following steps:
  1. Define the mksysb file as a NIM resource, specifically, a NIM object, by running the nim command. To view a detailed description of the nim command, see nim Command. For example:
    nim -o define -t mksysb -a server=servername -alocation=/export/ios_backup/
    filename.mksysb objectname
    where:
    • servername is the name of the server that holds the NIM resource.
    • filename is the name of the mksysb file.
    • objectname is the name by which NIM registers and recognizes the mksysb file.
  2. Define a Shared Product Object Tree (SPOT) resource for the mksysb file by running the nim command. For example:
    nim -o define -t spot -a server=servername -a location=/export/ios_backup/
    SPOT -a source=objectname SPOTname
    where:
    • servername is the name of the server that holds the NIM resource.
    • objectname is the name by which NIM registers and recognizes the mksysb file.
    • SPOTname is the NIM object name for the mksysb image that was created in the previous step.
  3. Install the VIOS from the mksysb file by using the smit command. For example:
    smit nim_bosinst
  4. Ensure that the following entry fields contain the following specifications.
    Table 1. Specifications for the SMIT command
    FieldSpecification
    Installation TYPEmksysb
    SPOTSPOTname from step 2
    MKSYSBobjectname from step 2
    Remain NIM client after install?No
  5. Start the VIOS virtual server. For instructions, see step 3, boot the VIOS, of Installing the VIOS using NIM.
  6. If you restored the VIOS to a different host from which it was backed up, you must restore the user-defined virtual devices.

Backup and restore the VIOS using nim_resources.tar file


Backing up the VIOS to a remote file system by creating a nim_resources.tar file

You can back up the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata to a remote file system by creating a nim_resources.tar file.
Backing up the VIOS to a remote file system will create the nim_resources.tar image in the directory you specify. The nim_resources.tarfile contains all the necessary resources to restore the VIOS, including the mksysb image, the bosinst.data file, the network boot image, and the Shared Product Object Tree (SPOT) resource.
The backupios command empties the target_disks_stanza section of the bosinst.data file and sets the following value:
RECOVER_DEVICES=Default
This setting allows the mksysb file generated by the command to be cloned to another virtual server. If you plan to use the nim_resources.tar image to install to a specific disk, repopulate the target_disk_stanza section of the bosinst.data file and replace this file in the nim_resources.tar image. All other parts of the nim_resources.tar image must remain unchanged.
Before you start, complete the following tasks:
  • Ensure that the remote file system is available and mounted.
  • Ensure that the VIOS has root write access to the server on which the backup will be created.
To back up the VIOS to a remote file system, complete the following steps:
  1. Create a mount directory where the backup image, nim_resources.tar, will be written. For example, to create the directory/home/backup, enter the following command:
    mkdir /home/backup
  2. Mount an exported directory on the mount directory. For example, enter the following command from the VIOS command line:
    mount server1:/export/ios_backup /home/backup
  3. Run the backupios command with the -file option from the VIOS command line. Specify the path to the mounted directory. For example:
    backupios -file /home/backup
    This command creates a nim_resources.tar file that you can use to restore the VIOS from the IBM® Systems Director Management Console (SDMC).
  4. If you plan to restore the VIOS to a different host from which it was backed up, back up the user-defined virtual devices.

Restoring the VIOS from the SDMC using a nim_resources.tar file

You can restore the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata from a nim_resources.tar image stored in a remote file system.
To restore the VIOS from a nim_resources.tar image in a file system, complete the following steps:
  1. Run the smcli psm installios command from the IBM® Systems Director Management Console (SDMC) command line. This action restores a backup image, nim_resources.tar, that was created by using the backupios command.
  2. Follow the installation procedures according to the system prompts. The source of the installation images is the exported directory from the backup procedure. For example, server1:/export/ios_backup.
  3. When the restoration is finished, open a virtual terminal connection (for example, using Telnet) to the VIOS that you restored. Some additional user input might be required.
  4. If you restored the VIOS to a different host from which it was backed up, you must restore the user-defined virtual devices.

Backing up and Restore the VIOS to one or more DVDs


  1. Backing up the VIOS to one or more DVDs
    You can back up the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata to DVD.
    To back up the VIOS to one or more DVDs, complete the following steps. Only DVD-RAM media can be used to back up the VIOS.
    Note: Vendor disk drives might support burning to additional disk types, such as CD-RW and DVD-R. See the documentation for your drive to determine which disk types are supported.

    1.    Assign an optical drive to the VIOS virtual server.
    2.    Obtain the device name by entering the following command from the VIOS command line:
    lsdev -type optical
    If the device is in the Defined state, enter the following command from the VIOS command line:
    cfgdev -dev dev
    3.    Run the backupios command with the -cd option from the VIOS command line. Specify the path to the device. For example:
    backupios -cd /dev/cd0
    Note: If the VIOS does not fit on one DVD, the backupios command provides instructions for disk replacement and removal until all the volumes have been created.
    This command creates one or more bootable DVDs that you can use to restore the VIOS.
    4.    If you plan to restore the VIOS to a different host from which it was backed up, back up the user-defined virtual devices.



    Restoring the VIOS from one or more DVDs.


    You can restore the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata from one or more DVDs.
    To restore the VIOS from one or more DVDs, complete the following steps:
    1. Specify the VIOS virtual server to boot from the DVD by using the bootlist command from the VIOS command line. Alternatively, you can change the bootlist in the System Management Services (SMS).
    2. Insert the DVD into the optical drive.
    3. From the SMS menu, select to install from the optical drive.
    4. Follow the installation steps according to the system prompts.
    5. If you restored the VIOS to a different host from which it was backed up, restore the user-defined virtual devices.

Wednesday, November 7, 2012

Backing up and Restore the VIOS to tape

For Backup the vios to tape

We can back up the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata to tape.


To back up the VIOS to tape, complete the following steps:

1.    Assign a tape drive to the VIOS.

2.    Get the device name by entering the following command from the VIOS command line:
                                         #lsdev -type tape

If the tape device is in the Defined state, enter the following command from the VIOS command line, where dev is the name of your tape device:
                                         #cfgdev -dev dev

3.    Enter the following command from the VIOS command line, where tape_device is the name of the tape device that you want to back up to:
                                         #backupios -tape tape_device

This command creates a bootable tape that you can use to restore the VIOS.

Note: If we plan to restore the VIOS to a different system from which it was backed up, we need to back up the user-defined virtual devices.


For Restoring the vios to from tape

We can restore the Virtual I/O Server (VIOS) base code, applied fix packs, custom device drivers to support disk subsystems, and some user-defined metadata from tape.

To restore the VIOS from tape, complete the following steps:

1.    Specify the VIOS virtual server to boot from the tape by using the bootlist command. Alternatively, you can change the bootlist in the System Management Services (SMS).

2.    Insert the tape into the tape drive.

3.    From the SMS menu, select to install from the tape drive.

4.    Follow the installation steps according to the system prompts.

Note: If you restored the VIOS to a different host from which it was backed up, restore the user-defined virtual devices



Tuesday, November 6, 2012

How to find out the actual memory consumption of the server


The command svmon -G can be used to determine the actual memory consumption of a server. To determine if the memory is overcommitted, you need to divide the memory-virtual value by the memory-size value, e.g.:
# svmon -G
               size       inuse        free         pin     virtual
memory      5079040     5076409        2631      706856     2983249
pg space    7864320       12885
               work        pers        clnt       other
pin          540803           0        2758      163295
in use      2983249           0     2093160
PageSize   PoolSize      inuse       pgsp        pin    virtual
s   4 KB          -    4918761      12885     621096    2825601
m  64 KB          -       9853          0       5360       9853
In this example, the memory-virtual value is 2983249, and the memory-size value is 5079040. Note that the actual memory-inuse is nearly the same as the memory-size value. This is simply AIX caching as much as possible in its memory. Hence, the memory-free value is typically very low.

Now, to determine the actual memory consumption, devide memory-virtual by memory-size:
2982321/5079040
.58
Thus, the actual memory consumption is 58% of the memory.

Total memory = 19840 MB

Actual memeory consumption size:  58%*19840=11507 MB

The free memory is thus: (100% - 58% ) * 19840 MB = 8332 MB.

Try to keep the value of memory consumption less than 90%. Above that, you will generally start seeing paging activity using the vmstat command. By that time, it is a good idea to lower the load on the system or to get more memory in your system.


How to find out the Free memory in AIX?



Using the svmon -G command and some calculation we can find out the free memory in aix servers.

#svmon -G

                        size              inuse        free         pin     virtual
memory         2031616      451147     1580469      229041      330471



Free memory = free*4/1024 --> (size in MB)  (1580469 *4/1024)  ---> 6173 MB



## use the below script to find out the current memory status.

----------------------------------------------------------------------------------

#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {'print $3'}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {'print $2'}`
tm=`expr $tm / 1000`
fm=`expr $tm - $um`
echo "\n\n-----------------------";
echo "System : (`hostname`)";
echo "-----------------------\n\n";
echo "Memory Information\n\n";
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $um MB"
echo "\n\n-----------------------\n";

Output of the scripts will look like below.

----------------------------------------------
System : (Hostname of the Server)
----------------------------------------------
Memory Information

total memory = 8126 MB
free memory = 6173 MB
used memory = 1953 MB
----------------------------------------------




Friday, November 2, 2012

How to find out the highly utilized files on the filesystem in AIX and Linux?


We always received a filesystem high utilization warning in our day to day activity. At that time we are in the situation to perform the housekeeping activity, for that we need to find out the highly utilized files under the filesystem. The below commands make our work very simply.

Here Pls assumed that /var filesystem utilizing more. (You can change the filesystem name on your own as per the FS alert you received.) 

For AIX: 

The above command list out the highly utilized 20 files under /var filesystem.

find /var -xdev -ls|sort +6rn|head -20     


For Linux:

The below command list out the highly utilized 20 files under /var filesystem.

du -ah /var | grep -i '^[0-9]\{1,\}m' | sort -nr|head -20     ---> (list the files in the size of MB)
du -ah /var | grep -i '^[0-9]\{1,\}g' | sort -nr|head -20      ---> (list the files in the size of GB)