Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

trustchk: Verification of attribute failed:

While running bosboot -a, Sometimes we may encounter trustchk: Verification of attribute failed: /etc/rc.teboot failed. This is due to trustbase has been enabled on the Server and So if the trustchk is failed, we need to verify or scan the file with trustchk command.

To Scan the file and automatically fix it, Need to execute below command.

# trustchk -y /etc/rc.teboot




Media Speed Not Showing for 10 Gigabit-SR Ethernet PCI-X Adapter (1410ba02) and 10 Gigabit Ethernet-SR PCI-X 2.0 DDR Adapter (1410eb02)


The driver installed on AIX for 10 Gigabit-SR Ethernet PCI-X Adapter (1410ba02) and 10 Gigabit Ethernet-SR PCI-X 2.0 DDR Adapter (1410eb02) does not provide the opportunity to vary the media speed so it and its data structures don't maintain any information regarding this parameter thus there is no information gathered by netstat. For this reason no media speed display has been coded into the device specific netstat/entstat

10GB Ethernet are Fiber and only run at 10GBit. .  There is no facility to change duplexity or speed and there is no autonegotiation as well

Ref:
http://www-01.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.kernextc/gigabit_ethernet_sr-pci-x-ddr-adapter.htm 

Viewing the contents of a disk without varying on the VG in AIX


To view a disk without varying it on:

# lqueryvg -p hdisk0 -L
00c9b6fb00004c000000013a8c97f698.1   backup_lv 1
00c9b6fb00004c000000013a8c97f698.2   loglv01 1
00c9b6fb00004c000000013a8c97f698.3   fslv19 1
00c9b6fb00004c000000013a8c97f698.4   was70bkp 1
00c9b6fb00004c000000013a8c97f698.5   paging00 1
00c9b6fb00004c000000013a8c97f698.6   fixes_lv 1

Finding Library Dependencies

Have you ever wondered which libraries are being called by a binary or utility?

The AIX package “freeware.aix.tools.rte” includes the “ldd” binary which shows the shared libraries called by an executable. This example shows the shared libaries called by the ping executable. # /usr/local/bin/ldd /usr/sbin/ping
/usr/lib/libbind.a(shr.o)
/usr/sbin/ping
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libc.a(shr.o)

Remember that some “.o” files are stored with “.a” files. To examine the contents of a “.a” file use the command: ar -tv
E.g.
# ar -tv /usr/lib/libcrypt.a
rwxr-x—   300/1       4638 Mar 28 20:46 2010 shr.o

List of AIX Logs

AIX Logs:



/var/adm/ras/lvmcfg.log         # lvm log file shows what lvm commands were used (alog  -ot lvmcfg)
alog -L                   #  List the defined log types
alog -o -t boot                 #  View the boot log
alog -o -t console          #  View the console log

Find Comand in AIX

