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   

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

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


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

ipforwarding Enable in Linux :- How to??

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

To enable :

#sysctl -w net.ipv4.ip_forward=1


#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

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:

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


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

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 <VG>

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

• 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 <cluster-ascii>

• Perform vgcfgbackup to backup the cluster lock information:
# vgcfgbackup <VG>

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

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

• Restart the cluster:
# cmruncl

MC Service Guard Config Files

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

IGNITE-UX setup - Quick start Guide

For Ignite unix setup and client configuration you can go thrw the below document. It is a simple and good
for system admins. It has a screen shot also.

IGNITE-UX Quick start setup Guide.pdf

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 <Tape_Drive_Device_File>

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

Reinstalling GRUB in ubuntu

In Ubuntu Linux OS to edit the grub config u have to edit the below file only,

#vi /boot/grub/menu.lst


To make a backup a copy of the existing menu.lst file use:

#cp /boot/grub/menu.lst /boot/grub/menu.lst.old
You can try re-installing the grub using the Ubuntu Live CD, in two different ways.

  1. Boot your computer up with Ubuntu CD
  2. Go through all the process until you reach "Disk Partition"
  3. Select Manual Partition
  4. Mount your appropriate linux partions  / /boot swap ..... 
  6. Finish the manual partition
  7. Say "Yes" when it asks you to save the changes
  8. It will give you errors saying that "the system couldn't install ....." after that
  9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
  10. Jump to "Install Grub ...."
  11. Once it is finished, just restart your computer
Command line
  1. Boot your computer up with Ubuntu CD
  2. Open a terminal window or switch to a tty.
  3. Go Super User (that is, type "sudo -s"). Enter root passwords as necessary.
  4. Type "grub"
  5. Type "find /boot/grub/stage1". You'll get a response like "(hd0,1)". Use whatever your computer spits out for the following lines.
  6. Type "root (hd0,1)", or whatever your hard disk + boot partition numbers are for Ubuntu.
  7. Type "setup (hd0)", to install GRUB to MBR, or "setup (hd0,1)" or whatever your hard disk + partition nr is, to install GRUB to a partition. 
  8. Quit grub by typing "quit".
  9. Reboot and remove the bootable CD.

How Manually boot Linux OS in Ubuntu??

These are the same 3 methods you see in a menu.lst, except in menu.lst you have "title" lines and you don't need the boot command (since it's implied). 

Method #1: Chainload To chainload Linux which is on (hdx,y):
grub>  root  (hdx,y)
grub>  chainloader +1
grub>  boot
Note: Windows is always booted by chainloading Note: To chainload, GRUB must first be installed in the OS's root partition. See Installing GRUB. So, run the commands:
 grub> root (hdx,y), grub> setup (hdx,y)

Method #2: Use the specific kernel-initrd commands (as in a full menu.lst), ending with the boot command.

Method #3: Configfile This almost always works! Example: To boot into Kubuntu on sdb3 (= (hd1,2)), type 

grub>  configfile  (hd1,2)/boot/grub/menu.lst    # you'll get the boot menu on sdb3


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.

Reduce file system size in unix ??

If online JFS is installed means

#swlist | grep -i "onlinejfs"

#bdf Filesystem
#fuser -cu <FS name>

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

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 syslog is not working
u have to check below

1.Any space issue /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)


# tail syslog.log

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


EMC Luns in hp Unix Server :How to view?

To view the EMC Luns on unix server

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


#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


#syminq | grep -i <EMC disk #>

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)

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.

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

open ports /sockets in hp unix :How to check??

To check the open ports

netstat -an | grep -i listen
netstat -an | grep <port number>

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

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 : <none>
Alternate bootpath : 0

Autoboot is ON (enabled) <<<==This means its on

# setboot
Primary bootpath : 0/1/1/0.1.0
HA Alternate bootpath : <none>
Alternate bootpath : 0

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

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

tar & untar a File ??

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


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

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/<device file>

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/<dev-file>

5. mkboot /dev/rdsk/<dev-file>

6.mkboot -a "hpux" /dev/rdsk/<dev-file>

7.vgchange -a y /dev/vg00

8.vgsync /dev/vg00

9. Reboot in multi-user mode

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

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

To get the NMID use lanscan command.

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
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" ]]
echo "${LOGNAME} is not allowed to login. Contact administrator <details>"
sleep 5
exit 1


Tar command for backup/restore in network ?

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

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

    To take the backup into remote tape device

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

B. Restore the backup from remote server:-

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

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 !!

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

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?

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.

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)

Linux Boot Process

 1. POST :

booting Linux begins in the BIOS at address 0xFFFF0.
It starts POST : to check the hardware & local device enumeration and initialization.

