Tuesday, May 28, 2013

HP-UX - Find out the serial number of the server

Itanium
#machinfo

PA-RISC
#getconf MACHINE_SERIAL

HP-UX - How to check the kernel parameter utilization?

Lets assume we are checking the utilization of shmmax
#kcusage
Tunable Usage / Setting 
============================================= 
dbc_max_pct 5 / 50 
maxdsiz 37666816 / 1073741824 
maxdsiz_64bit 7258112 / 4294967296 
maxfiles_lim 56 / 8192 
maxssiz 1179648 / 8388608 
maxssiz_64bit 20480 / 268435456 
maxtsiz 421888 / 100663296 
maxtsiz_64bit 237568 / 1073741824 
maxuprc 0 / 256 
max_thread_proc 57 / 256 
msgmni 2 / 512 
msgseg 0 / 8192 
msgtql 0 / 1024 
nfile 586 / 65536 
nflocks 20 / 4096 
ninode 653 / 4880 
nkthread 484 / 8416 
nproc 150 / 4200 
npty 0 / 60 
nstrpty 0 / 60 
nstrtel 0 / 60 
semmni 23 / 2048 
semmns 25 / 8192 
shmmax 17906400 / 68719476736  --- Utilization is 17906400 of 68719476736
shmmni 7 / 400 

HP-UX - How to set the kernel parameter?

Lets assume that we need to change the kernel parameter shmmax.

Kctune is used to change the kernel parameter.
kctune shmmax=4398046511104

Tuesday, May 21, 2013

Solaris - Find out the serial number of the server?


How to find out the serial number of the server by running prtdiag command?
root@Server1:~ # prtdiag -v > /var/tmp/prtdiag.out; sed -n '/^Ch/{p;n;n;p;}' /var/tmp/prtdiag.out; rm /var/tmp/prtdiag.out
Chassis Serial Number
0000XXX000

Monday, May 20, 2013

Redhat- How to find the Hardware Model on linux ?


Dmidecode reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard

#dmidecode

This information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details of varying level of interest and reliability depending on the manufacturer. This will often include usage status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of I/O ports (e.g. serial, parallel, USB).

Aix -How to find RAM on the server?


The bootinfo command uses the device configuration databases in information searches.
Just type the following command as the root user:
#bootinfo -r
It will displays amount of real memory in kilobytes. bootinfo command may not be available in latest AIX UNIX version, try following command:

#lsattr -El sys0 | grep realmem

Aix- How to check if kernel is 32bit or 64 bit?

KERNEL_BITMODE

# getconf KERNEL_BITMODE
64

HARDWARE_BITMODE

# getconf HARDWARE_BITMODE
64

Redhat Linux - How to for GFS Filesystems

How-to for GFS Filesystems

You can use either of the following formats to create a clustered GFS file system:
#gfs_mkfs -p lock_dlm -t ClusterName:FSName -j Number BlockDevice
#mkfs -t gfs -p lock_dlm -t LockTableName -j NumberJournals BlockDevice

You can use either of the following formats to create a local GFS file system:
#gfs_mkfs -p lock_nolock -j NumberJournals BlockDevice
#mkfs -t gfs -p lock_nolock -j NumberJournals BlockDevice

At each node, mount the GFS file systems. For more information about mounting a GFS file
Command usage:
mount BlockDevice MountPoint
mount -o acl BlockDevice MountPoint
The -o aclmount option allows manipulating file ACLs. If a file system is mounted without the -o acl mount option, users are allowed to view ACLs (with getfacl), but are not allowed to set them (with setfacl).

Formatting the logical Volume
#gfs_mkfs -p lock_dlm -t alpha:mydata1 -j 8 /dev/vg01/lvol0

The gfs_jadd command must be run on mounted file system, but it only needs to be run on one node in the cluster. All the other nodes sense that the expansion has occurred.