find / -xdev -type f -name "cor*" -size +10000c -exec ls -l {} \;

    /                        where to find
    -xdev                    looks only in the given fs
    -type f                  what type to look for (f: file, d: direcory)
    -name "cor*"             name to look for
    -size +10000c            search for the given size (+10000c : greater than 10000 character (larger then 10kbyte))
    -size +2                 search for greater than 1kbyte (bloxk size is 512 byte, that's why +2 is given)
    -exec ls -l {} \;        what command to execute
                             ({}: it represents each findings and \; is needed at the end of line)
                             e.g. find /home -xdev -name "*.old" -exec rm {} \;
    -mtime -1                file modifocation date is less then 1 day (+1 means older than 1 day)

find . -name '*.ksh' -ok rm {} \;                     this will ask if the command (rm) should be  executed or not (much safer if find is not perfect)

find /etc/rc.d -ls           it lists the files and dirs in the given dir

find /tmp/bb -exec awk '/func/ {print FILENAME}' {} \;   it will check in /tmp/bb if any files contains the word "func" and list those

How to check FCS Adapter Speed on AIX

To Check  Fiber Channel  Device Driver  Speed Details.

# fcstat <fcs#> | grep -i port.



 Once HBA Card is plugged in and negotiate, the link speed should stay as it is and it will follow the speed of the switch. The adapter automatically negotiates with the switch to the highest speed of which the switch is capable (2GB,4GB and 8 Gb).


8- GB FC adapter :
  

 LEDs on each port provide information on the status and link speed of the port.





How to view system Serial Number in AIX


# lsconf | grep -i "Machine Serial"

# prtconf | grep -i "Machine Serial"

# lsattr -El sys0 -a systemid


Recovery From A Deleted /dev Directory in AIX

Note that AIX recreates most of /dev on boot, but we need a certain amount.

========================================
=======
Problem(Abstract): The /dev directory was accidentally deleted.
===============================================
Symptom: System wont boot
===============================================
Environment: AIX 5.3 (and others)
==============================================
Resolving the problem

Boot system into maintenance mode.
Access a root volume group before mounting filesystems

mount /dev/hd4 /mnt
mount /dev/hd2 /mnt/usr
mknod /mnt/dev/hd1 b 10 8
mknod /mnt/dev/hd2 b 10 5
mknod /mnt/dev/hd3 b 10 7
mknod /mnt/dev/hd4 b 10 4
mknod /mnt/dev/hd5 b 10 1
mknod /mnt/dev/hd6 b 10 2
mknod /mnt/dev/hd8 b 10 3
mknod /mnt/dev/hd9var b 10 6
umount /mnt/usr
umount /mnt
shutdown -Fr

To change the permission for soft link in AIX

# chown -h <source>

# ln -s <destination> <source>

E-trust Upgrade


The following is the instructions to perform the upgrade                            

Step 0: login with your own credential and sesu to root.                            

Step 1: backup eTrust software and un-load eTrust Kernel                            

         # /swd/sys2/eTrust/eTrustAC125sp5/scripts/0.5/backup_ac_main.scr                      

Step 2, if unload eTrust Kernel is not successful, DO NOT proceed the upgrade,                 
            DO NOT reboot the server. Please restart the eTrust service daemons and verify eTrust.    

                1)Shutdown eTrust                                        
                   # secons -s                                              

                2)Ensure selogrd is terminated                                  
                   # ps -ef |grep selogrd                                        

                3) List eTrust processes                                        
                   # issec                                              

                4) Reload eTrust                                              
                   # seload                                              

                5) Check any untrust objects                                  
                   # selang -c "sr PROGRAM *" | grep untrust                            
                                                           
                6) Re-trust programs                                        
                   # seretrust| selang                                        
                                                           
                7) # sesu -                                              
                                                           
Step 3. if unload eTrust kernel is successful, proceed the upgrade                      
                                                           
# /swd/sys2/eTrust/eTrustAC125sp5/scripts/0.5/upgrade_ac_main.scr                      
                                                           
Step 4: connect eTrust to EM (Enterprise Manager)                                  
                                                           
# /swd/sys2/eTrust/eTrustACinstall/update_em_dr_client.scr                            
                                                           
Step 5: update work sheet with comment and attach the updated work sheet in the work info area.    
                                                           
Step 6: Misc commands for your reference if you are interested, but not needed.                
                                                           
## list eTrust Version                                              
# /usr/seos/bin/seversion /usr/seos/bin/sesu                                  
                                                           
## list process managed by eTrust Kernel when un-load eTrust Kernel failure.                
# /usr/seos/bin/secons -sc                                              
                                                           
## unload eTrust Kernel                                              
# /usr/seos/bin/SEOS_load -u                                              
                                                           
## list EM connection                                              
#/usr/seos/bin/selang -c "so l"

IBM Tape 4mm Data Cartridge.

 
Lock and unlock of Tape.


If the white is complete. Then it is not lock. You can read and write.

If the white is inside. Then it is locked. You can only read.






Nested Filesystem Mounting and Unmounting


For unmounting the filesystem except rootvg filesystem. Below command helps to unmount the child filesytem first, then to unmount parent.

# lsvg -o |grep -v rootvg|lsvg -il  |awk '{print "umount "$NF}'|sort -r |ksh


For Mounting Filesystem except rootvg filesystem.Below command helps to mount parent filesystem before the child filesystem.

# lsvg -o |grep -v rootvg|lsvg -il  |awk '{print "mount "$NF}'|sort  |ksh

TWS Agent Start and Stop on AIX Server

# /opt/TDWB/ep/runtime/endpoint.sh  stop
# /opt/TDWB/ep/runtime/endpoint.sh  start
# ps -ef | grep -i TDWB

SNAP in AIX


Before running a snap .You need to Remove  old snap file.
# snap -r
 
For IBM Software Case.
Below command collect all the information.
# snap -ac  

For IBM Hardware Case
# snap -gc

snap  without  dump collection
# snap -aZc


# snap -gbc

Running snap with sudo. if  there is no authorization to run cp command.
Create file  snap.pax.Z in /tmp with your permissions and execute.
# snap -ac -d /tmp/


Flags:

