Wednesday 30 November 2011

How to get cpu / processor / core info in Linux?

To get processor info we need to run below commands in Linux

1. #cat /proc/cpuinfo

or

2. #dmidecode

To get the core info in linux use the below commands. If the processor is dual core or quad core or single core processor means we will get the "core id"value in the below commands. If no core (single core) processor means we wont get the core id . so from the word "core id" we can get the processor is core processor or physical processor.

For examble here i took 2 servers ..

server1 - has 4 physical - single cored processors

server 2 - has 2 physical - dual core processors

4 Physical processor with no core (single core) means we will get o/p like below


root:server1# egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
processor : 1
processor : 2
processor : 3
root:server1#

To get core info (whether core is there or not)

root:server1# grep core\ id /proc/cpuinfo |uniq -d |wc -l
0

To get total no of physical processor

root:server1# grep core\ id /proc/cpuinfo | grep -c \ 0$ | grep ^0$ >> /dev/null && grep -c processor /proc/cpuinfo || grep core\ id /proc/cpuinfo | grep -c \ 0$
4


Two dual core processor means (2- physical processor) we will get o/p like below


root:server2# egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
core id : 0 ----------------- processor 1
cpu cores : 2
processor : 1
core id : 0 ----------------- processor 1
cpu cores : 2

processor : 2
core id : 1 ----------------- processor 2
cpu cores : 2
processor : 3
core id : 1 ----------------- processor 2
cpu cores : 2

root:server2#

To get core info run the below command

root:server2# grep core\ id /proc/cpuinfo |uniq -d |wc -l -------> this will give how many cores are there / if no core means it will give out put as 0.
2


To get how many physical processor is there on server ,then run below command

root:server2# grep core\ id /proc/cpuinfo | grep -c \ 0$ | grep ^0$ >> /dev/null && grep -c processor /proc/cpuinfo || grep core\ id /proc/cpuinfo | grep -c \ 0$
2


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

Friday 25 November 2011

Mount DVD in unix ?

Use the following procedure to mount a DVD-ROM on HP-UX 11i v2 (B.11.23):

1. Log in as root
2. Insert the DVD into the DVD-ROM drive and wait for the drive's busy light to stop blinking.
3. Find the DVD-ROM device file name using the following command:

ioscan -fn -C disk | more
/dev/dsk/c1t2d0 is a typical device name.

4. Create the mount point under root(/):

mkdir /dvdrom

5. Mount the DVD onto the new directory as a file system. For example, the following command mounts the /dev/dsk/c1t2d0 device as the /dvdrom directory:

mount /dev/dsk/c1t2d0 /dvdrom

Route add in HP Unix

Let us assume your router address is 192.168.1.254 and network ID is 192.168.1.0/24, then you can type route command as follows:
# route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.254
OR
To add a default route:
# route add default 192.168.1.254
Verify that (display) routing table is updated (display routing table):
# netstat -nr
Test it i.e. try to ping or send nslookup request:
# ping mycorp.com
To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f
However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file - /etc/rc.config.d/netconf. To add default router/gateway 192.168.1.254:

# vi /etc/rc.config.d/netconf
Add or modify following entries
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
Reboot HP-UX system/server to take effect

# shutdown -ry 0

Bundle All Patches in One Big Bundle - HP Unix

Creating one big bundle with all the extra patches you need to install will save your time during the upgrade/patching process and also prevent multiple reboots of your servers.

Create folder '/var/patches' with 'depot' and 'add' subfolders and copy the Quality Pack into '/var/patches/depot' and additional patches into '/var/patches/add' folder. Next you need to unpack the Golden Pack:

# swcopy -s /var/patches/depot/GOLDQPK11i_B.11.11.0612.459.depot \* @ /var/patches/depot/QPK

With swcopy copy all additional patches into this unpacked depot.


# for patch in /var/depot/app/*; do
echo ${patch}
swcopy -x enforce_dependencies=FALSE \
-x mount_all_filesystems=FALSE \
-x reinstall=TRUE -s ${patch} \* @ \
/var/patches/depot/QPK >> swcopy_patchs.log 2>&1 Verify that all the packages in the new bundle we create are OK.

# swverify -d -x mount_all_filesystems=FALSE \
-x enforce_dependencies=FALSE \* @ /var/patches/depot/QPK

Now, we have to revert the bundle into the original format for easier distribution.

# swpackage -x media_type=tape -s /var/patches/depot/QPK @ \
/var/patches/depot/GOLDQPK11i_B.11.11.0612.459.NEW.depot

You can use this file as any other regular depot file.

# swinstall -i -x patch_match_target=true -x autoreboot=true -s \
/var/patches/depot/GOLDQPK11i_B.11.11.0612.459.NEW.depot

Thursday 24 November 2011

Recover OS using Ignite Backup

HP-UX have a software to backup the OS called "Ignite". It bundled with OS installed. The easy way to make a OS backup is using tape data cartridge. Just plug the tape to tape library, and run command "make_tape_recovery -AI".

To restore OS using recovery tape, go to MP (management processor) and boot to tape (Sequential media) and follow the intructions.

To simplify manage the archive of OS backup, we can utilize "Ignite Server". We can make OS backup to disk (via network) in another server (Ignite Server).The command is "make_net_recovery -s ignite_server -x inc_entire=vg00″.

To recovery OS using ignite server (Client and Ignite server in same IP subnet):

1. Boot the failed system to Ignite server (boot lan install or boot lan.ip_ignite_server install)
2. Do not interact with ISL
3. Select "Install HP-UX" and follow the instructions to fill about server configurations (network, hostname, etc)

4. Select recovery configurations to use
If clients to use is different subnet, we must use a boot helper server. the boot helper server have same subnet with client server. to setting up boot helper:

* for example: IP Ignite server is 10.2.2.1 & GW 10.2.2.254, OS to be restored is restore01 and target client is client01 (10.2.3.1 & GW 10.2.3.254)

1. Make sure the boot helper server have Ignite software with same version with client & Ignite server
2. Point the installation to Ignite server
# instl_adm -t 10.2.2.1
3. To verify the correct configuration in boot helper, run command instl_adm -d
4. Specify the temporary ip address at boot helper that client can use to boot. Edit /etc/opt/ignite/instl_boottab

5. Copy the CINDEX & recovery directory from source (OS to be restored) to target client (server use to restore).
at Ignite Server:
# cd /var/opt/ignite/clients/restore01
# find CINDEX recovery | cpio -pvdma ../client01
# edit CINDEX file at target client (/var/opt/ignite/clients/client01/CINDEX)
- make a full path for system_cfg, control_cfg & archive_cfg. (/var/opt/ignite/clients/client01/../…..)

6. Boot to boot helper or direct to ignite server

Add SWAP in HP Unix : How to ?

How to add SWAP in hp Unix

To create swap, you need a contiguous space on a disk/LUN.
Create vg01:

pvcreate /dev/rdsk/c25t0d0
pvcreate /dev/rdsk/c25t2d0
vgcreate -s 8 -p 128 /dev/vg01 /dev/dsk/c25t0d0 /dev/dsk/c25t2d0
vgchange -a y /dev/vg01

lvcreate -C y -L 16384 -n lvswap /dev/vg01

/usr/sbin/swapon -f -p 3 /dev/vg01/lvswap

add to /etc/fstab:

/dev/vg01/lvswap … swap pri=3 0 0

Unix- LVM commonly asked Interview questions..

Regular tasks
I) How to create a Volume Group (VG).
II) How to create a Logical Volume (LV) and mount the file system.

III) How to add a disk to a Volume Group
IV) How to increase the size of a logical volume without OnlineJFS
V) How to remove a Logical Volume
VI) How to reduce the size of a logical volume without OnlineJFS (advanced JFS)
VII) How to remove a disk from a volume group
VIII) How to remove a volume group
IX) How to increase the primary swap
X) How to create a secondary boot disk LVM Mirroring
XI) How to mirror a logical volume

How to relate a failing disk(lun) with its remote port (nport_id)

This is only for legacy HDW paths.

After a problem we had today with our SAN, we where loosing link(milisenconds) to only 1 path
of the four we have:

LVM: Performed a switch for Lun ID = 0 (pv = 0x00000000c0f9c000), from raw device 0x1f170600 (with priority: 0, and current flags: 0x40) to raw device 0x1f0f0600 (with priority: 1, and current flags: 0x0).

from syslog we get the raw device major/minor numer: 0x1f170700

With the minor we get to know our disk:
root:/> ls -l /dev/dsk | grep 170700
brw-r----- 1 bin sys 31 0x170700 May 4 2010 c23t0d7

From the disk the HDW path:
root:/> lssf /dev/dsk/c23t0d7
sdisk card instance 23 SCSI target 0 SCSI LUN 7 section 0 at address 0/0/4/0/0.97.11.19.24.0.7 /dev/dsk/c23t0d7

From the HDW path the san(port info)
0/0/4/0/0 ---> HBA
97.11.19 ---> san(n_port id) info
24.0.7 ---> scsi target lun

Now we need to convert these numers into hex 97.11.19:

97 -> 61
11 -> 0b
19 -> 13

And finally with fcmsutil we can find the nport id using our hex conversion 610b13:
root:/> fcmsutil /dev/td0 get remote all | grep -e 610b13 -e Port
Target N_Port_id is = 0x610b13
Port Type = N_PORT
Target Port World Wide Name = 0x50050763030846e2

So Now you can tell your SAN admins which is the wwn of the failing port.

Check Failed stats:
root:/> fcmsutil /dev/td0 devstat all | grep -E '(Nport|Failed)'
Device Statistics for Nport_id 0x610b13
Failed Open of previously opened device 6
Device Statistics for Nport_id 0x613713
Failed Open of previously opened device 5
Device Statistics for Nport_id 0x750b13
Failed Open of previously opened device 6

Bootup/Shutdown in HP unix

shutdown -r 0 –> reboot
shutdown -h now –> shutdown and halt
shutdown 0 –> shutdown to single user mode
reboot 0 –> reboot
init 1 – single user mode
hpux -is boots single user mode

1. Interupting the boot process:
a. Configuration Menu
b. Information Menu
c. Service Menu

2. GSP Mode
a. From the console hit
b. Hit at the GSP console login (default is no password)
c. Now low level commands can be entered
ps –> power status

To reboot to single user mode:

1. shutdown -r 0
2. hit during 10 sec window to interrupt reboot
3. enter:
4. interact with ipl? yes
5. hpux -is (i=init, s=single user)

Configure disk to use for veritas volume manager (VxVM)

1. Detect new disk -> dfsadm, cfgadm -c configure control_number
2. Labeling disk -> format, choose disk number, label
3. Configure disks
# vxdisksetup -i disk_name
or using vxdiskadm -> choose 1. Add or initialize one or more disks
4. make diskgroup
# vxdg init dg_name disk_name=device_name
* vxdg init backupdg backupdg01=Disk_24
5. make volume
# vxassist -g backupdg maxsize
2096883712
# vxassist -g backupdg make backuplv 2096883712
*size=output from vxassist -g dg_name maxsize
6. Start volume
# vxvol -g backupdg startall
7. Make Filesystem
# mkfs -F vxfs /dev/vx/rdsk/backupdg/backuplv
8. Mounting Filesystem
# mkdir /backup
# mount -F vxfs /dev/vx/dsk/backupdg/backuplv /backup
9. Edit /etc/vfstab