BIOS has 2 parts:
1. POST code and
2. Runtime services  (BIOS runtime searches for devices that are both active and bootable)

BIOS looks MBR in hardisk and its loads the content of MBR to memory (RAM).and then it passes the control to MBR.

MBR :MBR contains the primary boot loader.
     The MBR is a 512-byte sector,
     Located in the first sector on the disk (sector 1 of cylinder 0, head 0).

2. STAGE 1 Boot loader:

MBR is a 512-byte image containing both program code and a small partition table.

first 446 bytes : Primary boot loader (contains both executable code and error message text)
Next 64 Bytes   : The partition table (contains a record for each of four partitions )
Last 2 Bytes : The magic number (0xAA55) : (magic number serves as a validation check of the MBR.)

Job of the primary boot loader is to find and load the secondary boot loader (stage 2)

3.Stage 2 boot loader:

Task at this stage is to load the Linux kernel and optional initial RAM disk.

The first & second-stage boot loaders are called Linux Loader (LILO) or GRand Unified Bootloader (GRUB).

GRUB can load a Linux kernel from an ext2 or ext3 file system.  
GRUB : Understands file systems and configuration lives in /boot/grub/menu.lst or /boot/boot/menu.lst

Stage 1 (MBR) boots a stage 1.5 boot loader that understands the particular file system containing the Linux kernel image.

Once stage 2 loaded, GRUB can, upon request, display a list of available kernels (defined in /etc/grub.conf)

Default kernel image and initrd image are loaded into memory. then the stage 2 boot loader invokes the kernel image.

4. Kernel :

Kernel initialize the devices and Loads initrd.

Kernel executes  /linuxrc to mount the root file system.And then it runs /sbin.init

/sbin/init reads the content of /etc/inittab and run the boot scripts @ /etc/rc.d/rc.sysinit.

/etc/rc.d.rc.sysinit :It loads modules, check root FS and mount RW, mount local FS, setup network, and mount remote FS.

Finally based on the /etc/inittab entry system switches to default runlevel.

RedBoot & U-Boot ?

RedBoot, the Red Hat Embedded Debug and Bootstrap firmware, is a complete bootstrap environment for embedded systems.

RedBoot was originally developed by Red Hat, but is now developed and maintained on the net alongside eCos as an open source project. All sources and documentation for RedBoot, and the eCos operating system
on which it is based, are freely available without license or royalties.

RedBoot allows download and execution of embedded applications via serial or ethernet, including embedded Linux and eCos applications. It can be used for both product development (debug support) and in deplayed products in the field (Flash update and network booting).

U-Boot is a universal boot loader for embedded boards based on PowerPC, ARM, MIPS and several other processors, which can be installed in a boot ROM and used to initialize and test the hardware or to download and run OS and application code.

Sample features are:

    * serial console support
    * integrated shell alike setup interface
    * optional password protectection and timeout for acces to setup interface on boot
    * editable configuration space
    * downloads software trough tftp servers
    * flash routines for EEPROMS of misc technology including NANDs
    * runs test applications directly
    * boots Linux

Content of MBR in Linux : How to Read?

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.

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

# rm *
# cd ..
# rmdir test

Now check the inode usage again.

# bdf -i /opt

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

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

Disk is bootable or not :How t o check ?

To display the different bootstrings for a disk:

# lifls <rawdevice>

For example:

# lifls /dev/rdsk/c0t6d0

A bootable disk reports something like:


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 <blockdevice>:<STRING> -

For example:

# lifcp /dev/dsk/c0t6d0:AUTO -

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      

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.

Why are mail files in /var/mail owned by 'daemon' instead of the recipient?

The mail delivery agent /bin/rmail needs to be able to chown(2) these files.  It can not do so if you have removed the privilege CHOWN (see
setprivgrp(1m); removing CHOWN is recommended to prevent cheating on disk quotas). 
To get around this, noting that /bin/rmail runs setgid to group mail, you can grant privilege CHOWN to group mail only by inserting the
line "mail CHOWN" in /etc/privgroup.  The change takes effect on the next reboot, or immediately if you execute the command
"setprivgrp -f /etc/privgroup".

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 <Input.psf-file> -x create_target_acls=false -x target_type=tape -d <output.depot-file>

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

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:

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

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:
The patch is currently active on the system and is the most recent member of its supersession
chain to have been loaded.

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.

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

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 

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

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

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.

Boot from alternate kernel in hp ux?

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 ?>

Interact with IPL (Y or N)?>Y

Boot IO Dependent Code (IODC) revision 4

Hard Booted

ISL Revision A.00.38 Oct 26, 1994

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

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


    *  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)
Blogger Tips and TricksLatest Tips And TricksBlogger Tricks