Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

1 ASHIS CHANDRA DAS

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

 How to Find NIC (Network Interface Card) Details in HP-UX


 How to Install a .depot Package Using swinstall on HP-UX
 HP-UX: How to restrict NFS share access to a particular server?
 crontab: you are not authorized to use cron. Sorry. in HP-UX
 HP-UX: SSH taking too much time after adding the DNS Servers
 How to add DNS servers on an HP-UX server
 How to login to vPar console in HP-UX
 How to extend the size of Logical Volume (LV) in HP-UX
 How to determine file system type in HP-UX using command
 How to check vPar machines status in HP-UX
 How to find HBA cards/ports and WWN Number details in HP-UX (nPar)
 How to find HBA cards/ports and WWN Number details in HP-UX (vPar)
 HP-UX command to get Physical Memory Information
 HP-UX command to get Processor Information
 HP-UX command to get Hardware Serial Number
 su: Sorry in HP-UX while switching from normal user to root user
 SSH login taking too much time on HP-UX 11.31
 How to Disable Root SHH Login in HP-UX?
 hpvmstatus: HPVM currently not running.
 How to view/print routing table in HP-UX?
 Create a Logical Volume larger than 2TB and format it in HP-UX
 Protect SSH Logins with SSH and MOTD Banner Messages in HP-UX
 Remove welcome message after login in HP-UX 11.31
 Create a Logical Volume and format it in HP-UX
 How to rescan new LUNs added in HP-UX 11.31
 How to reboot a HP-UX machine?
 How to remove File System, LV and VG in HP-UX and Linux?
 How to remove NO_HW devices from ioscan in HP-UX without a reboot?
4 ASHIS CHANDRA DAS

NIC
5 ASHIS CHANDRA DAS

How to restrict NFS share access to a particular server in HP-UX?

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

/usr/sbin/share -F nfs -o sec=sys,ro=DBCLIENT1 /testlogs


.

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 ~]# mount DBSERVER:/testlogs /home/testlogs