Verify the latest standard patch bundles

HP-UX 11i v1
# swlist -l bundle BUNDLE11i HWEnable11i GOLDBASE11i GOLDAPPS11i

HP-UX 11i v2
# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE QPKAPPS

HP-UX 11i v3
# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE

Verify latest available patches

After installing the latest standard patch bundles, that are delivered on a six month schedule, you need to check for the latest available patches for your products. Using any of the available tools to perform patch assestments of your systems will give you detailed information on the patches available.

Swapoff in HP Unix

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12288 0 12288 0% 0 - 1 /dev/vg00/lvol2
reserve - 391 -391
memory 1938 628 1310 32%
total 14226 1019 13207 7% - 0 -

# lvcreate -L 1024 -n swap2 /dev/vg01
Logical volume "/dev/vg01/swap2" has been successfully created with
character device "/dev/vg01/rswap2".
Logical volume "/dev/vg01/swap2" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

# swapon -p 1 /dev/vg01/swap2

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12288 0 12288 0% 0 - 1 /dev/vg00/lvol2
dev 1024 0 1024 0% 0 - 1 /dev/vg01/swap2
reserve - 391 -391
memory 1938 628 1310 32%
total 15250 1019 14231 7% - 0 -

# swapoff /dev/vg01/swap2

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 12288 0 12288 0% 0 - 1 /dev/vg00/lvol2
reserve - 391 -391
memory 1938 628 1310 32%
total 14226 1019 13207 7% - 0 -

# lvremove /dev/vg01/swap2
The logical volume "/dev/vg01/swap2" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg01/swap2" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

subnet mask and default gateway

Subnet Mask:-

The mask is used to detrmine that which part of IP belonged to network or which part belong to host. E.g. if u have a IP 172.16.25.32 and its subnet mask is 255.255.0.0. then the 172.16 is network part , and 25.16 is host part. If subneting is enable then we can use some bit of host part in network .Subnet mask mainly use in subneting. for above example subnet mask is 255.255.255.0 the nwk address become 172.16.25. and the host part is 32.

Default gateway:-

For a simple LAN there is no use of default gateway, It is used when network communicate with other network. it is just like a Main gate of home when a person wanna go to outside from home or come inside he can only do the same by main gate. Same Concept used here. In network if the packet have address of same address then switch direct forward the packet to its desired destination. And if packet have another network address it should be come out from Default gate way. Basically it reduces the collision. subnetmask is just used to identify the class of ip address and its is used for subnetting of ip address for eg:-

ipaddress -192.168.1.2
subnetmask- 255.255.255.0
we can find N/W part that is 192.168.1 and Host part that is 2
the class of ip is C

where as default gateway is a ip address given to a router or ASDL modem which is used to communuicate with other N/Ws or internet

Difference : HPUX 11iv2 and 11iv3

Major difference is benifit of agile naming view of device files. Both legacy and persistent can be used simultaneously to access mass storage devices. It meant auto multipathing using persistent dsf was new in 11iv3. Multipathing concept was always there from begining, but were done manually using vgextend and all.

dvd clon

ioscan -m dsf

persistant and legacy names

nwmgr

swconfig

check_patches

LVM v.2 volume group

lvmadm -t

Extending a VxFS Filesystem (No Online JFS)

Extending a VxFS Filesystem (No Online JFS)

1. Verify that there is enough space in the volume group
vgdisplay
If there is not enough space then the volume group must be extended - see procedure below.

2. First lvextend the logical volume - 2 Options for lvextend:
a. lvextend -L /dev/VG_NAME/LV_NAME
b. lvextend -l /dev/VG_NAME/LV_NAME

3. Unmount the filesystem
4. extendfs -F vxfs /dev//r
Note: extendfs uses the raw logical volume name (ie rlvol1)

A. How to determine if you have Online JFS
swlist -l fileset | grep -i advanced

B. How to determine the filesystem type
grep /etc/fstab
Results should show the filesystem type (vxfs or hfs) in the return string

Add a Lun to a VG in a SG cluster 11.11/23

Once disk presented to host,
# pvcreate /dev/rdsk/cxtxdx
# vgextend /dev/vgname /dev/dsk/cxtxdx
# lvcreate -L /dev/vgname/lvname
# newfs -F vxfs -o largefiles /dev/vgname/rlvname
# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.org
# vi /etc/cmcluster/pkgname/pkg.cntl
LV[33]=/dev/vgname/lvname; FS[33]=/oracle/ABN/sapdata20; FSMOUNT_OPT[33]="-o convosync=direct,mincache=direct,delaylog,nodatainlog"
(Add newly create Logical volume to pkg.cnt.file)

# vgexport -p -s -v -m /tmp/vgname.map /dev/vgname
# rcp /tmp/vgname.map nodee2:/tmp/vgname.map
# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.node2
# rcp /etc/cmcluster/pkgname/pkg.cntl.node2 nodee2:/tmp/
(mount the mount point manually on the node where the vg is active now)

# mount -o convosync=direct,mincache=direct,delaylog,nodatainlog /dev/vgname/lvolname /oracle/ABN/sapdata20

On Adoptive Node :-
# vgexport /dev/vgname
# mkdir /dev/vgname
# ll /dev/vg*/group
# mknode /dev/vgname/group c 64 0x0X0000
# vgimport -p -s -v -m /tmp/vgname.map /dev/vgname -> (preview) if no error proceed below by removing -p
# vgimport -s -v -m /tmp/vgname.map /dev/vgname
# cp /tmp/pkg.cntl.node2 /etc/cmcluster/pkgname
# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.org
# mv /etc/cmcluster/pkgname/pkg.cntl.node2 /etc/cmcluster/pkgname/pkg.cntl

Adding mirroring to the root vg - HP Unix

1. pvcreate -B /dev/rdisk/c2t2d0
Create the PV on the second disk so that LVM can manage it
-B makes it a bootable volume

2. mkboot /dev/rdsk/c2t2d0
Installs the boot files on the second disk

3. mkboot -a "hpux-lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
Creates an autoboot file on the disk, with information on how to boot

4. vgextend /dev/vg00 /dev/dsk/c2t2d0
extends the volume group to include this second disk.

5. vgdisplay -v vg00
To verify that the second disk is now part of the volume group

6. lvlnboot -v
To verify that the system thinks this disk can boot

7. lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
This extends the logical volume to the mirrored disk, effectively creating the mirrored copy.
This command needs to be run for each logical volume in the volume group

Reinstalling grub from single user mode

- Thanks Anoj


1. Boot the system from an installation boot medium.

2. Type linux rescue at the installation boot prompt to enter the rescue environment.

3. Type chroot /mnt/sysimage to mount the root partition.

4. Type /sbin/grub-install /dev/hda to reinstall the GRUB boot loader, where /dev/hda is the boot partition
.
5. Review the /boot/grub/grub.conf file, as additional entries may be needed for GRUB to control additional operating systems.

6. Reboot the system.

Change IP Addresses for service guard cluster

Before you change the IP Address of your Server you must have all new ips ex. Server ip and package ip then you may go for this changes.

Take backup of these directory and files

1./etc/cmcluster
2./etc/hosts
3./etc/rc.config.d/netconf

modify these files

1./etc/hosts # modify ipaddress

2./etc/rc.config.d/netconf # modify ipaddress and subnet

3./etc/cmcluster/cluster.conf # modify HEARTBEAT_IP

4./etc/cmcluster/packge/cipackage.conf # change SUBNET XX.XX.XX.XX

5./etc/cmcluster/packge/dbpackage.conf # change SUBNET XX.XX.XX.XX

6./etc/cmcluster/packge/cipackage.cntl # change IP[0]=XX.XX.XX.XX
change SUBNET[0]=XX.XX.XX.XX

7./etc/cmcluster/packge/cipackage.cntl # change IP[0]=XX.XX.XX.XX
change SUBNET[0]=XX.XX.XX.XX

8.rcp cluster.conf into /etc/cmcluster
rcp cluster.conf into other node same location

9.rcp these conf,cntl and config file into /etc/cmcluster/packge/
rcp ciVRP.conf,dbVRP.conf,ciVRP.cntl,dbVRP.cntl

10. restart the net for new ip
/sbin/init.d/net stop
/sbin/inti.d/net start

check all ipaddress which we have changed and check with linkloop also

11.cmcheckconf -v -C /etc/cmcluster/cluster.conf -P cipackage.conf -P dbpackage.conf
it should come with no error then go for the next step

12.cmapplyconf -v -C /etc/cmcluster/cluster.conf -P cipackage.conf -P dbpackage.conf

Recommendation before patching

- Ensure you've done full dependency analysis on all the patches to be installed. The ITRC patch systems or swa should do all that for you now.

- Review the "special installation instructions" for all patches that you are to install.

- Ensure there are no unconfigured filesets on the system... something like this should return nothing:
swlist -l fileset -a state | sed -e '/^#.*$/d' -e '/^$/d' | grep -v configured

- ensure that you at least review a run of "swverify \*" - in general you don't need to worry too much about the WARNING levels, but you shoulkd always try and resolve the ERROR levels.

- if you have non-HP kernel filesets (such as EMC PowerPath or IBM atdd tape drivers), you should always review the patches you are installing, and the patch process with the relevant vendor.

- make sure you have run a "cleanup -d" on the dpot, so you don't have any superseded patches in it.

- always run a preview of the swinstall process and resolve *all* reported issues before proceeding
With those precautions in place you should really never encounter an unbootbale kernel as a result of patching.

Backup / Recover using tape in HP Unix

HP-UX offers various commands to backup file system,

a] dump / restore command (HFS filesystem only)

b] vxdump / vxrestore (vxfs filesystem only)

c] cpio command

d] fbackup / frecover command

e] dd command

f] tar command

g] make_net_recovery or make_tape_recovery commands


1. Backup /data directory to /dev/rmt/0m (tape drive)

# fbackup -i /data -I index.data -f /dev/rmt/0m


# -I index.data : index.data specifies the name of the on-line index file to be generated. It consists of one line for each file backed up during the session. Each line contains the file size, the volume number on which that file resides, and the file name. If the -I option is omitted, no index file is generated.
# -f /dev/rmt/0m : Specify tape device name
# -e /tmp : Exclude /tmp from backup
# -g /var/adm/fbackupfiles/hporabox11.backup.list.txt : File that contains a list of files / dirs to be included / excluded from the tape backup

Using the normal tape location to do a full backup but exclude /tmp and /cdrom /nfs directories, insert a new tape and enter:
# fbackup -f /dev/rmt/0m -i / -e /tmp -e /cdrom -e /nfs -v

2.To view contents of an fbackup tape

Type the following command:
# frecover -f /dev/rmt/0m -x -N -v

3.To verify the tape backup

# frecover -f /dev/rmt/0m -N


Restore from tape
=================

1.To restore all files and directories from tape, enter:
# frecover -f /dev/rmt/0m -r -v

