Professional Documents
Culture Documents
HPUX Books
HPUX Books
Table of Contents
NIC ................................................................................................................................................................. 4
crontab: you are not authorized to use cron. Sorry. in HP-UX ..................................................................... 6
................................................. 7
Solution .........................................................................................................................................................7
Configuration of /etc/resolv.conf ............................................................................................................... 9
Configuration of /etc/nsswitch.conf .........................................................................................................10
..............................................................................................10
Problem ...................................................................................................................................................... 10
Solution .......................................................................................................................................................10
Login on nPar machine ....................................................................................................................10
Login to vPar Machine ..................................................................................................................... 11
............................................................. 12
Logical Volume details ......................................................................................................................... 13
Checking the possibility of resizing the volume online ................................................................... 14
Extend the Logical Volume ................................................................................................................. 14
Extend the Logical Volume ................................................................................................................. 14
Verify the Extended Volume ........................................................................................................... 15
.................................................... 15
The Disks and File Systems tool supports the following file systems: ..................................... 15
Mount Points ......................................................................................................................................15
Using fstyp command .......................................................................................................................16
............................... 16
Find Fibre HBA WWN Details in HP-UX nPar ..................................................................................... 16
Find HBA Cards .................................................................................................................................... 16
Find WWN Details ................................................................................................................................ 17
............................................................................... 18
2 ASHIS CHANDRA DAS
.......................................................................... 18
.............................................................................................19
...............................................19
Scan Newly Added Disk ...................................................................................................................... 19
Create Physical Volume .........................................................................................................................20
Create Volume Group .......................................................................................................................... 20
Display Volume Group Information ....................................................................................................21
Create Logical Volume .........................................................................................................................21
Format Raw Logical Volume ...............................................................................................................22
Create Mount Point and Mount .......................................................................................................... 22
Create Mount Point and Mount .......................................................................................................... 22
Display SSH Warning Message Before Login Banner ............................................................... 22
Display SSH Warning Message After Login .................................................................................23
........................................................................................................ 24
....................................................... 24
Umount file system (FS) .................................................................................................................. 25
Remove Logical Volume (LV) ......................................................................................................... 25
Removing volume group ..................................................................................................................25
Remove Physical Volume (PV) From LVM ...................................................................................26
................................. 26
Problem .................................................................................................................................................. 26
Solution ...................................................................................................................................................26
Remove NO_HW Deices from HP-UX .............................................................................................. 26
.................................................................27
3 ASHIS CHANDRA DAS
NIC
5 ASHIS CHANDRA DAS
Use a combination of the ‘sec‘ keyword and ‘ro‘ or ‘rw‘ access for specific hosts in the
/etc/dfs/dfstab. I have changed the /etc/dfs/dfstab file as shown below to share the
/testlogs explicitly to DBCLIENT1.
# vi /etc/dfs/dfstab
.
.
"/etc/dfs/dfstab" [Read only] 9 lines, 394 characters
# place share(1M) commands here for automatic execution
# on entering init state 3.
#
# share [-F fstype] [ -o options] [-d ""]
# .e.g,
# share -F nfs -o rw=engineering -d "home dirs" /home
6 ASHIS CHANDRA DAS
After making the changes in the /etc/dfs/dfstab file run the exportfs -a command to come
to the changes in effect.
# exportfs -a
Now mount the /testlogs on DBCLIENT1, it will be successfully mounted and will be
accessible.
[root@DBCLIENT1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
DBSERVER:/testlogs 5.0G 750M 4.3G 15% /home/testlogs
[root@DBCLIENT1 ~]#
Now if anyone tries to mount the /testlogs on any other server like DBCLIENT2 then he
will find the access denied message as shown below:
[root@DBCLIENT2 ~]#
[root@DBCLIENT2 ~]# mount DBSERVER:/testlogs /home/testlogs
mount.nfs: access denied by server while mounting DBSERVER:/testlogs
[root@DBCLIENT2 ~]#
$ crontab -e
crontab you are not authorized to use cron. Sorry.
Reason:
When I checked the /var/adm/cron/cron.allow file, there was no entry for the
user dbappweb. A user should be added in the /var/adm/cron/cron.allow file to schedule
a cronjob.
Solution:
Follow the steps given below:
Login as root/superuser.
Edit the /var/adm/cron/cron.allow file.
# vi /var/adm/cron/cron.allow
Add “dbappweb” at the end of the file and save the file
7 ASHIS CHANDRA DAS
SSH was taking too much time because it was using the DNS server for SSH
connectivity although it was disabled in the configuration file /opt/ssh/etc/sshd_config.
Solution
Log in as a super/root user on the server.
Edit the configuration file /opt/ssh/etc/sshd_config as shown below:
# vi /opt/ssh/etc/sshd_config
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#EnforceSecureTTY no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
8 ASHIS CHANDRA DAS
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
.
.
.
.
.
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#EnforceSecureTTY no
#UsePrivilegeSeparation yes
9 ASHIS CHANDRA DAS
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none
.
.
These changes will come into effect when the ssh service will be restarted.
To restart the ssh service, use the below commands:
# /sbin/init.d/secsh stop
HP-UX Secure Shell stopped
# /sbin/init.d/secsh start
HP-UX Secure Shell started
Configuration of /etc/resolv.conf
resolv.conf is the name of a computer file used in various operating systems to configure
the system’s Domain Name System (DNS) resolver. The file is a plain-text file usually
created by the network administrator or by applications that manage the configuration
tasks of the system.
Log in as a super/root user on the server.
Edit the /etc/resolv.conf file and if the file is not available then create it.
# vi /etc/resolv.conf
Add the DNS servers as nameservers in the /etc/resolv.conf file, as shown
below. Here we have added the two DNS servers 203.176.113.82 and
203.176.113.84. After adding the server details, save the file.
.
.
nameserver 203.176.113.82
nameserver 203.176.113.84
10 ASHIS CHANDRA DAS
Configuration of /etc/nsswitch.conf
The Name Service Switch (NSS) is a facility in Unix-like operating systems that provides
a variety of sources for common configuration databases and name resolution
mechanisms. These sources include local operating system files (such as /etc/passwd,
/etc/group, and /etc/hosts), the Domain Name System (DNS), the Network Information
Service (NIS), and LDAP.
.
.
passwd: files
group: files
Problem
I have some HP-UX vPar machines, one day I faced the issue that one vPar machine
was pinging but I was unable to login through PuTTY.
Solution
To find the reason I need to log in to the console of the vPar machine. To log in on vPar
console first I need to log in on the base machine of the vPar which was a nPar machine.
# vparstatus
[Virtual Partition]
Num Name RunState State
=== ========================== ============ =========
1 dbappweb1 UP Active
2 dbappweb2 UP Active
3 dbappweb3 UP Active
# vparconsole -p2
CO: Console
CM: Command Menu
CL: Console Log
SL: Show Event Logs
VM: Virtual Machine Menu
HE: Main Help Menu
X: Exit Connection
[dbappweb2] vMP> co
12 ASHIS CHANDRA DAS
- - - - - - - - - - - - Live Console - - - - - - - - - - - -
# hostname
dbappweb2
After login on vPar console, I restarted the ssh service to resolve the above issue.
# /sbin/init.d/secsh stop
HP-UX Secure Shell stopped
# /sbin/init.d/secsh start
HP-UX Secure Shell started
Sometimes we need to extend the size of a logical volume to increase the free space
when running out of space. One of my servers has logical
volume /dev/vg00/lvol5 mounted on /opt which becomes 76% full so I have to increase
the size of the Logical Volume (LV) /dev/vg00/lvol5. I have to extend it from 16 GB to 18
GB online without any downtime for my server.
13 ASHIS CHANDRA DAS
# bdf /opt
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol5 16777216 12807008 3950592 76% /opt
Logical Volume details
lvdisplay shows the details of the logical volume like LV Name, VG Name, LV
Size, Allocated PE etc.
# lvdisplay /dev/vg00/lvol5
--- Logical volumes ---
LV Name /dev/vg00/lvol5
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 16384
Current LE 512
Allocated PE 512
Stripes 0
Bad block on
Allocation strict
vgdisplay shows the details of the Volume group like VG Name, PE Size, Total PE,
Allocated PE, Free PE etc. Volume Group vg00 has a total of 4451 PE in which 1411
PEs are free and PE size is 32 MB. We can allocate the free PE to any logical volume.
# vgdisplay vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 1
14 ASHIS CHANDRA DAS
Act PV 1
Max PE per PV 4461
You can check the users who are accessing any mount point at a particular moment by
using the command fuser -cu.
# fuser -cu /opt
/opt: 1113mt(root) 1646mt(sfmdb) 2529mt(sfmdb) 1647mt(sfmdb
Extend the Logical Volume
The current size of the logical volume /dev/vg00/lvol5 is 16 GB and I need to extend it
to 18 GB. I have to give the size of the extended logical volume in MB with
lvextend command
You can check the users who are accessing any mount point at a particular moment by
using the command fuser -cu.
# fuser -cu /opt
/opt: 1113mt(root) 1646mt(sfmdb) 2529mt(sfmdb) 1647mt(sfmdb
Extend the Logical Volume
The current size of the logical volume /dev/vg00/lvol5 is 16 GB and I need to extend it
to 18 GB. I have to give the size of the extended logical volume in MB with
lvextend command
# lvdisplay /dev/vg00/lvol5
--- Logical volumes ---
LV Name /dev/vg00/lvol5
VG Name /dev/vg00
15 ASHIS CHANDRA DAS
# lvdisplay /dev/vg00/lvol5
--- Logical volumes ---
LV Name /dev/vg00/lvol5
VG Name /dev/vg00
The Disks and File Systems (fsweb, bundle FileSystems) tool is a single-system tool for
managing logical volumes, volume groups, disks, file systems, paging devices, and
backup & recovery of file systems, on systems running on HP-UX 11i v2 and HP-UX 11i
v3.
The Disks and File Systems tool supports the following file
systems:
Cache File System (CFS)
Compact Disc File System (CDFS)
Common Internet File System (CIFS)
Hierarchical File System (HFS)
Network File System (NFS)
Veritas File System (VxFS)
Mount Points
# bdf /opt
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol5 18874368 12807072 6031296 68% /opt
#
You can determine the file system of your various mount points in the HP-UX system by
using the below command:
16 ASHIS CHANDRA DAS
The above command shows that lvol5 formatted using Veritas File System (vxfs)
If an HP-UX server or system is connected to one or more SAN switches through Fibre
Channel (FC) HBA cards then it is very important for the storage team they assign the
storage to the correct server via WWN numbers of FC HBA cards.
# ioscan -fnkC fc
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
fc 0 0/0/0/3/0/0/2 fcoc CLAIMED INTERFACE HP N/A 10Gb
PCIe 2-port Embedded FCoE Adapter
/dev/fcoc0
fc 1 0/0/0/3/0/0/3 fcoc CLAIMED INTERFACE HP N/A 10Gb
PCIe 2-port Embedded FCoE Adapter
/dev/fcoc1
fc 2 0/0/0/4/0/0/2 fcoc CLAIMED INTERFACE HP N/A 10Gb
PCIe 2-port Embedded FCoE Adapter
/dev/fcoc2
17 ASHIS CHANDRA DAS
/dev/fcoc3
Vendor ID is = 0x1077
Device ID is = 0x2532
PCI Sub-system Vendor ID is = 0x103C
PCI Sub-system ID is = 0x3261
PCI Mode = PCI Express x4
ISP Code version = 5.6.5
ISP Chip version = 2
Topology = PTTOPT_FABRIC
Link Speed = 8Gb
Local N_Port_id is = 0x650700
Previous N_Port_id is = 0x650700
N_Port Node World Wide Name = 0x5001438021de4c25
N_Port Port World Wide Name = 0x5001438021de4c24
Switch Port World Wide Name = 0x20070027f880ee6c
fcmsutil /dev/fcd5
Vendor ID is = 0x1077
Device ID is = 0x2532
PCI Sub-system Vendor ID is = 0x103C
PCI Sub-system ID is = 0x3261
PCI Mode = PCI Express x4
ISP Code version = 5.6.5
ISP Chip version = 2
Topology = PTTOPT_FABRIC
18 ASHIS CHANDRA DAS
# machinfo
CPU info:
Intel(R) Itanium(R) Processor 9550 (2.39 GHz, 32 MB)
4 cores, 8 logical processors per socket
6.38 GT/s QPI, CPU version D0
# /usr/contrib/bin/machinfo
CPU info:
Intel(R) Itanium(R) Processor 9550 (2.39 GHz, 32 MB)
4 cores, 8 logical processors per socket
6.38 GT/s QPI, CPU version D0
Active processor count:
1 socket
1 core
1 logical processor (1 per socket)
LCPU attribute is disabled
OR
19 ASHIS CHANDRA DAS
Solution:
in the /etc/rc.config.d/hpvmconf you need to set the HPVM_ENABLE=1 to enable
Integrity VM at boot time.
# /sbin/init.d/hpvm start
You cannot extend/create any logical volume of more than 2 TB in HP-UX LVM with VG
version 1.0. Max is 2 TB and that too on 11.31 because the number of max physical
extents (PE) on 11.31 is 65536 and with that max size of PE 32 MB. so total size=
65536*32 mb= 2 TB.
To create or extend a logical volume greater than 2TB you need VG Version 2.0. Here I
have shown the process to create a logical volume of 3TB.
Scan Newly Added Disk
First, scan the newly exported disk from the storage using the command ioscan -fnNC
disk
===================================================================
20 ASHIS CHANDRA DAS
/dev/disk/disk3 /dev/disk/disk3_p2
/dev/rdisk/disk3 /dev/rdisk/disk3_p2
/dev/disk/disk3_p1 /dev/disk/disk3_p3
/dev/rdisk/disk3_p1 /dev/rdisk/disk3_p3
/dev/disk/disk4 /dev/rdisk/disk4
/dev/disk/disk5 /dev/rdisk/disk5
# pvcreate /dev/rdisk/disk17
to use only the first 2147483647KB of disk space in volume group version
1.0.
On volume group version 2.x, the physical volume size will be recalculated
to use full size upto a maximum of 17179869184KB.
# vgdisplay -v /dev/vgrctest
VG Name /dev/vgrctest
VG Status available
version 7 layout
largefiles supported
# mkdir /rctest
# bdf
/dev/vgrctest/lvol1
Search for the word “Banner”, add the line Banner /etc/issue and save the
file.
..
..# no default banner path
# Banner none
Banner /etc/issue..
Now open the file /etc/issue in vi editor and add the message which you want to display,
save the file.
# vi /etc/issue
***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************
~
You will see the banner after login two times, to resolve this issue you need to
comment the below lines in /etc/profile file.
# vi /etc/profile
//Comments the below lines in the above file
# Message of the day
#if [ -r /etc/motd ]
#then
#cat /etc/motd
24 ASHIS CHANDRA DAS
#fi
You can reboot a HP-UX machine by using the commands shown below:
# /usr/sbin/shutdown -r -y 0
or
# shutdown -ry now
-r = reboot
If you are not using a mount point and you need to remove that file system to gain
some more space which can be used for other systems. To reclaim the disk space you
need to do the following activities if you have created that volume using the Logical
Volume (LV) and Volume Group (VG).
First list down the exported volumes on the machine using the below command:
# ioscan -fnNC disk
Class I H/W Path Driver S/W State H/W Type Description
======================================================
==========
disk 8 64000/0xfa00/0xe esdisk CLAIMED DEVICE 3PARdataVV
/dev/disk/disk8 /dev/rdisk/disk8
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vgupload/lvupload
2147450880 471341672 1571352501 23% /upload
Remove the directory and group DSFs for the volume group. Press y when
prompted.
# rm -ir /dev/vgupload
directory /dev/vgupload: ? (y/n) y
/dev/vgupload/group: ? (y/n) y
/dev/vgupload: ? (y/n) y
Problem
How to remove NO_HW devices from ioscan in HP-UX without a reboot?
Solution
You can remove the “NO_HW” devices from ioscan by using the command rmsf -k -H
<hw_path>
and there is no need to reboot the HP-UX system. I have done this on HP-UX 11.31.
Follow the below process to remove the NO_HW devices:
/dev/disk/disk5 /dev/rdisk/disk5
27 ASHIS CHANDRA DAS
# rmsf -k -H 64000/0xfa00/0x2a
Again run the ioscan command to verify the removed devices. The below details
show that NO_HW device has been removed.
/dev/disk/disk5 /dev/rdisk/disk5
Now you can see that entry of “NO_HW” has been removed.
MP MAIN MENU:
CO: Console
VFP: Virtual Front Panel
CM: Command Menu
CL: Console Log
SL: Show Event Logs
HE: Main Help Menu
X: Exit Connection
28 ASHIS CHANDRA DAS
5. Now when runstate of machine3 is DOWN and the state is Inactive. Again go to the console of
machine3.
#vparconsole -p machine3
vMP MAIN MENU
CO: Console
CM: Command Menu
CL: Console Log
SL: Show Event Logs
VM: Virtual Machine Menu
HE: Main Help Menu
X: Exit Connection
[machine3] vMP:CM> pc
Current System Power State: Off
Power Control Menu:
C – Power Cycle
ON – Turn Power On
OFF – Turn Power Off
G – Graceful Shutdown
Enter menu item or [Q] to Quit: ON
System will be powered on.
Confirm? (Y/[N]): Y
-> System is being powered on.
Please wait for the vPar or VM start sequence to complete. Use of the attention
character can prevent the vPar or VM from running.
[machine3] vMP>
vMP MAIN MENU
CO: Console
CM: Command Menu
CL: Console Log
SL: Show Event Logs
VM: Virtual Machine Menu
HE: Main Help Menu
X: Exit Connection
[testav] vMP> co