[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: you are not authorized to use cron. Sorry. in HP-UX

$ 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
.
.

 Change the #UseLogin no to UseDNS no and save the file.


 .

 .

 .

 #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.

 .

 .

 search onlinesbi.com www.onlinesbi.com merchant.onlinesbi.com


sbiepay.com www.sbiepay.com

 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.

 Log in as a super/root user on the server.


 Edit the /etc/nsswitch.conf file, as shown below
# vi /etc/nsswitch.conf
 Add the DNS corresponding to the files which you need to resolve through
DNS. Here I configured the resolution of hosts name only through DNS.
Save the file.

 .

 .

 passwd: files

 group: files

 hosts: dns 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.

Login on nPar machine


After login on nPar machine see the details of the all vPar machines created under this
nPar using the command vparstatus.
11 ASHIS CHANDRA DAS

# vparstatus
[Virtual Partition]
Num Name RunState State
=== ========================== ============ =========
1 dbappweb1 UP Active
2 dbappweb2 UP Active
3 dbappweb3 UP Active

[Virtual Partition Resource Summary]


Virtual Partition CPU Num Num Total MB Floating
MB
Num Name Min/Max CPUs IO Memory Memory
=== ========================== ======= ==== ==== =========
============
1 dbappweb1 1/512 2 5 16384
0
2 dbappweb2 1/512 3 5 16384
0
3 dbappweb3 1/512 2 6 16384
0
#
Login to vPar Machine
Use the below command to log in on the vPar machine.

# vparconsole -p2

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

[dbappweb2] vMP> co
12 ASHIS CHANDRA DAS

(Use Ctrl-B to return to vMP main menu.)

- - - - - - - - - - Prior Console Output - - - - - - - - - -

The system is ready.

- - - - - - - - - - - - Live Console - - - - - - - - - - - -

Console Login: root


Password:

# 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

Stripe Size (Kbytes) 0

Bad block on

Allocation strict

IO Timeout (Seconds) default

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

Checking the possibility of resizing the volume online


To resize any volume online we need online JFS. It can be checked by using the
command given below which will list the installed online JFS software if installed. In my
server, Online JFS is already installed. If online JFS is not installed on your server then
you can not resize the volume online, in this case, first, you need to umount the logical
volume and the commands are also different.

# swlist -l product | grep -i jfs


AONLINEJFS B.05.10.01 OnlineJFS 5.1SP1
Integration Product
JFS B.11.31 Base VxFS File System 4.1
for HP-UX
OnlineJFS01 5.1.200.000 Online features of the VxFS
File System
#

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

Verify the Extended Volume


Use the bdf command to verify the size of the Logical Volume (LV)
# bdf /opt
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol5 16777216 12807008 3950592 76% /opt

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

Using fstyp command


# fstyp /dev/vg00/lvol5
vxfs

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.

nPar: nPar is a hard partition/physical partition of a single computer into multiple


partitions, each having separate hardware components.
vPar: vPar is a virtual partition/separation of either a single computer or an nPar into
multiple virtual partitions using vPar software.
Here I will show you the method to find out the WWN details of a nPar machine.

Find Fibre HBA WWN Details in HP-UX nPar


Find HBA Cards
First login to nPar machine and run the below command to see the details of all 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

fc 3 0/0/0/4/0/0/3 fcoc CLAIMED INTERFACE HP N/A 10Gb


PCIe 2-port Embedded FCoE Adapter

/dev/fcoc3

fc 4 0/0/0/5/0/0/0 fcd CLAIMED INTERFACE HP 451871-B21


8Gb Dual Port PCIe Fibre Channel Mezzanine (FC Port 1)
/dev/fcd4
fc 5 0/0/0/5/0/0/1 fcd CLAIMED INTERFACE HP 451871-B21
8Gb Dual Port PCIe Fibre Channel Mezzanine (FC Port 2)
/dev/fcd5

Find WWN Details


Now run the below command to see the WWN details corresponding
to /dev/fcd4 and /dev/fcd5
# fcmsutil /dev/fcd4

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

Link Speed = 8Gb


Local N_Port_id is = 0xc90700
Previous N_Port_id is = 0xc90700
N_Port Node World Wide Name = 0x5001438021de4c27
N_Port Port World Wide Name = 0x5001438021de4c26
Switch Port World Wide Name = 0x20070027f880881f
Switch Node World Wide Name = 0x10000027f880881f
N_Port Symbolic Port Name = PCPEPSWA_fcd5
N_Port Symbolic Node Name = PCPEPSWA_HP-UX_B.11.31
Driver state = ONLINE

# 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

# machinfo |grep serial


Machine serial number: SGH319V9YY

OR
19 ASHIS CHANDRA DAS

# /usr/contrib/bin/machinfo |grep serial


Machine serial number: SGH319V9YY

April 6, 2017 DbAppWeb Admin


Error: This error occurred after installation of some patches and changes in
configuration files like /etc/hosts, /etc/rc.config.d/netconf etc.
#hpvmstatus
hpvmstatus: HPVM currently not running.

Solution:
in the /etc/rc.config.d/hpvmconf you need to set the HPVM_ENABLE=1 to enable
Integrity VM at boot time.

Otherwise /sbin/init.d/hpvm start should start Integrity VM

# /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

# ioscan -fnNC disk

Class I H/W Path Driver S/W State H/W Type Description

===================================================================
20 ASHIS CHANDRA DAS

disk 3 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP


Virtual LvDisk

/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

disk 4 64000/0xfa00/0x7 esdisk CLAIMED DEVICE


3PARdataVV

/dev/disk/disk4 /dev/rdisk/disk4

disk 5 64000/0xfa00/0x8 esdisk CLAIMED DEVICE


3PARdataVV

/dev/disk/disk5 /dev/rdisk/disk5

disk 17 64000/0xfa00/0x2b esdisk CLAIMED DEVICE


3PARdataVV
/dev/disk/disk17 /dev/rdisk/disk17

Create Physical Volume


Create the physical volume using the command pvcreate. Physical volume
“/dev/rdisk/disk17” has been successfully created.

# pvcreate /dev/rdisk/disk17

pvcreate: Warning: The physical volume "/dev/rdisk/disk17", is initialized

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.

Physical volume "/dev/rdisk/disk17" has been successfully created.

Create Volume Group


Now create the volume group using the command vgcreate with the parameters given
below. Here I have given VG name as vgrctest and after successful execution of the
command Volume group “/dev/vgrctest” has been successfully created.
-V: vg version 2.0
-s : PE size (256 mb)
21 ASHIS CHANDRA DAS

-S: max vg size 2 peta byte.

# vgcreate -V 2.0 -s 256 -S 2p /dev/vgrctest /dev/disk/disk17

Volume group "/dev/vgrctest" has been successfully created.

Volume Group configuration for /dev/vgrctest has been saved in


/etc/lvmconf/vgrctest.conf

Display Volume Group Information


Display the VG information of the newly created volume group named vgrctest using the
command
vgdisplay -v. Here you can see the details that show the information like PE size, Total PE,
Free PE etc. This is a new volume group so all the 12287 PEs are free in this volume
group.

# vgdisplay -v /dev/vgrctest

--- Volume groups ---

VG Name /dev/vgrctest

VG Write Access read/write

VG Status available

Create Logical Volume


Create the logical volume using the command lvcreate and give the no of PEs for which
you want to create the logical volume. Here I have taken all PEs which are free. Logical
volume “/dev/vgrctest/lvol1” has been successfully created.

# lvcreate -l 12287 /dev/vgrctest

Logical volume "/dev/vgrctest/lvol1" has been successfully created with

character device "/dev/vgrctest/rlvol1".

Logical volume "/dev/vgrctest/lvol1" has been successfully extended.

Volume Group configuration for /dev/vgrctest has been saved in


/etc/lvmconf/vgrctest.conf
22 ASHIS CHANDRA DAS

Format Raw Logical Volume


Format the raw logical volume using the command shown below.

# newfs -F vxfs -o largefiles /dev/vgrctest/rlvol1

version 7 layout

3220963328 sectors, 402620416 blocks of size 8192, log size 32768


blocks

largefiles supported

Create Mount Point and Mount


Create Mount Point and Mount
Create the mount point directory and mount the formatted volume on the mount point
directory.

# mkdir /rctest

# mount /dev/vgrctest/lvol1 /rctest

# bdf

Filesystem kbytes used avail %used Mounted on

/dev/vg00/lvol3 4194304 3727320 466984 89% /

/dev/vg00/lvol4 10485760 8895680 1580536 85% /home

/dev/vgrctest/lvol1

3220963328 362072 3195440320 0% /rctest

Display SSH Warning Message Before Login Banner


You can display the banner message before login through /etc/issue file, this message
will be displayed before the password login prompt. Follow the process shown below:
23 ASHIS CHANDRA DAS

 Open the master ssh configuration file /etc/opt/ssh/sshd_config to enable


banners.
# vi /etc/opt/ssh/sshd_config
or
# vi /opt/ssh/etc/sshd_config

 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! *
***************************************************************
~

restart the SSH daemon to reflect new changes.


# /sbin/init.d/secsh stop
HP-UX Secure Shell stopped# /sbin/init.d/secsh start
HP-UX Secure Shell started

Display SSH Warning Message After Login


To display banner messages after login, you need to modify the /etc/motd file, which is
used to display banner messages after login.

 Open the file /etc/motd in vi editor.


# vi /etc/motd

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

-y = don’t ask for confirmation

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).