2.To restore selected files or directories use -i /path option. For example, just restore /home/backuptest directory, enter:
# frecover -f /dev/rmt/0m -x -v -i /home/backuptest
* -r : Recovery all data from tape
* -x : Extracted / recover selected files / dires only specified by -i option
* -i /path/to/file : Recover only this file or directory
* -v : Verbose output

Common NFS errors & solutions

Common NFS errors & solutions:

1."Server Not Responding" Message
2. "Access Denied" Message
3."Permission Denied" Message
4. "Device Busy" Message

Error 1: If You Receive an NFS "Server Not Responding" Message

ping the nfs server from client

1.ping "nfs serer name or ip"

2./usr/bin/rpcinfo -p servername

The rpcinfo command should display the following processes:

* portmap
* nfs
* mountd
* status
* nlockmgr
* llockmgr

If any of these processes is not running, follow the below steps:


a.Make sure the /etc/rc.config.d/nfsconf file on the NFS server contains the following lines:

NFS_SERVER=1
START_MOUNTD=1

b.Make sure that the /etc/inetd.conf file on the NFS server does not contain a line to start rpc.mountd.
If it does, make sure the START_MOUNTD variable in /etc/rc.config.d/nfsconf is set to 0.

c.Issue the following command on the NFS server to start all the necessary NFS processes:

#/sbin/init.d/nfs.server start

Error 2: If You Receive an "Access Denied" Message

a.check the FS is exported or not

#/usr/sbin/showmount -e server_name

(If it is not exported means u have to edit /etc/exports file in NFS server and put the necessary entry and
then run the command
/usr/sbin/exportfs -a)

Error 3 :If You Receive a "Permission Denied" Message

a.Check the mount options in the /etc/fstab file on the NFS client. A directory you are attempting to write to may have
been mounted read-only.

b.Issue the ls -l command to check the HP-UX permissions on the server directory and on the client directory
that is the mount point. You may not be allowed access to the directory.

c.Issue the following command on the NFS server:

/usr/sbin/exportfs

Or, issue the following command on the NFS client:

/usr/sbin/showmount -e server_name

d. Check the export permissions on the exported directory. The directory may have been exported read-only to your client.
The system administrator of the NFS server can use the remount mount
option to mount the directory read/write without unmounting it

Error 4 : If You Receive a "Device Busy" Message

a.If you received the "device busy" message while attempting to mount a directory, try to access the mounted directory.
If you can access it, then it is already mounted.

b.If you received the "device busy" message while attempting to unmount a directory, a user or process is currently using the directory. Wait until the process completes, or follow these steps:

1.Issue the following command to determine who is using the mounted directory:

/usr/sbin/fuser -cu local_mount_point

The fuser(1M) command will return a list of process IDs and user names that are currently using the directory
mounted under local_mount_point. This will help you decide whether to kill the processes or wait for them to complete.

2. To kill all processes using the mounted directory, issue the following command:

/usr/sbin/fuser -ck local_mount_point

3. Try again to unmount the directory.

Recover deleted (shift+delete) items

- Thanks Priyanka


1) First go to Run and type regedit

2) Go to:
\HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\EXCHANGE\CLIENT\OPTIONS registry key.



3) Right click options and add new DWORD VALUE (data type is REG_DWORD) and then right click and rename to DumpsterAlwaysOn. It is case sensitive.

4) Then right click and modify and make the value 1 to turn the Recover Deleted Items menu choice on for all folders or enter 0 to turn it off.
5) Then go to Outlook , choose "Recover deleted items" option from the Tools Menu to get back your "permanently deleted" mails!
Note : This procedure can recover mails which were deleted by pressing shift+del in the past 4 days only.

Convert to trusted system : How to ?

To convert the system into trusted system the command is :

# /usr/lbin/tsconvert