-@         Gathers the workload partition information.
-a           Gathers all system configuration information except HACMP™ data.
-A          Gathers asynchronous (TTY) information.
-b           Gathers SSA information.
-B          Bypasses collection of SSA adapter dumps. The -B flag only works when the -b flag is also   specified
-c          Creates a compressed pax image.
-C         Retrieves all the files in the fwdump_dir directory.
-D         Gathers dump and /unix information. The primary dump device is used.
-d          AbsolutePath  (You must specify the absolute path.)
-e          Gathers HACMP specific information. -e cannot be used with any other flags except -m and -d.
-f          Gathers file system information.
-F         Gathers flash adapter information.
-g         Gathers the output of the lslpp -hac command, which is required to recreate exact operating system environments.
-G        Includes predefined Object Data Manager (ODM) files in general information collected with the -g flag.
-i         Gathers installation debug vital product data (VPD) information.
-k        Gathers kernel information
-l         Gathers programming language information.
-L        Gathers LVM information.
-m Nodelist             Node name list (separated by commas) to gather HACMP information.
-M Timeout             Specifies the maximum time out value in seconds, that the snap frame work waits before it kills one registered external product debug data command. Default time out value is 300 seconds.
-n          Gathers Network File System (NFS) information.
-N         Suppresses the check for free space required.
-o OutputDevice     Copies the compressed image onto the specified device.
-O FileSplitSize      Used to enable splitting of the snap output files into smaller files. The size of these files is specified as a parameter to the -O option and must be specified in megabytes. This flag can only be used when the -c flag is specified.
-p         Gathers printer information.
-P Files             Retrieves the named Files from the fwdump_dir directory.
-r         Removes snap command output from the /tmp/ibmsupt directory.
-R        Gathers SCSI RAID information.
-s         Gathers Systems Network Architecture (SNA) information.
-S         Includes security files in general information collected with the -g flag.
-t          Gathers Transmission control protocol information.
-T Filename        Gathers all the log files for a multi-CPU trace. Only the base file, trcfile, is captured with the -g flag.
-v Component        Displays the output of the commands executed by the snap command. Use this flag to view the specified name or group of files.
-w          Gathers WLM information.
-X         Gathers X.25 (Packet-based Communication Protocol) information.
-Y         Gathers InfiniBand information and saves it in the /tmp/ibmsupt/IB directory.
-z          Facilitates debug data collection for external products.

ITM Agent on AIX Server


To View the agent running on Server
  # /IBM/itm/bin/cinfo -r

To Start an Agent
  # /IBM/itm/bin/itmcmd agent  start all 
         {all can be replaced with ul/ux/um}

 To Config Agent
 # /IBM/itm/bin/itmcmd config -A  ul
   {ul/ux/um}

USB Drive Mount Procedure on AIX Server.

1.Connect the USB drive to the server and discover it in OS.
      #cfgmgr

2. Find the newly detected USB device name:
     #lsdev -C|grep usbms

    Ex: assume the newly detected device name is usbms0

3. create the filesystem on USB drive:
           #mkfs -V jfs2 -o ea=v2 /dev/usbms0
4. Create the mount point and mount the drive on it.
       #mkdir /usbdrive
       #mount -o log=NULL /dev/usbms0 /usbdrive
5. Check is drive mounted or not:
        # df -g|grep usbdrive
6. copy the data to it
        #cp /work/test.txt /usbdrive
        #ls -l /usbdrive  -- should show test.txt file in it.

Convert the EMC power disk as a boot disk



Convert the EMC power disk as a boot disk

1. Ensure that all hdisks are configured properly

2. Use the rmdev command with the -d option to remove all
   PowerPath devices, including the powerpath0 device. All PowerPath
   Devices must be deleted. 

  #lsdev -Cc disk|grep power|awk '{print "rmdev -Rdl "$1}'|ksh
  #rmdev -dl powerpath0

4. Run lsdev -Ct power. No devices should be listed in the output.

5. Determine which hdisks on the storage system will receive the copy Of the operating system. 
  
6. Run alt_install_disk -C hdisk_list to create the copy on the  storage system hdisk(s).

7. Reboot the system.The system should boot using the hdisks specified

8. Run bootlist -m normal -o to determine which hdisk is in the bootlist.

9. Use powermt to determine which hdiskpower contains the hdisk in the boot list.
  
10. Use the bootlist command to include all the path hdisks for the hdiskpower

11. Run pprootdev on.

12. Reboot the system.
When the system comes up, rootvg should be using hdiskpower devices. Ensure that all device connections to the storage system are established.
   
Bosboot on power disk


When rootvg on power disk, we cannot run bos boot as this is psudo device

Follow the below steps for bosboot on power disk

1. #pprootdev fix ( rootvg will activate on hisks and execute the bosboot

2. #pprootdevfixback ( Again rootvg will activate on power disk)