#lvextend -L +80G /dev/vgcl_gfs_san_eos/vol01_lv
#gfs_grow -v /dev/vgcl_gfs_san_eos/vol01_lv /db/eospr1/vol01

Aix -How to find processor Type on IBM Power Systems

Find the type of processor on AIX

Method 1-Using lsattr

#lsattr -El proc0|grep type
type        PowerPC_POWER6 Processor type        False

# lsattr -El proc0|grep type
type        PowerPC_POWER7 Processor type        False


Method 2- Using lscfg

# lscfg -vpl proc0 |grep Name  Name:  PowerPC,POWER5

Sunday, May 19, 2013

HP-UX 11.23 mount: cdfs : Invalid argument" Error While Mounting a CD-ROM

While trying to mount the DVD on HP-UX 11.23 , we got the below error.

#mount /dev/dsk/c0t0d0 /cdrom  
mount: cannot access -specific mount command


#mount -F cdfs -o cdcase /dev/dsk/c0t0d0 /cdrom  
mount: cdfs : Invalid argument  



The DVD drive is claimed and online in the ioscan output.Other DVDs have been tried as well, but with the same results.

To resolve the issue, the cdfs kernel module was checked and found that the module was not loaded.

#kcmodule -B cdfs=loaded   
After loading the cdfs kernel module .The DVD was successfully mounted.

HP-UX - Timeout called with negative time" error in dmesg and syslog.log file


Error Message in dmesg and syslog.log on HP-UX 11.11


Timeout called with negative time.  function == 0x8647F8, arg == 0x41EC1C00, ticks == 0xF7E66F3E,  flags == 0x0    
Timeout called with negative time.  function == 0x8647F8, arg == 0x41EC1C00, ticks == 0xF7E66F3D,  flags == 0x0    


This normally happens due to the old mpt driver on the Operating system.

In my case the issue was resolved after upgrading the MPT driver. This issue is fixed with the B.11.11.0701. version of MPT driver.

Unlock a user account on Aix


Run the below commands to unlock the user account on Aix

#chsec -f  /etc/security/lastlog -a "unsuccessful_login_count=0" -userid
#chuser "account_locked=false" -userid

Reset Root Password on Linux (RHEL, Ubuntu)

Try and enter the run-level 1, if you already know it then follow the step 4 below.

1. Stop the system at the Grub Screen.
2. Use the arrows to select the boot entry you want to modify,  press e to edit the entry.
3. Use the arrows to go to kernel line , press e to edit this entry , at the end of the line add the word single

Press ESC to go back to the parent menu, press b to boot this kernel

4. Run passwd command to reset the password.

Redhat Linux 5,6 - How to Scan and configure new Luns from Storage?


SCAN AND CONFIGURE NEW LUNS on RHEL 5 and RHEL 6

If you have 4 fc ports on which you have assigned the storage luns.
Then you need to run the below for loop to scan the LUNS on all the 4 ports.

for i in host1 host2 host3 host0
> do
> echo "1" > /sys/class/fc_host/$i/issue_lip
> echo "- - -" > /sys/class/scsi_host/$i/scan
> done

After this you can run fdisk -l or multipath -ll to see the new luns. Once the new luns are visible , you can use the luns using LVM or raw paritioning.

IF you want to rescan the disk lun then you can run the below command.


echo 1 > /sys/block/sda/device/rescan
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan

How to freeze and unfreeze the Service Group (SG) on Veritas Cluster Server (VCS)


Freeze the Service Group test_sg
#hagrp -freeze test_sg


Unfreeze the Service Group test_sg
#hagrp -unfreeze test_sg


Ignite-UX make_tape_recovery Fails with list_expander Error

While running the make_tape_recovery, you could get the below error.

#make_tape_recovery -x inc_entire=vg00 -a /dev/rmt/0mn command, the following error occurs:

ERROR: The list_expander command failed. This could be due to a problem with  the -x options specified - Check the existence of the included   device(s)

There could be a issue with filesystem which might be mentioned in the /etc/fstab by not mounted and due to which this error occurs.