After converting it will create a directory /tcb/files/auth/*/*

Note: before converting into trusted system you have to modify /etc/nsswitch.conf file. In that file "passwd compact " has to be changed into "passwd files"

To unconvert the trusted system with the following command:

# /usr/lbin/tsconvert –r

If you forget the root password in hp Unix ?

Recover root password in HP Unix

While boot the server Interact the normal boot and,
>boot
Interact with IPL ? Y
ISL>hpux -iS
passwd root

>>enter the new passwd

how to find Who Rebooted the server?

Who Rebooted the server?

Please check these following files before judge who that rebooted your server:

1. /var/adm/crash
2. /etc/shutdownlog
3. /var/tombstones/ts99
4. /var/opt/resmon/log/event.log

If there is nothing indication that come from the above files, then it is probably because of a power failure occured for a short time.

#vi .sh_hystory then Esc-Shift-G to go the end of line

Various log files in HP Unix

1:- Syslog, Old Syslog & mail log

# ll /var/adm/syslog/
-rw-r--r-- 1 root root 29143 Mar 4 14:08 OLDsyslog.log
-r--r--r-- 1 root root 32271 Jun 29 01:26 mail.log
-rw-r--r-- 1 root root 1996112 Jun 29 11:36 syslog.log

2:- Event Log

#ll /var/opt/resmon/log/

lrwxr-xr-x 1 bin bin 27 Mar 19 2004 api.log -> /etc/opt/resmon/log/api.log
lrwxr-xr-x 1 bin bin 30 Mar 19 2004 client.log -> /etc/opt/resmon/log/client.log
-rw-r--r-- 1 root root 210813 Jun 29 01:26 event.log
-r--r----- 1 root root 501871 Apr 4 2004 event.log1
-r--r----- 1 root root 500326 Jan 2 04:54 event.log2
lrwxr-xr-x 1 bin bin 33 Mar 19 2004 registrar.log -> /etc/opt/resmon/log/registrar.log



3:- Memory /Activity/Scan Hardware logs

#ll /var/stm/logs/sys/

-rw-r--r-- 1 root sys 22240 Mar 4 14:23 activity_log
-rw-r--r-- 1 root sys 2536 Mar 4 14:23 cclogd_activity_log
-rw-r--r-- 1 root sys 2024 Mar 4 14:23 diaglogd_activity_log
-rw-r--r-- 1 root sys 2268 Mar 4 14:23 memlogd_activity_log
-rw-r--r-- 1 root root 111200 Jun 22 19:58 scan_hw_log

#ll /var/stm/logs/os/

-rw-r--r-- 1 root root 72316 Jun 29 14:47 memlog


4:- Shutdown Log

#ll /etc/shutdownl*

-rw-r--r-- 1 bin bin 1008 Mar 4 14:08 /etc/shutdownlog

5:- rc/shutdown/su Logs

lrw-r--r-T 1 root sys 11 Mar 19 2004 rc.log -> /etc/rc.log
lrw-r--r-T 1 root sys 16 Mar 19 2004 shutdownlog -> /etc/shutdownlog
-rw------- 1 root root 6635 Jun 29 11:46 sulog

How to get serial number of a disk in Hp Unix?

Only Serial No.

# echo "selclass qualifier hard;info;wait;infolog"|cstm|grep "Serial Number"

Serial No. & other Information.

# echo "selclass qualifier hard;info;wait;infolog"|cstm

How to get the install date using swlist command

Run the below command to get the installed date

#swlist -l fileset -a revision -a title -a state -a install_date

———Sample output ——
# vmGuestLib B.04.00 Integrity VM vmGuestLib 200903081306.51
vmGuestLib.GUEST-LIB B.04.00 Integrity VM GUEST-LIB fileset 200903081306.51 configured
# vmProvider B.04.00 WBEM Provider for Integrity VM vmProvider 200903081306.59
vmProvider.VM-PROV-CORE B.04.00 WBEM Provider for Integrity VM VM-PROV-CORE 200903081306.59 configured

Extending root file system in HP UX

LVM maintenance mode is not going to help you in this. The problem is that the /stand, swap and /
(the root file system), all need to be contiguous. In order to increase /, you would have to move the lvol
containing /home.
The easiest way to do this is to make an ignite backup tape, boot off it and resize your root logical
volumes at that point.

You can not extend as there is no contigous space available for extending the root volume !

Ignite is the best and safe. Still if you wanna do some LVM tasks, I have documented how to increase
/stand in the following thread. With some slight modifications u can use it for root filesystem as well. I
have tested and it works fine

Here i have adjusted the size of SWAP a bit so that it could be successfully added to the /stand
filesystem ... As you have root filesystem it is more simple as you may have /var or /opt to be moved a
little further and then increase root filesystem.

The Logic is as follows

1. Goto LVM Maintanance Level
2. Find out the next lvol after root lvol
3. Create a similier one somewhere else in the rootvg and create fs on it.
4. Transfer the data to the new filesystem
5. Remove the old filesystem and lvol.
6. You will have contigous space for extending root lvol now !
7. Extend it and resize the filesystem with extendfs
8. Compensate the /etc/fstab as you have changed the device file !
9. Update BOOT,ROOT,SWAP and dump definitions using lvlnboot

REBOOT !!!!!

This is really interesting ... why don't you try this after taking an ignite backup ? If u do a mistake u can
always go back to your ignite !

Notes :- This method will save lots of time ! BUUUUUT never go for this first time w/o a proper
backup !!!!!

EXTENDING BOOT /stand

01. You are not just an "HP kid" who will play with ignite like stuff.

02. You like taking some risk & saving your valuable time

Size of /dev/vg00/lvol1 is A (boot or /stand or /dev/vg00/lvol1)

Size of /dev/vg00/lvol2 is B (swap or /dev/vg00/lvol2)

You wanna increase size of lvol1 from A to A+X (where X is not more than B - "physical memory
installed in your machine")

Basically we have to decrease size of swap to increase boot as they are contigous.

Now Extending /stand is an easy job which can be performed in 10-15 minutes.

Steps

01. Boot your machine in LVM maintenance mode
(hpux -lm at ISL>)

#rm /etc/mnttab
#vgchange -a y /dev/vg00
#lvrmboot -r /dev/vg00
#lvremove /dev/vg00/lvol2
#lvextend -L "A+X" /dev/vg00/lvol1
#extendfs /dev/vg00/rlvol1
#lvcreate -L "B-(X+10)" -C y -r n -n lvol2 /dev/vg00
#lvlnboot -b /dev/vg00/lvol1
#lvlnboot -r /dev/vg00/lvol3
#lvlnboot -s /dev/vg00/lvol2
#lvlnboot -d /dev/vg00/lvol2
#reboot -r

You have your /stand extended now

This is a working solution i have tried & found success

Extending root file system in HP UX

LVM maintenance mode is not going to help you in this. The problem is that the /stand, swap and /
(the root file system), all need to be contiguous. In order to increase /, you would have to move the lvol
containing /home.
The easiest way to do this is to make an ignite backup tape, boot off it and resize your root logical
volumes at that point.

You can not extend as there is no contigous space available for extending the root volume !

Ignite is the best and safe. Still if you wanna do some LVM tasks, I have documented how to increase
/stand in the following thread. With some slight modifications u can use it for root filesystem as well. I
have tested and it works fine

Here i have adjusted the size of SWAP a bit so that it could be successfully added to the /stand
filesystem ... As you have root filesystem it is more simple as you may have /var or /opt to be moved a
little further and then increase root filesystem.

The Logic is as follows

1. Goto LVM Maintanance Level
2. Find out the next lvol after root lvol
3. Create a similier one somewhere else in the rootvg and create fs on it.
4. Transfer the data to the new filesystem
5. Remove the old filesystem and lvol.
6. You will have contigous space for extending root lvol now !
7. Extend it and resize the filesystem with extendfs
8. Compensate the /etc/fstab as you have changed the device file !
9. Update BOOT,ROOT,SWAP and dump definitions using lvlnboot

REBOOT !!!!!

This is really interesting ... why don't you try this after taking an ignite backup ? If u do a mistake u can
always go back to your ignite !

Notes :- This method will save lots of time ! BUUUUUT never go for this first time w/o a proper
backup !!!!!

EXTENDING BOOT /stand

01. You are not just an "HP kid" who will play with ignite like stuff.

02. You like taking some risk & saving your valuable time

Size of /dev/vg00/lvol1 is A (boot or /stand or /dev/vg00/lvol1)

Size of /dev/vg00/lvol2 is B (swap or /dev/vg00/lvol2)

You wanna increase size of lvol1 from A to A+X (where X is not more than B - "physical memory
installed in your machine")

Basically we have to decrease size of swap to increase boot as they are contigous.

Now Extending /stand is an easy job which can be performed in 10-15 minutes.

Steps

01. Boot your machine in LVM maintenance mode
(hpux -lm at ISL>)

#rm /etc/mnttab
#vgchange -a y /dev/vg00
#lvrmboot -r /dev/vg00
#lvremove /dev/vg00/lvol2
#lvextend -L "A+X" /dev/vg00/lvol1
#extendfs /dev/vg00/rlvol1
#lvcreate -L "B-(X+10)" -C y -r n -n lvol2 /dev/vg00
#lvlnboot -b /dev/vg00/lvol1
#lvlnboot -r /dev/vg00/lvol3
#lvlnboot -s /dev/vg00/lvol2
#lvlnboot -d /dev/vg00/lvol2
#reboot -r

You have your /stand extended now

This is a working solution i have tried & found success

how to set autoboot using the EFI shell?

Enable / Disable autoboot using EFI shell

shell>autoboot on

shell>autoboot off

Enable/disable using "setboot" command

# /usr/sbin/setboot -b on (For enable)
# /usr/sbin/setboot -b off (For Disable)

To set the autoboot delay to 30 seconds, use the EFI Shell command:

shell> autoboot 30

By use of EFI boot manager:
1. Select “Boot Option Maintenance Menu” from the boot manager’s main menu
2. Select “Auto Boot TimeOut” from the boot option maintenance menu
3. Select “Set TimeOut Value”
4. Enter the number of seconds you want to use for the boot delay (for example 30).

How to create EFI & service partition?

1. # vi /tmp/partitionfile
3
EFI 500MB
HPUX 100%
HPSP 400MB
>>then save the file.
2. idisk -wf /tmp/partitionfile /dev/rdsk/c2t0d0 (boot disk path)
3.insf -e
4. pvcreate -fB /dev/rdsk/c2t0d0s2 (boot disk path)
5. mkboot -e -l /dev/dsk/c2t0d0

Dynamic Root Disk (DRD):

Dynamic Root Disk (DRD):

Dynamic Root Disk (DRD) is an HP-UX system administration toolset that lets you create and modify an inactive system image without shutting down the system. To do this, you can clone the active system image and modify the cloned (inactive) system image while the system is running. When ready, you can boot the cloned image. Usually, the only downtime required is the rebooting process.
System administrators use DRD to manage system images on HP PA-RISC and Itanium® -based systems

DRD commands

The DRD commands are:
drd activate
drd clone
drd deactivate
drd mount
drd rehost
drd runcmd
drd status
drd sync
drd umount
drd unrehost
1. It can help to reduce the downtime required to perform system maintenance and updates.
2.we can ou create and modify an inactive system image (clone) without shutting down the system (DT required to reboot the system only)
3.Automatically synchronise the active image and the clone
4.Ability to sync file system and volume group information

Supported:

* Operating systems supported: HP-UX 11i v2 (11.23) September 2004 or later, HP-UX 11i v3 (11.31)
* Root Volume Groups supported:
o VxVM 4.1, VxVM 5.0
o DRD A.3.5. and earlier: HP-UX 11i v2: LVM 1.0; HP-UX 11i v3: LVM 1.0
o DRD A.3.6. and later: HP-UX 11i v2: LVM 1.0; HP-UX 11i v3: LVM 1.0 and LVM 2.2
* Hardware supported: All HP PA-RISC and Itanium®-based servers and workstations that support HP-UX 11i v2 or HP-UX 11i v3: Hard partitions (nPars), Virtual partitions (vPars), Integrity Virtual Machines (Integrity VMs)

How to boot from alternate kernel?

Press a key, while PDC is waiting for the 10 seconds manual overide.

Autosearch for boot path enabled

To override, press any key with 10 seconds.


Boot from primary boot path (Y or N)?> N
Boot from alternate boot path (Y or N)?> N
Enter boot path, comman, or ?>

console>boot
Interact with IPL (Y or N)?>Y

Booting...
Boot IO Dependent Code (IODC) revision 4

Hard Booted

ISL Revision A.00.38 Oct 26, 1994

ISL>hpux boot disk()/stand/vmunix.prev

How to download the patches for HP unix server ?

Acquiring the Bundles

To obtain the bundles from the web, perform the following steps for both the QPK and HWE patch
bundles.

1. Log in to the target system.

2. Determine the operating system release: uname -r

3. Make sure that you are logged in as a user with write permissions to the download directory
that you plan to use.
These instructions assume you are using the /tmp directory.

4. Log in to the ITRC at http://itrc.hp.com.

Please note that you need to log in to the appropriate site (Americas/Asia-Pacific or European).

5. Select maintenance and support (hp products).

6. Select standard patch bundles - find patch bundles.

7. Select HP-UX patch bundles.

8. Select the most recent release name for your operating system (by release date).

9. Select the bundle link.
We highly recommend you download the following bundles. They are cumulative so select
the latest:
● Hardware Enablement bundle
If you are adding new hardware, then install this bundle.
● Quality Pack patch bundle(s)


10. Ensure all items are checked. Select add to selected patch list.

11. Review your choices to ensure all items are checked. Select download selected.
The download patches page displays.

12. Under the heading download items in one operation, select a download server and a
format option (we recommend gzip package). Only select a zip package if you are certain
that your HP-UX system can unpack a .zip file.

13. Select download. Make the appropriate selections (based on the browser you are using) to
save the selected bundle to the /tmp/tmpdepot directory on the target system.

14. Record the name of the file being downloaded.

Patch status & Patch state in HP UX

Patch Status

Initial values for patch status include the following:

● General Release (GR)
HP has approved GR patches for widespread use.

● Special Release (SR)
HP intends an SR patch for limited distribution. It is available only through special channels.
Modifiers for patch status values include the following:

● Superseded
Indicates that the patch has been replaced by a newer patch. For more information about
supersession, see “Ancestors and Supersession” [43].
Results in the additional patch status values General Superseded and Special
Superseded.

● With Warnings
Indicates that the patch has an associated warning. For more information about warnings, see
“Patch Warnings” [64].
Results in the additional patch status values General Release With Warnings and
Special Release With Warnings.

Patch State

There are four values for patch_state:
● applied
The patch is currently active on the system and is the most recent member of its supersession
chain to have been loaded.

● committed
The patch's rollback files have been deleted, or the patch was installed without saving rollback
files. The patch cannot be directly removed from the system.

● superseded
The patch has been superseded by another patch that has been installed on the system.

● committed/superseded
The patch has been committed and superseded by another patch installed on the system.

Use the following SD-UX commands to determine patch_state values:

● Show the patch_state value for patch patch_id:
swlist -l fileset -a patch_state patch_id

● Show the patch_state values for all patches on the local system:
swlist -l fileset -a patch_state *,c=patch

Patch installation Commands in HP UX

swverify -d \* @ /tmp/patchdepot :To verify the patch bundle

swlist -l product : To verify the installation using below command

swlist -l depot : To check the registered depot on local server

swlist -l depot @ server_name : To check the registered depot on other server

swlist -d -l product *,c=patch @ \ server:/test/depot : To list out all patches in a depot.

swlist -l product some_bundle : To list out products in a bundle

Steps for creating a hp depot

/usr/sbin/swpackage -s -x create_target_acls=false -x target_type=tape -d

where -
Input.psf-file - This file we need to create manually.

Differences between trusted and non-trusted systems?

1. A trusted system allows system auditing to be turned on. Non-trusted systems run with system auditing
disabled.

2.Trusted systems have improved password management.

Some features:
a.grace period and expiration period for passwords.
b.specify system-wide password aging
c.specify an absolute account life
d.disable accounts after repeated login failures.
d.Passwords lengths of up to forty (40) characters
e.access a random password generator

3.Trusted systems have additional login restrictions, while non-trusted systems do not.

4. A trusted system has shadowed passwords, while a non-trusted system does not have shadowed
passwords. Shadowed passwords are kept in locations other than /etc/passwd. This prevents
users from viewing the /etc/passwd file and determining which accounts do not have passwords.

This also prevents hackers from running "password cracker programs" against passwords in the
/etc/passwd file.

How t o check disk is bootable or not ?

To display the different bootstrings for a disk:

# lifls

For example:

# lifls /dev/rdsk/c0t6d0

A bootable disk reports something like:

ISL AUTO HPUX PAD LABEL

While a non bootable disk reports:

lifls: Can't list /dev/rdsk/c0t6d0; not a LIF volume

To show the content of the bootentries:

# lifcp : -

For example:

# lifcp /dev/dsk/c0t6d0:AUTO -
hpux

How to find system supports 32 and /or 64 bit kernel?

From the command-line
=====================
$ getconf HW_CPU_SUPP_BITS
32 ---> system supports only 32-bit
32/64 ---> system supports both 32 and 64-bit
64 ---> system supports only 64-bit

From SAM
========
1) goto Performance Monitors -> System Properties -> Processor
2) check Kernel Width Support: value

The following summarizes the 11.00 implementations supported on HP9000
Servers:

Reduce inode usage?

For examble /opt filesystem's inode usage is high means we have to do below steps

# bdf -i /opt : check the FS usage

Create a test directory on your filesystem;

# mkdir /opt/test

Create a script that will create 10000 null files.

# cd /opt/test
# i=1
# while [ $i -lt 10000 ]
> do
> touch $i
> i=`expr $i + 1`
> done

Else you will be watching the terminal for years to get you the prompt or else CTRL + C will do :-D

once files are created do

#bdf -i /opt

Now comes the step to increase inode count.

# pwd
/opt/test

# rm *
# cd ..
# rmdir test

Now check the inode usage again.

# bdf -i /opt

Content of MBR in Linux : How to Read?

- Thanks Deepthi

To see the contents of your MBR, use this command:

# dd if=/dev/hda of=mbr.bin bs=512 count=1
# od -xa mbr.bin
The dd command, which needs to be run from root, reads the first 512 bytes from /dev/hda (the first Integrated Drive Electronics, or IDE drive) and writes them to the mbr.bin file.

The od command prints the binary file in hex and ASCII formats.

3 types of system crashes

1.High Priority Machine Check (HPMC) - Normally the result of a piece of hardware causing a group 1 interrupt.

2.Transfer Of Control (TOC) - Initiated from console using the TC command form the command menu (GSP) or by Servicguard cmcld daemon in the event of a cluster reformation

3.PANIC - Occurs when the kernel detects a situation that makes no logical sense (like kernel data structures becoming corrupted)

Scenario Questions : in HP UX

Senario1: The disk/volume groups that are going to be shared between nodes in a cluster neccessitate a different series of standard config files that normally deal with and manage disk/volumes/filesystems.
Which standard config files are affected and why?

Answer :

A. /etc/lvmrc - this startup script needs to be modified to NOT activate all volume groups at startup time

B. /etc/fstab - filesystems that will be shared between nodes must NOT be listed in the fstab file.


Scenario 2: The Primary lan card fails on one of the nodes in the cluster. HP replaces the card, and it has maintained its instance number and associated device files. The ip address remains the same. Will the node be able to rejoin the cluster with a simple cmrunnode command?

If not - Why? and what commands must you run or changes do you need to make before it can join the cluster?

Answer:
A. Servicguard maintains the MAC address of all configured LAN cards in the cluster binary file.

B. You must re-run a cmapplyconf using the existing cluster ascii file.

what is the maximum number of groups a user can belongs to ??

we can use the below command to get the maximum number of groups a user can belongs to ,

command : # getconf NGROUPS_MAX

Examble :

root:Server1# /usr/bin/getconf NGROUPS_MAX
20
root:server1

RAID Level supported by LVM - HP UX

HP-UX with LVM supports

1 ) Mirroring RAID 1

2 ) Striping RAID 0

3 ) Striping + Mirroring ( 0 + 1 ) with PVGS that is
with PVG strict & distributed striping LVM polict ( -S g -D y)

Note : RAID 5 & RAID Mirroring + striping are supported on VXVM only !!

How to use tar command for backup/restore in network ?

A. Take the backup of the directory "/data" into the remote server (with the IP address 192.168.1.25) @ the location "/backup"

tar zcvf - /data | ssh root@192.188.1.25 "cat > /backup/data.tar.gz"

To take the backup into remote tape device

tar cvzf - /data | ssh root@192.168.1.25 "cat > "/dev/mt0"


B. Restore the backup from remote server:-

# cd /restore
#ssh root@192.168.1.25 "cat /backup/data.tar.gz" | tar zxvf -

How to controll user access by using "/etc/profile" & /var/adm/inetd.sec ?

By /var/adm/inetd.sec :-

/var/adm/inetd.sec file is used to control the telnet login Remote IP-Address or Hostname or Network based.
If u want to allow particuklar IP address only to access telnet then u have to do below steps.

#vi /var/adm/inetd.sec

telnet allow 10.6.6.6
telnet deny *

>save &exit

then run the below command

#inetd -c

=============================
By /etc/profile :-
If you want to controll the user logiin by based on "login name" or users then you have to use /etc/profile

To control with /etc/profile then,
#vi /etc/profile

--- /etc/profile ---
if [[ ${LOGNAME} = "Raman" || ${LOGNAME} = "dbauser" ]]
then
echo "${LOGNAME} is not allowed to login. Contact administrator
"
sleep 5
exit 1
fi


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

How to check/set Half duplex / Full duplex for LAN card?

Duplex setting in HP Unix :-

# lanscan
( To see the PPA number of the LAN card )

# lanadmin -x PPA_no ( Here X - small letter : for view the setting)

i.e Ex: # lanadmin -x 0
( Assuming 0 is PPA number )

If you want to set the speed then run the below command

#lanadmin -X (100HD|100FD)

To get the NMID use lanscan command.

Root disk failed in HP Unix ??? How to change the Root disk?

If the disk is hot swappable, remove the disk

1. # vgreduce -f /dev/vg00

This will remove the failed disk from vg00

2. # lvlnboot -R

3. Insert the new disk

4. # ioscan -fnC disk

5. # vgcfgrestore -n /dev/vg00 /dev/rdsk/

6. # mkboot /dev/rdsk/devicefile

7. # mkboot -a "hpux" /dev/rdsk/devicefile

8. # vgchange -a y /dev/vg00

9. # vgsync /dev/vg00

10. # lvlnboot -R

11. confirm with vgdisplay, lvdisplay, pvdisplay and lvlnboot.

=============================
If the disks are not hot swappable

1. Shutdown and get the disk replaced

2. boot in single-user mode

3. ioscan, find the device file

4. vgcfgrestore -n /dev/vg00 /dev/dsk/

5. mkboot /dev/rdsk/

6.mkboot -a "hpux" /dev/rdsk/

7.vgchange -a y /dev/vg00

8.vgsync /dev/vg00

9. Reboot in multi-user mode

tar & untar a File ??

TAR
1. tar - cvf test.dat : To tar a file
2.tar -czf test.dat : To tar and zip the file

UNTAR

1. tar -xvf test.tar : To un tar a file.
2. tar -xzf test.tar.gz : To un tar a zipped tar file.
3. tar -xjf test.tar.bz2 : To untar a bzipped file

Server not booting at EFI shell ?? HP-UX or the EFI's NVRAM image is wrong ?

If the EFI Bootcode points to incorrect block of the disk, so the boot services terminates.
HP-UX or the EFI's NVRAM image is wrong..we need to detect the problem and rectify it.

How to do that:

1. After server restart using EFI enter in "boot option maintenance menu"

2. select "add boot option"

3. select partition written like "IA64 EFI [Acpi(HWP0002,100)/Pci(1|0)/Scsi(Pun0,Lun0)....]

4. "select file or change directory" message will appear now

5. Using narrow keys select directory and enter inside

6. Using the menu try to find the "HPUX.efi" and select that file and hit enter.

7.Now it will ask confirmation to save (Enter yes) : It will save the new option to NVRAM.

8.Then navigate to the starting EFI menu where boot devices are listed and there will be option "HPUX" or similar just hit enter on it.

9.That's the alternative path - adding the boot option of HP-UX again.

Enable /Disable autoboot using "setboot" command :

To make auto boot on:

# setboot -b on

To make autoboot OFF

# setboot -b off

# setboot
Primary bootpath : 0/1/1/0.1.0
HA Alternate bootpath :
Alternate bootpath : 0

Autoboot is ON (enabled) <<<==This means its on # setboot Primary bootpath : 0/1/1/0.1.0 HA Alternate bootpath :
Alternate bootpath : 0

Autoboot is OFF (disabled) <<==Now it is OFF

How to check open ports /sockets??

To check the open ports

netstat -an | grep -i listen
netstat -an | grep


To find out the files which is using particular protocol on ports

lsof -i :"port no"

Example : lsof -i :513

To find out the process which is using particular ports

lsof -nP -i "port no"

Example : lsof -nP -i tcp:2100

Patch requires reboot or not ?? How to verify ??

You can verify a patch's reboot requirement with below command:

# swlist -d -l fileset -a is_reboot *.*,c=patch @ /tmp/depot | grep true

Here i consider that /tmp/patch is my depot path.

You want manual reboot after install the patch ? then follow below steps

If a patch requires a reboot AND you do not want the system to reboot automatically
at the end of the swinstall THEN you set autoreboot=false though you must then reboot manually later.

#swinstall -x autoreboot=false -s /tmp/depot

which Daemons controls MC service Guard ??

Totally 8 daemons are controlling the service guard config


* /usr/lbin/cmclconfd :ServiceGuard Configuration Daemon
* /usr/lbin/cmcld :ServiceGuard Cluster Daemon
* /usr/lbin/cmlogd :ServiceGuard Syslog Log Daemon
* /usr/lbin/cmlvmd :Cluster Logical Volume Manager Daemon
* /usr/lbin/cmomd :Cluster Object Manager Daemon - logs to /var/opt/cmom/cmomd.log
* /usr/lbin/cmsnmpd :Cluster SNMP subagent (optionally running)
* /usr/lbin/cmsrvassistd :ServiceGuard Service Assistant Daemon
* /usr/lbin/cmtaped :ServiceGuard Shared Tape Daemon

Each of these daemons logs to the /var/adm/syslog/syslog.log file


cmclconfd - gathers cluster info ie network and vol grp info started in /etc/inetd.conf
cmcld - determines cluster membership. Package Mgr, Cluster Mgr, and Network Mgr run as parts of cmcld.
cmlogd - used by cmcld to write syslog messages.
cmlvmd - keeps track of Volume group info.
cmomd - provides info to client about the cluster. /etc/inetd.conf.
cmsnmpd - produces MIB for snmp
cmsrvassitd - fork and exec scripts for the cluster.
cmtaped- keeps track of shard tape devices.

Enable large file option in hp unix

To change the file system to large file support we need to use below command

#fsadm -F vxfs -o largefiles "/dev/vg00/lvol*"


To mount with large file option

#mount -F vxfs -o largefiles /dev/vg#/lvol# /(mountpoint)

How to check the kernal bit in HPUX ?

How to check the kernal bit in HPUX ?

# getconf KERNEL_BITS

or

# file /stand/vmunix

O/P:- /stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)

or

# getconf HW_CPU_SUPP_BITS

Wednesday 23 November 2011

How to view EMC Luns in hp Unix Server??

To view the EMC Luns on unix server

#powermt device=all" -> For EMC - Clarion (if powerpath installed)

(or)

#syminq -> For EMC - SySmetrics


Once LUNS assigned use the below commands

#ioscan -fn
# insf -e
# ioscan -fnC disk

#cd /dev/rdsk
#ls -lrt -> It will show the newly created device files with current timestamps.

2. one more option

#symcfg discover
#insf -e
#ioscan -fnC disk > ioscan.disk
#symdev list | more

(or)

#syminq | grep -i

Mount ISO image in hp unix : How to ?

On HP-UX 11.11

Start the pfs mount & pfs daemon:

# nohup pfs_mountd &
# nohup pfsd &

create the directory to mount to and run the pfs_mount command:

# mkdir /cdrom
# pfs_mount -o xlat=UNIX /Path/isofile /cdrom

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

On HP-UX 11.31

Create a new logical volume say ‘isoimage’ of size slightly greater than the size of your iso image in MB.

#lvcreate -L size_of_your_isoimage -n iso /dev/vg01
#dd if=path/to/isoimage of=/dev/vg01/risoimage bs=64
#mount /dev/vg00/iso /cdrom

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

how to start syslog in hp unix?

U can use the below command to start the syslog.

#/sbin/init.d/syslogd start

To stop

#/sbin/init.d/syslogd stop

If u have any problem in syslog ..like syslog is not working
u have to check below

1.Any space issue ..like /var got filled means chk the used space

#bdf /var/adm/syslog

then u have to clear some old files and then start the daemon again.
Once its started chk the below and confirm syslog is working fine

#ll /var/adm/syslog.log

#date ( compare the date)

or

# tail syslog.log

How to reduce file system size in unix ??

If online JFS is installed means

#swlist | grep -i "onlinejfs"

#bdf Filesystem
#fuser -cu

Then reduce the Fs size first

#fsadm -F vxfs -b "new size in kb" "Mount Directory"

Ex: fsadm -F vxfs -b 1024 /test

Then reduce the lvol size also

#lvreduce -L "newsize in kb" /dev/vg01/lvolname

Ex: lvreduce -L 1024 /dev/vg01/lvol2


If online JFS not installed means

1. Backup all user data

2. Umount the filesystem
#umount /home

3. Reduce the size
#lvreduce -L "size" /dev/vg01/lvolname

4. Re-create the filesystem

#newfs -F vxfs /dev/vg01/rlvolname

5) Mount the Logical Volume:
mount /dev/vg01/lvolname /mountdir

6) Restore the user data

Enable FTP service in Unix server

How to enable FTP access:

1./etc/services : Check this file and uncomment the ftp lines.

2.Check the port 21 is established or not on ur server.

3./etc/inetd.conf : Check this file for ftp entry should be there.
If it is not there please put the entry and enble it.

4.Restart the inetd by use the commnd
#inetd -c

5.start the ftp service : #/sbin/init/ftp start
Stop the ftp service : #/sbin/init/ftp stop


Files controlls FTP acess:

1./etc/ftpd/ftpaccess --> configuration file is the primary configuration file for defining how the ftpd daemon operates. It is not necessary to enable the ftpacess file inorder to run ftpd. The configuration files allow you to configure FTP features, such as the number of FTP login tries permitted, FTP banner displays, logging of incoming and outgoing file transfers, access permissions, use of regular expressions, etc.

2. /etc/ftpd/ftpconversions -->Defines options for compression/decompression and tar/untar operations

3./etc/ftpd/ftphosts -->Lets you allow/deny FTP account access according to source IP addresses and host names.

4./etc/ftpd/ftpusers --> Restricts FTP access for specified users. This file shows entries which dont have access for ftp.
deny ftp access to selected users.

5./etc/ftpd/ftpgroups -->The group password file for use with the SITE GROUP and SITE GPASS commands

Also check for :
2./etc/passwd --> anonymous ftp access

3.~/.netrc -->login information for ftp.The .netrc file contains login and initialization information used by the ftp autologin process .ftp autologin
allows users to ftp to other hosts.

Recover rootvg (vg00) using ignite tape backup

Take the Root vg (vg00) backup @ tape drive use the below command

# make_tape_recovery -v -x inc_entire=vg00 -a

#make_tape_recovery -I -v -x inc_entire=vg00 -a /dev/rmt/0mn

The tape will be completely erased and recreated when you run the command.

Recover VG00 - Boot with backup tape:

Reboot the system, ON IPL do sea ipl. this will list tape device.

IPL>sea ipl
IPL>bo from p1(assuming p1 is tape device)

This wil start interactive HP-UX install.

Time Zone change in hp unix :- How to??

To change the timezone system wide, execute the following:

1. # /sbin/set_parms timezone

2. When the menu appears, select the appropriate value

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

1. Edit file /etc/TIMEZONE in order to have in it needed timezone (TZ).

2. If you need to configure transition to daylight saving time and back
edit the file /usr/lib/tztab.

Note: After /etc/TIMEZONE update the computer should be rebooted

LOCK disk Initialization in MC service Guard

To find a LOCK disk /LOCK VG in cluster:

#grep LOCK /etc/cmcluster/cmclconfig.ascii

FIRST_CLUSTER_LOCK_VG /dev/vgcllock
FIRST_CLUSTER_LOCK_PV /dev/dsk/c2t0d1

(OR)

Run the below command

# cmviewconf | grep –e "Node name" –e lock

flags: 12 (single cluster lock)
first lock vg name: /dev/vglock
second lock vg name: (not configured)
Node name: node1
first lock pv name: /dev/dsk/c0t4d4
first lock disk interface type: c720
Node name: node2
first lock pv name: /dev/dsk/c0t5d4
first lock disk interface type: c720

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

IF you dont have the vgcfgbackup then how to initialize the lock disk again in cluster
(or)

How to reinitialize the cluster lock disk(s) using cmapplyconf:

• Halt the entire cluster.
# cmhaltcl –f


• Perform the following command from all nodes in the cluster to remove the cluster
flag from cluster lock VG(s).
# vgchange –c n


• Activate cluster lock VG(s) on one node only:
# vgchange –a y

• Perform cmapplyconf on the node where you activated the cluster lock VG(s). The
cluster flag is added back to the VG automatically.
# cmapplyconf –C

• Perform vgcfgbackup to backup the cluster lock information:
# vgcfgbackup

• Deactivate cluster lock VG(s):
# vgchange –a n

• Run vgcfgbackup on all other cluster nodes also:
# vgchange –a r
# vgcfgbackup
# vgchange –a n

• Restart the cluster:
# cmruncl

ipforwarding Enble in hp unix :- How to??

To Check ipforwarding is enabled or not:

#ndd -get /dev/ip ip_forwarding

will give you the currently set value. (A vlaue of 0 means it's off, 2 means on.)

Or else check the below file for the word forward

#more /etc/rc.config.d/nddconf

To Enable follow below :

ndd -set /dev/ip ip_forwarding 2

and for permanent

add to /etc/rc.config.d/nddconf file the following lines:
TRANSPORT_NAME[X]=ip
NDD_NAME[X]=ip_forwarding
NDD_VALUE[X]=2

ipforwarding Enable in Linux :- How to??

- Thanks Bloy

To check its enabled or not :

#sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0 (Value 0=Disabled, 1=Enabled)

or else

#cat /proc/sys/net/ipv4/ip_forward
0
===============

To enable :

#sysctl -w net.ipv4.ip_forward=1

or

#echo 1 > /proc/sys/net/ipv4/ip_forward

To make the change permanent add the below line in /etc/sysctl.conf

#Vi /etc/sysctl.conf:
net.ipv4.ip_forward = 1

and then run the below command

#sysctl -p /etc/sysctl.conf
#service network restart

SSHD Service start /stop in HP-UX

HP-UX SSHD System Startup and Shutdown script:

#/sbin/init.d/secsh {start|stop}

System startup configuration file

/etc/rc.config.d/sshd

Stop HP UX SSH Service
Type the command:

# /sbin/init.d/secsh stop

Start HP UX SSH Service
Type the command:

# /sbin/init.d/secsh start

Create Startup /shutdown script in HP UX :- How to??

Startup and shut down script has 3 parts

1.Original script in /sbin/init.d

2.Configuratiopn file for the script in /etc/rc.config.d
(configuration variables in /etc/rc.config.d to change the behavior of scripts in
/sbin/init.d.)

3.Symlink file for the scripts under /sbin/rc*.d/


How to enable startup/shutdown scripts

Step1 : First place the script under the directory /sbin/init.d/

Step2 : Then create a sym link to the script file

Start a service : ln -s /sbin/init.d/ur_script /sbin/rc3.d/S900urscript.rc

stop a service : ln -s /sbin/init.d/ur_script /sbin/rc3.d/K900Ur_script.rc

3. Place the configuration file under /etc/rc.config.d with required variables (optional)


For Examble : CRON service

/sbin/init.d/cron --> execution script
/etc/rc.config.d/cron --> configuration file
/sbin/rc2.d/S730cron --> start sequence symbolic link
/sbin/rc1.d/K270cron --> kill sequence symbolic link

OS PID Trace: How to ?

In HP UX :
======

# tusc -afpo

Linux:
======

# strace ,ktrace/kdump, ltrace

# strace -fo

In Aix:
========

#truss

#truss -aefo

&

#trace

How to check the kernal bit in HPUX ?

How to check the kernal bit in HPUX ?

# getconf KERNEL_BITS

or

# file /stand/vmunix

O/P:- /stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)

or

# getconf HW_CPU_SUPP_BITS

Reset root password in HP UX

1.Boot the server into single user mode

Interrrupt while booting the server

HPUX> boot -is

2.mount /usr

3. If it is trusted system

#/usr/lbin/tsconvert -r


4.Then reset the root password

#passwd root

or

# vi /etc/passwd
null the passwd field for root user.

5. If root user is locked then unlock using below command

#/usr/lbin/modprpw -k root

6. Once server is up in runlevel 3 again u need to convert as trusted systems

#/usr/lbin/tsconvert

Root password reset in Linux

1. Select the kernel
2. Press the "e" key to edit the entry
3. Select second line (the line starting with the word kernel)
4. Press the "e" key to edit kernel entry so that you can append single user mode
5. Append the letter "S" (or word Single) to the end of the (kernel) line
6. Press ENTER key
7. Now press the b key to boot the Linux kernel into single user mode
8. At prompt type passwd command to reset password:

You need to mount at least / and other partitions:
# mount -t proc proc /proc
# mount -o remount,rw /

Change the root password,

# passwd

thenreboot system:
# sync
# reboot

WWN number for FC card in HP UX ?

Issue the command # ioscan -fnC FC

Get the device path for the desire FC.

e.g. /dev/fcd0

Issue the command

# fcmsutil /dev/fcd0

Look for the line below.

N_Port Port WWN:

That will be your WWN for that FC card

New Service Guard 11.20 Series: Halting a Node or the Cluster while Keeping Packages Running(LAD)

New Service Guard 11.20 Series: Halting a Node or the Cluster while Keeping Packages Running(LAD)


Halting a Node or the Cluster while Keeping Packages Running (Live Application Detach)
There may be circumstances in which you want to do maintenance that involves halting a node, or the entire cluster, without halting or failing over the affected packages. Such maintenance might consist of anything short of rebooting the node or nodes, but a likely case is networking changes that will disrupt the heartbeat. New command options in Serviceguard A.11.20 (collectively known as Live Application Detach (LAD)) allow you to do this kind of maintenance while keeping the packages running. The packages are no longer monitored by Serviceguard, but the applications continue to run. Packages in this state are called detached packages. When you have done the necessary maintenance, you can restart the node or cluster, and normal monitoring will resume on the packages.
There are loads of cases in which you can't use LAD, in fact there are so many that I can't list them here, I would recommend taking a look at the list in chapter.7 of the service guard Doc.
Ok, so in our example, we have a cluster running with only one heartbeat network configured(not meeting minimum requi
rments , but is just a test), because of changes in our network infrastructure, we are going to loose communication in the heartbeat network during and hour, after that we have to change our heartbeat config to another subnet, we are going to use LAD so one node in the cluster doesn't panic when it looses all it's heartbeat communications.
root@vmcluste:/etc/cmcluster> cmviewcl
CLUSTER STATUS
vmcluster up
NODE STATUS STATE
vmcluster1 up running
PACKAGE STATUS STATE AUTO_RUN NODE
pkg2 up running enabled vmcluster1
NODE STATUS STATE
vmcluster2 up running
PACKAGE STATUS STATE AUTO_RUN NODE
pkg1 up running enabled vmcluster2
Our heartbeat config
root@vmcluste:/etc/cmcluster> cmviewcl -v -f line | grep heartbeat
node:vmcluster1|interface:lan1|ip_address:192.168.99.1|heartbeat=true
node:vmcluster2|interface:lan1|ip_address:192.168.99.2|heartbeat=true
We need to change it to the 172.27.1.0 network, after the network guys get link back in the new vlan they created for the heartbeat.
So first of all we shutdown the cluster detaching the packages, our cluster will be in down state and our packages in detached state, in the detached state the packages keep running they just aren't monitored by SG.
root@vmcluste:/etc/cmcluster> cmhaltcl -d
Detaching package pkg1.
Detaching package pkg2.
Disabling all packages from starting on nodes to be halted.
Warning: Do not modify or enable packages until the halt operation is completed.
This operation may take some time.
Waiting for nodes to halt ..... done
Successfully detached package pkg1.
Successfully detached package pkg2.
Successfully halted all nodes specified.
Halt operation complete.
root@vmcluste:/etc/cmcluster> cmviewcl
CLUSTER STATUS
vmcluster down
NODE STATUS STATE
vmcluster1 down unknown
PACKAGE STATUS STATE AUTO_RUN NODE
pkg2 detached detached enabled vmcluster1
NODE STATUS STATE
vmcluster2 down unknown
PACKAGE STATUS STATE AUTO_RUN NODE
pkg1 detached detached enabled vmcluster2
If we check we still have the package virtual ips running and the package fs mounted, and our super app running(in this case a ping..)
root@vmcluste:/> bdf | grep data
/dev/vgpkg2/lvdata1
65536 2149 59433 3% /data1pkg2
root@vmcluste:/> netstat -ni
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan1 1500 192.168.99.0 192.168.99.1 365950 0 368612 0 0
lan0 1500 11.0.0.0 11.0.0.51 727096 0 567120 0 0
lo0 32808 127.0.0.0 127.0.0.1 13633 0 13633 0 0
lan0:1 1500 192.168.0.0 192.168.0.97 614 0 1205 0 0
lan0:2 1500 11.0.0.0 11.0.0.54 0 0 0 0 0
root@vmcluste:/> ps -ef | grep -i ping
root 11220 1 0 14:40:22 ? 0:02 ping 11.0.0.22
ok, so now we can tell our network people they can start working, and kill comms in the HB network....
we are going to do it ourselfs in this case xP.
# hpvmnet -S localnet -h
hpvmnet: Halt the vswitch 'localnet'? [n/y]: y
# hpvmnet
Name Number State Mode NamePPA MAC Address IPv4 Address
======== ====== ======= ========= ======== ============== ===============
localnet 1 Down Shared N/A N/A
vmnetpro 3 Up Shared lan0 0x00156004e156 11.0.0.22
#
we can now check on our servers that we have no heartbeat network working:
root@vmcluste:/etc/cmcluster> netstat -ni | grep lan1
lan1* 1500 192.168.99.0 192.168.99.2 464719 0 462011 0 0
root@vmcluste:/etc/cmcluster> lanscan | grep lan1
0/0/2/0 0xEECAE1760A59 1 UP lan1 snap1 2 ETHER Yes 119
root@vmcluste:/etc/cmcluster> nwmgr --diag link -A dest=0xEECAE1760A59 -c lan1
lan1 Interface State = DOWN
Probable Cause for State = Cable disconnect
don't you just miss linkloop ??, it still works but better get used to the new stuff.
ok, so we can check and everything is still working fine...
root@vmcluste:/> bdf | grep data
/dev/vgpkg2/lvdata1
65536 2149 59433 3% /data1pkg2
root@vmcluste:/> ps -ef | grep -i ping
root 11220 1 0 14:40:22 ? 0:02 ping 11.0.0.22
root@vmcluste:/>
once the mantainance has finished we get the network going again:
# hpvmnet -b -S localnet
# hpvmnet
Name Number State Mode NamePPA MAC Address IPv4 Address
======== ====== ======= ========= ======== ============== ===============
localnet 1 Up Shared N/A N/A
vmnetpro 3 Up Shared lan0 0x00156004e156 11.0.0.22
And start the re-attach the cluster, just running cmruncl:
root@vmcluste:/etc/cmcluster> cmruncl
cmruncl: Validating network configuration...
cmruncl: Network validation complete
Re-attaching package pkg1.
Re-attaching package pkg2.
Waiting for cluster to form ..... done
Successfully re-attached package pkg1.
Successfully re-attached package pkg2.
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
root@vmcluste:/etc/cmcluster> cmviewcl
CLUSTER STATUS
vmcluster up
NODE STATUS STATE
vmcluster1 up running
PACKAGE STATUS STATE AUTO_RUN NODE
pkg2 up running enabled vmcluster1
NODE STATUS STATE
vmcluster2 up running
PACKAGE STATUS STATE AUTO_RUN NODE
pkg1 up running enabled vmcluster2
root@vmcluste:/etc/cmcluster>
to change the heartbeat network configuration without stopping what i'm going to do is send the heartbeat down the 11.0.0.0 production network, while I change the config of the 192.168.99.0 HB network I have now.
I edit the cmcluster.ascii
......................
NODE_NAME vmcluster1
NETWORK_INTERFACE lan0
HEATBEAT_IP 11.0.0.51 -----> change it from stationary to heartbeat
# NETWORK_INTERFACE lan1 -----> remove our HB lan from the cluster
# HEARTBEAT_IP 192.168.99.1
.................
NODE_NAME vmcluster2
NETWORK_INTERFACE lan0
HEARTBEAT_IP 11.0.0.52 -------> change it from stationary to heartbeat
# NETWORK_INTERFACE lan1
# HEARTBEAT_IP 192.168.99.2 -----> remove our HB lan from the cluster
..................
#SUBNET 192.168.99.0 ---------------> remove subnet
# IP_MONITOR OFF
We apply the config it complains a bit, because we are not meeting the minimun required net configuration:
root@vmcluste:/etc/cmcluster> cmapplyconf -v -k -C cluster.ascii
Begin cluster verification...
...........
SUBNET 192.168.99.0 is being removed while cluster is running.
NETWORK_INTERFACE lan1 is being deleted from node vmcluster1 while cluster is running.
NETWORK_INTERFACE lan1 is being deleted from node vmcluster2 while cluster is running.
Minimum network configuration requirements for the cluster have
not been met. Minimum network configuration requirements are:
- 2 or more heartbeat networks OR
- 1 heartbeat network with local switch (HP-UX Only) OR
- 1 heartbeat network using APA with 2 trunk members (HP-UX Only) OR
- 1 heartbeat network using bonding (mode 1) with 2 slaves (Linux Only)
Maximum configured packages parameter is 300.
Configuring 2 package(s).
Modifying configuration on node vmcluster1
Modifying configuration on node vmcluster2
Modifying the cluster configuration for cluster vmcluster
..................
Check on the HB config:
root@vmcluste:/etc/cmcluster> cmviewcl -v -f line | grep heartbeat
node:vmcluster1|interface:lan0|ip_address:11.0.0.51|heartbeat=true
node:vmcluster2|interface:lan0|ip_address:11.0.0.52|heartbeat=true
.............................
NODE_NAME vmcluster1
NETWORK_INTERFACE lan0
HEARTBEAT_IP 11.0.0.51
NETWORK_INTERFACE lan1
HEARTBEAT_IP 192.168.100.1 ----------------------> add new vlan subnet HB network
...........................
NODE_NAME vmcluster2
NETWORK_INTERFACE lan0
HEARTBEAT_IP 11.0.0.52
NETWORK_INTERFACE lan1
HEARTBEAT_IP 192.168.100.2 ----------------------> add new vlan subnet HB network
..........................
SUBNET 192.168.100.0 ---------------> add new subnet
IP_MONITOR OFF
Cmapplyconf and check our HB:
SUBNET 192.168.100.0 is being added while cluster is running.
NETWORK_INTERFACE lan1 is being added to node vmcluster1 while cluster is running.
NETWORK_INTERFACE lan1 is being added to node vmcluster2 while cluster is running.
root@vmcluste:/etc/cmcluster> cmviewcl -v -f line | grep heartbeat
node:vmcluster1|interface:lan0|ip_address:11.0.0.51|heartbeat=true
node:vmcluster1|interface:lan1|ip_address:192.168.100.1|heartbeat=true
node:vmcluster2|interface:lan0|ip_address:11.0.0.52|heartbeat=true
node:vmcluster2|interface:lan1|ip_address:192.168.100.2|heartbeat=true
Ok, we have had a loss of our only HB network for and hour, we have changed the subnet of our HB network without stopping the cluster nor the applications we have running in the cluster. You can do some nice things with the new versions of service guard, It's a pity that 95% of the clusters I see at work are still 11.14/15/16 on 11.11 ...

ULIMIT value in HP UX

uni1. ulimit -a - Display all configured values.
2. ulimit -c - Sets core file size
3. ulimit -d - Sets data seg size
4. ulimit -n - Sets Open Files
5. ulimit -s - Sets stack size
6. ulimit -u - Sets max user processes
7. ulimit -t - Sets cpu time
8. ulimit -v - Sets virtual memory
9. ulimit -p - Sets pipe size

LVM2 in HPUX 11.31

LVM2 found in HPUX 11.31 has lifted a lot of burdensome limits on volume groups. vgcreate automatically creates the device group file; VGs are only limited by the MAX VG size you specify when creating the VG, using the -S option; hitting the max VG size is the only case where a backup/recreate/restore is needed. Here's a list of helpful commands:

LVMP_CONF_PATH_NON_BOOT found in /etc/lvmrc (in March 2010 release) allows lvm2 vg configuration file backups to an alternate location because of the large size of VG 2.X backups

lvmadm - (-t) displays limits of LVM1 and LVM2 VG 1.0 and VG 2.0 and up; (-l) also lists the contents of /etc/lvmtab and lvmtab_p

lvmadm -l
--- Version 1.0 volume groups ---
VG Name /dev/vg00
PV Name /dev/disk/disk3_p2
/dev/disk/disk2_p2

--- Version 2.1 volume groups ---
VG Name /dev/vgXX
PV Name /dev/disk/diskXXX


convert from legacy to persistent DSF: use vgdsf
/usr/contrib/bin/vgdsf –c vgXX

vgcreate using the new LVM2 VG2.0+ notation:
vgcreate -V 2.1 -s 16 -S 4t vgXXX /dev/disk/diskxxx /dev/disk/diskxxx

convert from VG1.0 to VG2.0+
The -r does a "review" to make sure the VG can be converted.
vgversion -V 2.1 -r vgXX

before the convert will run the VG has to be deactivated:
vgchange -a n vgXX
vgversion -V 2.1 vgXX


ioscan new options for persistent dsfs:
ioscan -m dsf /dev/disk/disk127
Persistent DSF Legacy DSF(s)
========================================
/dev/disk/disk127 /dev/dsk/c5t5d0
/dev/dsk/c6t5d0

dbprofile - in HP UX Itanium servers

At EFI shell:
display dbprofile:
dbprofile

add/update profile named "ignite" providing only one parameter: dhcp
dbprofile -dn ignite -dhcp

when modifying the profile, only the parameters that are changing need to be listed; you don't need to re-do the entire syntax

three ways that work: first two only work if the ignite server and client are in the same ethernet broadcast domain (subnet).
- last option gives fast boot time, first and second options requires less administration.

1. dbprofile -dn ignite -dhcp
2. dbprofile -dn ignite -dhcp -b "/opt/ignite/boot/nbp.efi"
3. dbprofile -dn ignite -sip IGNITE.IP.ADDRESS -cip CLIENT.IP.ADDRESS -gip GATEWAY.IP.ADDRESS -m NETMASK -b "/opt/ignite/boot/nbp.efi"

example - ignite IP 192.168.1.2, client IP 192.168.0.2, gateway/router IP 192.168.0.1, netmask 255.255.255.0
dbprofile -dn ignite -sip 192.168.1.2 -cip 192.168.0.2 -gip 192.168.0.1 -m 255.255.255.0 -b "/opt/ignite/boot/nbp.efi"

to actually use the dbprofile:
lanboot -dn ignite
or to pick a specific NIC to boot from: lanboot select -dn ignite

to find list of NICs, run:
lanaddress

sometimes on NPARS, not all NICs show up, so do the following to re-connect the EFI drivers:
reconnect -r

How to disable password age in HP UX ?

HPUX password aging disable:

passwd -x -1 user_id

for i in user1 user2 user3
do
passwd -x -1 $i
done

lock / unlock account user id on HP-UX trusted Systems: How to ?

/usr/lbin/getprpw useraccount

unlock / enable / reactivate:
/usr/lbin/modprpw -k useraccount

lock / expire password:
/usr/lbin/modprpw -e useraccount

Note : Do not use a capital E, as it will expire the password on all user accounts.

Upgrade VXFS Online

update version 3 veritas JFS file system to version 4

vxupgrade -n 4 /mount_point

vxfsconvert -- offline version or to convert an HFS

Get the WWN number in EFI shell ??

Use the below commands to get the FC card details like WWN number..


shell > reconnect -r
shell> drvcfg -----> it will scan and list all the hardware details..
shell> drvcfg -s


Then you need to select fc card and enter. Now you can get WWN number
and other details about the FC card.

LUN path status - How to ??

To get the LUN path status and no.of paths details run the below command

scsimgr lun_map -D /dev/rdisk/diskXXX

PA-RISC server Models

Check the below link for PA- RISC server models specifications

http://www.openpa.net/systems/

fsadm: cannot open /directory/lost+found - how to fix this error?

If u got the below error..

# fsadm -F vxfs -b 20448M /directory
vxfs fsadm: cannot open /directory/lost+found/.fsadm - errno 2

Follow the below steps to fix this error..

#ls /directory --- no lost+found there.


# cd /directory

# mklost+found
creating slots...
removing dummy files...
done


now run fsadm it will get complete..

Replace failed root disk in itanium server - With breaking the mirror.

(THIS IS BREAKING THE MIRROR ON FAILED DISK METHOD)

Pre activity steps: Take the below command o/p

# lvlnboot –v

#setboot

#pvdisplay -v /dev/disk/disk?? | more

#vgcfgbackup /dev/vg00

#vgexport -p -v -m /tmp/vg00.map /dev/vg00

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


Replacement steps: (This is for Mirrored alternate boot disk replacement)

Break the mirrors first on failed disk

step 1: Remove the mirror copy from disk consider failed disk as - /dev/disk/disk2


#for I in 0 1 2 3 4 5 6 7 8
>do
>lvextend –m 0 /dev/vg00/lvol$I /dev/dsk/disk2
>done

step 2 : # vgreduce /dev/vg00 /dev/disk/disk2_p2

step 3 : # pvchange -a N /dev/dsk/disk2_p2 (Deactivate the disk)

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


Step 4 : Then remove the failed disk and replace with a new disk

Stpe 5: #ioscan -m lun and #ioscan -funNC disk

(check the new lun number for new disk)

step 6: vi /tmp/partfile

3
EFI 500MB
HPUX 100%
HPSP 400MB

(Dont copy paste, edit the file manually)

Step 7: #idisk -wf /tmp/partfile /dev/rdisk/disk32

( Lets consider the new disk lun id as 32)

Step 8 : #insf -e -C disk

(create a disk file for new lun)

step 9 : # mkboot -e -l /dev/rdisk/disk32

(set the boot partition on the disk)

step 10 : # efi_fsinit -d /dev/rdisk/disk32_p1

(initialize the FAT FS on new disk's EFI partition)

step 11: # efi_cp -d /dev/rdisk/disk32_p1 -u /EFI/HPUX/AUTO /tmp/auto

(cat /tmp/auto - check the auto file content)

step 12 : #mkboot -a "boot vmunix -lq" /dev/rdisk/disk32

(change the auto file content)

step 13 : # efi_ls -d /dev/rdisk/disk32_p1

step 14 : # efi_ls -d /dev/rdisk/disk??_p3 /EFI/HP

(chk this for primary boot disk , To check whether diag utilities are there on primary boot disk)

step 15 : # dd if=/dev/rdisk/disk??_p3 of=/dev/rdisk/disk32_p3 bs=1024k

(copy the diag utility from primary boot disk to sec boot disk)


step 16 : # pvcreate -f -B /dev/rdisk/disk32_p2

step 17 : # vgextend vg00 /dev/disk/disk32_p2

step 18 : #vgdisplay -v vg00

(cpnfirm disk added to the VG)

step 19 : #Extend the lvols one by one (mirror the lvols ot the new disk)

#for I in 0 1 2 3 4 5 6 7 8
>do
>lvextend –m 1 /dev/vg00/lvol$I /dev/dsk/
>done


step 20 : #vgdisplay -v vg00

(to check all the lvols are extended and in sync)


step 21 : #lifls -l /dev/rdisk/disk32_p2

step 22 : setboot -a "lun path of sec disk"

Dump device is too small ? : AIX

- Thanks to Michelle.

1) # /usr/lib/ras/dumpcheck –p
Also you can find the output from # errpt -a
The Output as below:
The largest dump device is too small.
Largest dump device
dumplv01
Largest dump device size in kb
3538944
Current estimated dump size in kb
3561676

Synchronizing

# lsvg rootvg

VOLUME GROUP: rootvg VG IDENTIFIER: 00cdd76d00004c00000001079dbde229
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 2184 (279552 megabytes)
MAX LVs: 256 FREE PPs: 1995 (255360 megabytes)
LVs: 12 USED PPs: 189 (24192 megabytes)
OPEN LVs: 11 QUORUM: 1
TOTAL PVs: 4 VG DESCRIPTORS: 4
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 4 AUTO ON: yes
MAX PPs per PV: 1016 MAX PVs: 32
LTG size: 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

FREE PPs shows you have 25GB free on the rootvg and your PP Size is 128mb (IE you can allocate fs extentions in 128mb chunks)

Now show your dump devices :
# sysdumpdev -l

primary /dev/lg_dumplv
secondary /dev/lg_dumplv2
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump TRUE
dump compression OFF

# lslv lg_dumplv
LOGICAL VOLUME: lg_dumplv VOLUME GROUP: rootvg
LV IDENTIFIER: 00cdd76d00004c00000001079dbde229.10 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: sysdump WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 9 PPs: 8
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL: None

8PPs*128mb*1024 = 1048576 which matches the current size

Calculate the new dump size from the high water mark

1049600/1024/128 = 8.0078125 !!!! Hmmm ok so allocate one more PP just to keep it happy (bad example - I have had to add 12PPs on systems before)

Extent the dumpdev :

# extendlv lg_dumplv 1

# lslv lg_dumplv

LOGICAL VOLUME: lg_dumplv VOLUME GROUP: rootvg
LV IDENTIFIER: 00cdd76d00004c00000001079dbde229.10 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: sysdump WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 9 PPs: 9
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL:

New size!

Now clear the error
# errclear 0

How to enable Quota in HP UX ?

Note: Thanks to Shameer For sharing this Tips.


Enable the HPUX default quota by following steps:


For each file system for which quotas are to be enabled, perform the following tasks:
1. Mount the file system.
2. Add quota to the existing options list in /etc/fstab. For
example, change the string default for the root (/) entry to
default,quota. Once this is done, quotas will automatically
be enabled for all relevant file systems on system reboot.
3. Create the quotas file in the mount directory of the file
system. For example, for the /mnt file system, run the
command
cpset /dev/null /mnt/quotas 600 root bin
4. Establish one or more prototype user quotas using the
edquota command (see edquota(1M)).
If you want a number of users on your system to have the
same limits, use edquota to set those quotas for a prototype
user; then use the edquota -p command to replicate those
limits for that group of users.
5. Turn on the quotas on the file system using quotaon. For
example, run the command
/usr/sbin/quotaon /mnt
6. Run quotacheck (see quotacheck(1M)) on the file system to
record the current usage statistics.

Adding a new user

To add a new user to the quota system:
1. Use edquota to copy the quotas of an existing user.
2. Run quotacheck.

Adding a new file system to an established system

Repeat steps 1 through 5 above under "Initial Setup" for the new file
system.

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


We can enable the HPUX default quota by following steps:

1) mount the corresponding file system using the quota option

2) Activate the quota.
2) specify users with the quota limit for the file system

I'm hereby giving an example of enabling quota for my user id user1.

STEP: 1. Mount the file system in quota mode.

# mount |grep quota
/quotatest on /dev/vg00/lv_test quota,delaylog on Wed Oct 19 16:13:39 2011
#

STEP :2 Edit the quota for the user ( inthis example for user1)

serverA {root}# edquota user1
"/var/tmp/EdP.a18825" 1 line, 71 characters
fs /quotatest blocks (soft = 1024, hard = 2048) inodes (soft = 0, hard = 0)
~
"/var/tmp/EdP.a18825" 1 line, 76 characters

STEP 3 : Check the quota status.

# quota -v
Disk quotas for user1 (uid 44312):
Filesystem usage quota limit timeleft files quota limit timeleft
/quotatest 7 1024 2048 3 0 0


STEP 4 : Create test files to increase the usage for the user "user1" in the specific file system. Warning message will be displayed if the soft limit is crossed.

#cd /quotatest/user1

# ls -lrt
total 14
-rw-r----- 1 user1 osg 6000 Oct 19 16:22 testfile
-rw-r----- 1 user1 osg 500 Oct 19 16:23 testfile3

# prealloc testfile4 50000000
msgcnt 6 vxfs: mesg 044: vx_bsdquotaupdate - warning: /quotatest file system user 44312 disk quota exceeded
prealloc: Disk quota exceeded

# quota -v
Disk quotas for user1 (uid 44312):
Filesystem usage quota limit timeleft files quota limit timeleft
/quotatest 937 1024 2048 6 0 0


STEP 5 : Create test files to increase the usage for the user "user1" in the specific file system to cross the threshold. Error message will be displayed if the
hard limit is crossed that the quota is exceeded.

# prealloc testfile7 450000
msgcnt 10 vxfs: mesg 044: vx_bsdquotaupdate - warning: /quotatest file system user 44312 disk quota exceeded

# ls -lrt
total 2752
-rw-r----- 1 user1 osg 6000 Oct 19 16:22 testfile
-rw-r----- 1 user1 osg 500 Oct 19 16:23 testfile3
-rw-r----- 1 user1 osg 50000 Oct 19 16:34 testfile4
-rw-r----- 1 user1 osg 450000 Oct 19 16:36 testfile5
-rw-r----- 1 user1 osg 450000 Oct 19 16:37 testfile6
-rw-r----- 1 user1 osg 450000 Oct 19 16:37 testfile7

# quota -v
Disk quotas for user1 (uid 44312):
Filesystem usage quota limit timeleft files quota limit timeleft
/quotatest 1377 1024 2048 7.0 days 7 0 0