LVM on Service Guard - HPUX

LVM On Service Guard Clusters

To copy the mapping of the Volume group file

 # vgexport -p -s -m <map_file_name> /dev/vg_name 

To import the VG using the map data

 # mkdir /dev/vg_name  # mknod /dev/vg_name/group c 64 0xXX0000  # vgimport -s -m <map_file_name> /dev/vg_name 

To manually activate a VG under Service Guard control

 # vgchange -c n <vg_name>  # vgchange -a y <vg_name> 

To Bring back the VG under Service Guard control

 # vgchange -a n <vgname>  # vgchange -c y <vgname> 

HP UX - Basic Network management

Network management - HPUX


To display the network interface cards and status

  # lanscan  Hardware Station        Crd  Hdw   Net-Interface    NM   MAC       HP-DLPI DLPI  Path     Address        In#  State NamePPA          ID   Type      Support Mjr#  0/0/0/0  0x00306E1CC281 0    UP    lan0 snap0       1    ETHER       Yes   119  1/12/0/0 0x00306E210F32 3    UP    lan3 snap3       2    ETHER       Yes   119 

To configure the NIC cards such as speed, MTU, etc..

  # lanadmin (it is a interactive tool) 

To find out the speed of duplex setting of lan0

  # lanadmin -x 0  Speed = 1000 Full-Duplex.  Autonegotiation = On. 

To list all the configured interfaces and IP addresses

  # netstat -in 

To force HP-UX to use specific interface card

  # traceroute -i lan2 10.20.30.40  

HP-UX stores network interface configuration information on /etc/rc.config.d/netconf file

  # cat /etc/rc.config.d/netconf  HOSTNAME="it-hp49"  OPERATING_SYSTEM=HP-UX  LOOPBACK_ADDRESS=127.0.0.1  INTERFACE_NAME[0]="lan0"  IP_ADDRESS[0]="216.131.195.137"  SUBNET_MASK[0]="0xffffff00"  BROADCAST_ADDRESS[0]="216.131.195.255"  INTERFACE_STATE[0]=""  DHCP_ENABLE[0]=0   ROUTE_DESTINATION[0]="default"  ROUTE_MASK[0]=""  ROUTE_GATEWAY[0]="216.131.195.10"  ROUTE_COUNT[0]="1"  ROUTE_ARGS[0]="" 

To add a alias address to lan0, add the network information to /etc/rc.config.d/netconf file

  INTERFACE_NAME[0]=lan0:1  IP_ADDRESS[0]=216.131.195.138  SUBNET_MASK[0]=255.255.255.0  BROADCAST_ADDRESS[0]=""  INTERFACE_STATE[0]=""  DHCP_ENABLE[0]=0  INTERFACE_MODULES[0]="" 

Restart the network service

  /sbin/init.d/net start 

Network Tracing and Logging

  The nettl command is a tool used to capture network events or packets. 

Initialize the tracing/logging facility:

  # nettl -start 

Display the status of the tracing/logging facility.

  # nettl -status all 

nwmgr (Network Interface Management)

The nwmgr program is the unified command to administer all HP-UX LAN and RDMA interfaces. This command can be used to:

  • Display information of an interface
  • Modify settings of an interface
  • Reset the interface or its statistics
  • Diagnose link connectivity
  • Create and set configuration information for a component simultaneously
  • Delete or erase components
 # nwmgr   Name/          Interface Station          Sub-   Interface      Related ClassInstance  State     Address        system   Type           Interface ============== ========= ============== ======== ============== ========= lan2           DOWN      0x001A4B096828 iether   1000Base-T lan0           UP        0x001A4B097F9A iether   1000Base-T lan1           DOWN      0x001A4B097F9B iether   1000Base-T 
  # nwmgr --help -S all  # lists all the subsystems  # nwmgr --help -S subsystem # display subsystem specific usage 
To View Interface attributes
 # nwmgr  -A all -c lan0 lan0 current values:    Link State = Up    Speed = 1 Gbps Full Duplex (Autonegotiation : On)    MTU = 1500    MAC Address = 0x001a4b097f9a    Receive Flow Control = On    Transmit Checksum Offload = Off    Receive Checksum Offload = Off    Virtual MTU = 0       TCP Segmentation Offload is now disabled.    Max Send Buffers = 1    Max Send Coalesce Ticks = 150    Max Recv Buffers = 1    Max Recv Coalesce Ticks = 0    Interrupt Throttle Mode = -1    Diagnostics Threshold = 0    512byte transmit buffer size limit = 0

To get interface statistics for interface lan0

  # nwmgr --st all -c lan0 

To View interface details

  # nwmgr -q info -c lan0 

To get interface vital product data

  # nwmgr -q vpd -c lan0 

To set interface attributes

  # nwmgr -s -A attr1-value, attr2=value ... -c lan0 

Reset statistics for an interface

  # nwmgr -r --st -c lan<instance> 

Some nwmgr Syntax and their Equivalent lanadmin and linkloop Syntax are given bellow

 nwmgr -S vlan	                               lanadmin -V scan nwmgr -c lan5000	                       lanadmin -V info 5000 nwmgr -a -S vlan -A vlanid=10, ppa=1           lanadmin -V create vlanid 10 1 nwmgr -s -c lan5000 -A vlanid=20               lanadmin -V modify vlanid 20 5000 nwmgr -d -c lan5000	                       lanadmin -V delete 5000 nwmgr --cra -c lan5000	                       lanadmin -p 5000 nwmgr --diag -c lan5000 -A dest=0xaabbccddeeff linkloop -i 5000 0xaabbccddeeff



Configuring proxy settings in linux



If your Linux box is behind a proxy server then to access the internet, proxy configuration will be required. The 'http_proxy' and 'ftp_proxy' environment variables hold the information about proxy server. Just execute the following commands-

$export http_proxy=http://proxy-server-ip:port
$export ftp_proxy=http://proxy-server-ip:port

Now wget, yum, apt-get etc. can use these variables to access http/s and ftp URLs out of office LAN. If proxy server needs authentication credentials then pass them as shown below-

$export http_proxy=http://user:password@proxy-server-ip:port
$export ftp_proxy=http://user:password@proxy-server-ip:port

To avoid executing these commands every time you login or reboot the machine then add them in ~/.bashrc file


Setup Kickstart Server in Linux

Red Hat Linux operating system installations can be done via a network connection using a Kickstart server. It is frequently much faster than using CDs and the process can be automated.
Example Kickstart 
 Get the kickstart cfg from http server and start the install
   boot: linux ks=http://server.com/path/to/kickstart/file

 Get the kickstart cfg from nfs server and start the install
   boot: linux ks=nfs:server:/path/to/kickstart/file

 Serving the Kickstart file from nfs server through dhcp /etc/dhcpd.conf
   next-server 10.10.10.100;
   filename "/export/rhinstall/kickstart/ks.cfg"

Setup a Kickstart Server

01. Install and configure the DHCPD server

How to add SWAP in hp Unix

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 tips

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