Either mount the filesystem which is mentioned in the fstab or comment out the entry of the filesystem in fstab.

I fixed the issue in my environment as the issue was with a device listed in vg00 . It turned out that the /etc/fstab had a file system mounting to a device in vg00 that no longer existed.
Removing the entry in the /etc/fstab file resolved the issue.

Best of Luck!

Error Message: "Not a typewriter"


Information

Some of the most confusing error messages in HP-UX are the following:
Not a typewriter and ENOTTY
These error messages are not only limited to HP-UX, but are also common UNIX messages. In some systems, the errors may appear as the following:
Inappropriate ioctl for device and Not a teletype

Details

This messages are usually not the result of an error related to the I/O device. If a library routine fails for some reason unrelated to a system call, and a programmer calls the normal error reporting routine perror() on every failure, the leftover ENOTTY will result in an inappropriate Not a typewriter error message. So for Telnet and SSH cases, if a user name is not found in the password file, this error may occur.
This error is also related to terminal settings (Old UNIX systems use the term typewriter and of course, it can be said that this error message is obsolete). It means that the program attempts to perform some I/O operation that would be legal on a terminal, and returns with an error. The errors may be related to the terminal emulators if a remote connection is attempted.
In conclusion, to understand the exact issue, other symptoms and error messages need to be investigated.

Solaris 10 -Troubleshooting HBA Card or LUN Issue

Run the command fcinfo hba-port to get the WWPN and WWNN , Contact Storage Administrator to help you further with the PN and NN number, if the HBA port status is not showing as on-line.

# fcinfo hba-port
HBA Port WWN: 21000003ba9b1739   --WWPN
        OS Device Name: /dev/cfg/c1
        Manufacturer: QLogic Corp.
        Model: 2200
        Firmware Version: 02.01.145
        FCode/BIOS Version: ISP2200 FC-AL Host Adapter Driver: 1.15 04/03/22
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: L-port
        State: online
        Supported Speeds: 1Gb
        Current Speed: 1Gb
        Node WWN: 20000003ba9b1739  --WWNN
HBA Port WWN: 210000e08b80eee8 --WWPN
        OS Device Name: /dev/cfg/c2
        Manufacturer: QLogic Corp.
        Model: 375-3102-xx
        Firmware Version: 03.03.28
        FCode/BIOS Version:  fcode: 1.13;
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb
        Current Speed: not established
        Node WWN: 200000e08b80eee8 ---WWNN
HBA Port WWN: 210000e08b81e0d3  --WWPN
        OS Device Name: /dev/cfg/c3
        Manufacturer: QLogic Corp.
        Model: 375-3102-xx
        Firmware Version: 03.03.28
        FCode/BIOS Version:  fcode: 1.13;
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb
        Current Speed: not established
        Node WWN: 200000e08b81e0d3 --WWPN

Error fsadm: You don't have a license to run this program -Online JFS , Vxfs filesystem

How to resolve the error "fsadm: You don't have a license to run this program"  while extending the Veritas filesystem(vxfs)?

While you are extending your file-system, you have got the below error.
# fsadm -F vxfs -b 138500M /u01 
ERROR: fsadm: You don't have a license to run this program


1. Check weather the ONLINEJFS software has been installed on  HP-UX.

#swlist -l bundle |grep -i jfs   
 B3929CA               B.11.11        HP OnLineJFS    
 B3929DA               3.5-ga15-03    HP OnLineJFS 3.5  
2. Check the license type of OnlineJFS/VxFS installed on the server.
# vxlicrep
VERITAS License Manager vxlicrep utility version 3.00.007  
Copyright (C) VERITAS Software Corp 2002. All Rights reserved.  
Creating a report on all VERITAS products installed on this system   
-----------------***********************-----------------      
License Key                         = 012345678901234567890123 
Product Name                        = VERITAS File System     License Type                                = PERMANENT 
Site License                        = YES     
Features :=     
HP_OnlineJFS                        = Enabled 

