Rename VG & LVOL in HP UX

Rename VG in HP UX

1.Unmount the FS in that VG

  #umount /mountpoint

2.Export the VG

  #vgexport -s -v -m /tmp/vgname.map /dev/vgname

3.#mkdir /dev/newvgname
  #mknod /dev/newvgname/group c 64 "minor no"

4.Import the VG now

  #vgimport -s -v -m /tmp/vgname.map /dev/newvgname

5.Vgchange -a y newvgname

6.vgcfgbackup newvgname

7.Edit the /etc/fstab and change the mount point to new VG name.

8. # mount -a


Rename a Lvol in HP UX



1. #umount /

 
2. #mv /dev/vgxx/ /dev/vgxx/

 
   #mv /dev/vgxx/r /dev/vgxx/r

 
3. Modify the /etc/fstab file to reflect the newname.

 
4. #mount /dev/vgxx/ /
or
  #mount -a

Configure stand by LAN for node on running Cluster : How to ??

consider cluster is having 2 nodes - nodeA and nodeB. and i added stand by lan for nodeB.


>>Login to the server nodeA

STEP 1 : remove the node from all package configuration
#cmviewcl -v

#cmgetconf -v -p pkgname pkngname.conf_new


Then remove the below line from the conf file

#vi pkgname.conf_new

NODE_NAME                 nodeB

save and exit

# cmcheckconf -v -P pkngname.conf_new

# cmapplyconf -v -P pkngname.conf_new



#cmviewcl -v -p pkngname.conf_new  -----> verify the node is removed from pkg config

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


STEP 2: Halt the node nodeB and remove the node from cluster


#cmviewcl -v

#cmhaltnode -v nodeB

#cmgetconf -v -c clustername cluster.ascii

Edit the cluster.ascii file and remove the node - nodeB  from that file


#NODE_NAME               nodeB
  NETWORK_INTERFACE     lan0
    HEARTBEAT_IP        10.161.1.58
  NETWORK_INTERFACE     lan2
    HEARTBEAT_IP        10.160.7.72



save and exit

#cmcheckconf -v -C cluster.ascii

#cmapplyconf -v -C cluster.ascii

#cmviewcl -v


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

STPE 3 : Add the node nodeB  to cluster with standby lan.

#cmgetconf -v -c cluster cluster.ascii

#edit the cluster.ascii and then add node nodeB with standby lan

NODE_NAME               nodeB
NETWORK_INTERFACE     lan0
HEARTBEAT_IP        10.161.1.58
NETWORK_INTERFACE     lan2
HEARTBEAT_IP        10.160.7.72
NETWORK_INTERFACE     lan3

save and exit.


#cmcheckconf -v -C cluster.ascii

#cmapplyconf -v -C cluster.ascii

Then start the cluster on nodeB

#cmrunnode -v nodeB

#cmviewcl -v

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

STPE 4 : Need to add the node to all the package  where this node already configured.


#cmgetconf -v -p pkgname  pkgname.conf_new

Then add the below line from the conf file

#vi pkgname.conf_new

NODE_NAME                 nodeb

# cmcheckconf -v -P pkgname.conf_new

# cmapplyconf -v -P pkgname.conf

#cmviewcl -v -p pkgname -----> verify the node is removed from pkg config

Adding new node to cluster - Steps for interview point

Steps for adding new node on running cluster

1. Set up on all nodes, the file /etc/cmcluster/cmclnodelist to include the new node name.

2.Get the most up-to-date ASCII configuration file (cmgetconf).

3.Query all nodes, including the new node, in the cluster (cmquerycl).

4.Compare the ASCII files obtained from cmgetconf and cmquerycl.

5.Update the ASCII configuration file obtained from cmquerycl.

6.Check the new ASCII configuration file (cmcheckconf).

7.Compile and distribute the new binary cluster configuration file (cmapplyconf).

8.Start cluster services on the new node (cmrunnode).

9.Check for any problems with cmviewcl and the logfile /var/adm/syslog/syslog.log.

Commands

1.#cmgetconf -v -c clustername /etc/cmcluster/cluster.ascii

2.Edit the /etc/cmcluster/cluster.ascii file and add the new node info

3.#cmquerycl -v -c cluster_name -n node1 -n node2 cluster.ascii

4.cmcheckconf -v -C cluster.ascii

5.cmapplyconf -v -C cluster.ascii

6.cmrunnode -v node2 (new node)

Restart NFS in HP UX : How To ?

In HP UX we need to follow the below order while stop/ start the NFS server. 

For Stop NFS : 

1./sbin/init.d/nfs.server stop 
2./sbin/init.d/nfs.client stop 
3./sbin/init.d/nfs.core stop 

For Start NFS: 

1./sbin/init.d/nfs.core start 
2./sbin/init.d/nfs.client start 
3./sbin/init.d/nfs.server start.

Mirror root VG in AIX

Steps to mirror the root VG :

# lspv   :  determine the hdisk#

# extendvg rootvg hdisk<number>  : To add the hdisk to the volume group
# lspv   :  verify that the hdisk has been successfully added to the volume group
# chvg -Q 'n' rootvg  : To change the quorum so that the vg will stay active if one of the mirrors fail
# mirrorvg -S -c 2 rootvg   :  mirror all of the logical volumes in the volume group
# lsvg -l rootvg  : verify successful mirroring (pps will appear "stale" until synchronization is complete).
# bosboot -a -d "disk"   :  update the boot image information
# bootlist -m normal -o hdisk0 hdisk1  : create a new bootlist
# bootlist -m normal -o  : verify the bootlist is correct

SMITTY in AIX

Lot of system admin tasks can be done by using the SMITTY utility in AIX.

Few Examples,