Unmount file system (FS)


Remove Logical Volume (LV)
Reduce/Remove Volume Group (VG)
Remove Physical Volume (PV) from LVM.
I have done this activity on an HP-UX machine, you can perform the same on a Linux
machine also.

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

List the mount point using the below command:


25 ASHIS CHANDRA DAS

# bdf
Filesystem kbytes used avail %used Mounted on

/dev/vgupload/lvupload
2147450880 471341672 1571352501 23% /upload

Umount file system (FS)


 To make sure nobody is using the file system, use the fuser command.
# fuser -cu /upload
/upload: 20310c(root)
# fuser -kcu /upload
/upload: 20310c(root)
 Confirm that nobody is using the file system
# fuser -cu /upload
/upload:
 unmount file system

Remove Logical Volume (LV)


 To remove LV use lvremove command, when prompted, press y to remove
the volume.
# lvremove /dev/vgupload/lvupload
The logical volume “/dev/vgupload/lvupload” is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume “/dev/vgupload/lvupload” has been successfully removed.
Volume Group configuration for /dev/vgupload has been saved in
/etc/lvmconf/vgupload.conf
 If the logical volume contains data, LVM prompts you for confirmation. You
can use the -f flag to remove the logical volume without a confirmation
request.
# lvremove -f /dev/vgupload/lvupload

Removing volume group


 # pvdisplay /dev/disk/disk8
— Physical volumes —
PV Name /dev/disk/disk8
VG Name /dev/vgupload

# vgdisplay -v vgupload|grep “PV Name”


PV Name /dev/disk/disk8
 Remove the volume group using the below command:
# vgremove vgupload
Volume group “vgupload” has been successfully removed.
26 ASHIS CHANDRA DAS

 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

Remove Physical Volume (PV) From LVM


 Remove the Physical Volume using below command:
# pvremove /dev/rdisk/disk8
The physical volume associated with “/dev/rdisk/disk8” has been removed.

October 26, 2016 DbAppWeb Admin

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:

Remove NO_HW Deices from HP-UX


 Run the below command to see all devices and identify the devices with
NO_HW. Here disk16 is NO_HW device.

 # ioscan -fnNC disk

 disk 5 64000/0xfa00/0x8 esdisk CLAIMED DEVICE


3PARdataVV

 /dev/disk/disk5 /dev/rdisk/disk5


27 ASHIS CHANDRA DAS

 disk 16 64000/0xfa00/0x2a esdisk NO_HW DEVICE


3PARdataVV
/dev/disk/disk16 /dev/rdisk/disk16
 Now run the below command, where 64000/0xfa00/0x2a is the hardware
path which is taken from the disk details shown above

 # 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.

 # ioscan -fnNC disk

 disk 5 64000/0xfa00/0x8 esdisk CLAIMED DEVICE


3PARdataVV

/dev/disk/disk5 /dev/rdisk/disk5

Now you can see that entry of “NO_HW” has been removed.

January 13, 2016 DbAppWeb Admin


If you forgot the root user password, then the only way to change it is by login in
through single-user mode. Since VPAR is not a physical machine so it can’t be restarted
directly. You have to login in to the VSP through NPAR management IP and then change
the password.
1. log in to npar on which vpar is built using management IP. The default username/password is
Admin/Admin. On successful login one will get the below menu:

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

2. Press CO and login to VSP. In our case username is root/ *****


# hostname
TESTVSP1
3. Use command vparstatus to find all vpar’s status
# vparstatus
[Virtual Partition]
Num Name RunState State
=== ========================== ============ =========
1 machine1 UP Active
2 machine2 UP Active
3 machine3 UP Active
[Virtual Partition Resource Summary]
Virtual Partition CPU Num Num Total MB Floating MB
Num Name Min/Max CPUs IO Memory Memory
===
========================== ======= ==== ==== =========
============
1 machine1 1/512 2 5 16384 0
2 machine2 1/512 3 5 16384 0
3 machine3 1/512 2 6 16384 0
4. Let us suppose you want to change root user password 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
(Use Ctrl-X to return to vMP main menu.)
[machine3] vMP:CM> pc
Current System Power State: On
Power Control Menu:
C – Power Cycle
ON – Turn Power On
OFF – Turn Power Off
G – Graceful Shutdown
Enter menu item or [Q] to Quit: OFF
System will be powered off.
You must shut down the guest OS manually before this command is executed.
Failure to do this can cause problems when the guest OS is restarted.
Confirm? (Y/[N]): y
-> System is being powered off.
[machine3] vMP:CM> exit
29 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.

<Press ma at this stage>


(C) Copyright 2000 – 2013 Hewlett-Packard Development Company, L.P.
Mapping vPar/VM memory: 16384MB
mapping RAM (0-400000000, 16384MB)
.
/opt/hpvm/lbin/hpvmapp (/var/opt/hpvm/uuids/bf4a7470-d390-11e2-a206-
d4c9ef060500/vmm_config.current): Allocated 17179869184 bytes at
0x6000000100000000
locking memory: 0-400000000
allocating overhead RAM (6000000500000000-6000000508000000, 128MB)
locking memory: 6000000500000000-6000000508000000
allocating datalogger memory: FF800000-FF900000 (1024KB)
allocating firmware RAM (fff00000-100000000, 1024KB)
locked SAL RAM: 00000000fff00000 (8KB)
locked ESI RAM: 00000000fff02000 (8KB)
locked PAL RAM: 00000000fff04000 (8KB)
locked Min Save State: 00000000fff0a000 (4KB)
locked datalogger: 00000000ff800000 (1024KB)
Creation of VM minor device 3
Device file = /var/opt/hpvm/uuids/bf4a7470-d390-11e2-a206-d4c9ef060500/vm_dev

Loading boot image


Image initial IP=102000 GP=69E000
Starting event polling thread
30 ASHIS CHANDRA DAS

guestStatsStartThread: Started guestStatsCollectLoop – thread = 6


Starting thread initialization
Daemonizing….
vparboot: Successful start initiation of vPar or VM ‘machine3’
6. Go to single-user mode and change the password of the user root
passwd root

[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

7. Now enter the new password for root user


# passwd root
<new password>
reenter password
<new password>
7. Reboot the system by using reboot command.
# reboot

You might also like