3. Check the available VxFS and VxVM licenses and features on the system.
# vxlicense -p    
 vrts:vxlicense: INFO: Feature name: HP_OnlineJFS [50] 
 vrts:vxlicense: INFO: Number of licenses: 1 (non-floating)  vrts:vxlicense:   INFO: Expiration date: No expiration date 
 vrts:vxlicense: INFO: Release Level: 22  
vrts:vxlicense: INFO: Machine Class: All  
vrts:vxlicense: INFO: Site ID: 0   
4. Check if the OnLineJFS features were enabled and if you the following output.

 # vxenablef
  The system is not licensed.
Resolution:
Enabled the full functionality of OnlineJFS/VxFS in the kernel using the following command
# vxenablef –a 
After performing the above command, try to extend the file system through “fsadm” and it will work fine.


Veritas Cluster Server (VCS) - Adding a user account

Many faced problems while adding a user account to the Veritas Cluster Server online.

Here is what you need to do.


Make the configuration read-write
#haconf -makerw

Add the user admin1
#hauser -add admin1

Add the user admin1 to the Administrators Group
#haclus -modify Administrators -add admin1

Then again make the VCS configuration read-only.(It is always important to make it readonly)
#haconf -makero

Solaris 10 - Troubleshoot NIC or Network link failure

There could be few network components which can cause a network failure.

1. NIC card or a Network Card
2. The Network Cable
3. The connected switch

Lets try to understand how we can troubleshoot these issues.

First check if the IP Address is already assigned to the network interface by running the ifconfig command.

1. In my case, we  have interface ce0 which already has a IP assigned and the status is showing as up.

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.192.1.10netmask ffffff00 broadcast 10.192.XX.255
        ether 0:3:ba:9b:17:3a
ce1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.XX.XX netmask fffffe00 broadcast 192.168.XX.255
        ether 0:3:ba:9b:17:39

Though the interface is showing as up ,now lets check the link status.

# dladm show-dev
ce0             link: down      speed: 0     Mbps       duplex: unknown
ce1             link: up        speed: 1000  Mbps       duplex: full
#

Now the link is showing as down, now lets try to find out the failure

Action Plan to Eliminate components
a. First change the cable to see if the cable has a problem -Eliminate cable
b. Check from the network team if there is a issue with the switch. -Eliminate switch
c. If both the above components are good then get the network card changed.


Redhat Linux -Troubleshooting SAN Lun unavailability and HBA Issue


First , we will try to understand the Scenario  Suppose the LUN is coming from a storage and it is being used on Redhat Linux in LVM. Now when you run df -k, you see errors.

#df -k - This gives an error on the filesystem

Run pvs  -This will give us the details of the disk.
Look at the left column of PV, this will give you the details disks present in the volume group vgora

#pvs

  PV              VG     Fmt  Attr PSize   PFree
  /dev/emcpoweray vgora  lvm2 a--  101.15G    0
  /dev/emcpowerx1 vgora  lvm2 a--  139.70G 9.70G
  /dev/sda2       vgroot lvm2 a--   31.97G    0

Check the details of the HBA
a. HBA Port state
root@test1: # cat /sys/class/fc_host/host1/port_state
Online

b. HBA speed 
root@test1: # cat /sys/class/fc_host/host1/speed
4 Gbit

c.Port Name -WWPN
root@test1: # cat /sys/class/fc_host/host1/port_name
0x20010024e859e129

d.Node Name -WWNN
root@test1: # cat /sys/class/fc_host/host1/node_name
0x20000024e859e129

Provide the required info to the Storage team and they may help you to resolve the problem.

Configuring NFS on AIX

NFS services are being used for sharing the files across the Unix platform.

1. Update /etc/exports
directory     -option[,option]

Eg:

/home -root=ballet,access=ballet

2. Start the nfs services

startrc -s nfs

3. Check the status of the NFS services
lssrc -g nfs