#smit mktcpip		# configure network parameters
#smit chfs # change file system, eg grow/extend it.
#smit lsprt # list printers (don't list all, may need to go thru long menu)
#smit installp # Add new software
#smit update # add patches
#smit update_all # automatic add patches to existing sw, no complain if patch is not relevant


smitty fastpath:

Action Prefix Device Abbreviation
------ ------ ------ ------------
(add) mk (printer) prt
(change) ch (tty) tty
(list) ls (pty) pty
(remove) rm (disk) dsk
(cdrom) cdr
(diskette) dskt
(tape) tpe
(adapter) adp
lang

Keystrokes:
F3 or ESC, 3 Cancel, go back
F4 or ESC, 4 Provide list of items to choose from
F6 or ESC, 6 Show command that smit will actually run
F10 or ESC, 10 Exit smitty
 
     





GSP Console reset in HP UX

>>  Save this script and run as root user ..It will reset the GSP console

#Chmod +x gspreset.sh
#./gspreset.sh

Script :
======
#!/usr/bin/ksh
####################################################################
#
# gspreset.sh
#
# This script will reset all GSP devicefiles
#
#####################################################################
#
for i in $(ls /dev/GSP*)
do
echo " checking GSP $i + reseting it - this will need some time (~30s)"
stty +queryGSP < $i
stty +resetGSP < $i
stty +queryGSP < $i
echo "-----------------------------------------------"
done

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





NTP service in HPUX - start / stop

  
Issue the below start/restart NTP in HP-UX :


    # /sbin/init.d/xntpd stop
    # /sbin/init.d/xntpd start



#ntpq -p   : To list ntp peers and their time sync status
#ntpq -p <server fqdn or ip address>  : To  lists time sync status with that server (slightly different detail than ntpq -p)

/etc/ntp.conf  --> NTP configuration file in HP-UX

Note : Changes to the NTP configuration require ntp daemon (xntpd) be stopped and restarted (restart is not recognized):

    #/sbin/init.d/xntpd stop
    #/sbin/init.d/xntpd start    





HP unix Interview Questions and answer : Part 1


1)how to find recently added lun in hp unix box ? 

#ls -lrt /dev/disk/* 

or 

#ls -ltr /dev/dsk/*

then take the latest dated disk path and check th lun path

#inq |grep -i "c?t?d?"

if you got /dev/disk/c?t?d? then get the legacy path and tehn check for lun path

#ioscan  -m dsf /dev/disk/c?t?d?
#inq |grep -i "c?t?d?"


2)how to create user and to be ask change passwd at login 

After created the user acc and password run the below command

#passwd -f user1

3)how to check routing table? 

# cat /etc/rc.config.d/netconf

or 

#netstat -rn


4)how to check the mac address? 

#lanscan 

USe the above command to get the MAC address.

5)how to identify patches which are related to oracle or sap patches? 

Answer need to find: ??

6)how to change kernel parameter in 11.11 and 11.31

in 11.31

#kctune parameter=value

before change the value check whether this parameter change required reboot or not 

$kctune -v parameter

in 11.31

#kmtune parameter=value 

  

Use of /etc./hosts.equiv on root user ?

Hi Anyone knows ..Whats is the use of /etc/hosts.equv - file  on root user ? If you know please reply or command to this post.

Enable / Disable Node switching in service guard cluster: How to ??

  
Consider its a 2 node cluster. If package got failed in nodeA then it should start on nodeB automatically means we need to enable node switching on both the node and we should enable AUTO_RUN option also.
(package name : prodpkg , server name : nodeA and nodeB )
root# cmviewcl -v -p prodpkg

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE
    prodpkg            halt              down               disabled       nodeA


    Node_Switching_Parameters:
      NODE_TYPE     STATUS       SWITCHING     NAME
      Primary              up            disabled          NODEA
      Alternate           up            disabled          NODEB


Note : Before enable node switching on both the node we should not enable AUTO_RUN.

#cmmodpkg -v -n nodeA -e prodpkg

#cmmodpkg -v -n nodeB -e prodpkg


Now on both the node package switching has enabled ..now u can start the package on primary node and then start the AUTO_RUN.



root# cmviewcl -v -p prodpkg

    PACKAGE        STATUS      STATE            AUTO_RUN    NODE
    prodpkg         halt              down              disabled    nodeA


    Node_Switching_Parameters:
      NODE_TYPE    STATUS       SWITCHING    NAME
      Primary          up              enabled        NODEA
      Alternate       up               enabled        NODEB

Now we can start the package on nodeA and then we can enable the AUTO_RUN.

#cmrunpkg -v -n nodeA prodpkg

#cmmodpkg -e prodpkg



root# cmviewcl -v -p prodpkg

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE
    prodpkg            halt              down                enabled       nodeA



    Node_Switching_Parameters:
      NODE_TYPE    STATUS       SWITCHING    NAME
      Primary      up           enabled     NODEA
      Alternate    up           enabled     NODEB

To disable the AUTO_RUN run the below command

#cmmodkg -d prodpkg

To disable package switching on one node

#cmmodpkg -v -n nodeB -d prodpkg




     


How to check memory size ?? How to get total memory size ?

Solaris
  1. dmesg | grep mem
  2. prtdiag | grep Memory
  3. prtconf -v | grep Memory

AIX

  1. bootinfo -r
  2. lsattr -E1 sys0 -a realmem
  3. getconf REAL_MEMORY

HPUX

  1. dmesg | grep Physical
  2. /opt/ignite/bin/print_manifest | grep Memory
  3. machinfo | grep Memory

Linux

  1. dmesg | grep Memory
  2. grep -i memtotal /proc/meminfo
  3. free

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks