Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (11) AWS (5) numerology (5)
Showing posts with label hpunix. Show all posts
Showing posts with label hpunix. Show all posts

Friday, August 7, 2015

Basics of DRD (Dynamic Root Disk) + HPUX

Basics of DRD (Dynamic Root Disk):

Product: DynRootDisk
1) DRD toolset is used to clone HPUX system image to an inactive disk for software update, maintenance, recovery & reshosting.
2) When modifications on cloned system image is done then we can boot the cloned system image on the original system or on a different system (rehosting)
3) Reduces system down time.
4) We can use DRD to clone HP-IVM

Basic commands used in DRD:
1.       #drd status à to see status of primary disk and clone disk also shows information of current boot disk and the server will rebooted by which disk.

2.       #drd clone à to clone primary root disk with inactive disk. It copies LVM volume group vg00


3.       #drd activate à it mention that the inactive system image to boot either immediately or the next time the system boots.

4.       #drd deactivate à used for “undoing” a drd activate command.


5.       #drd mount à to mount all file systems of the cloned image

6.       #drd runcmd à runs a DRD-safe command on the cloned (inactive) system image

Let’s take a example of Patching a server using DRD:
1. Create DRD clone
# drd clone -x overwrite=true -v -t [inactive disk name]

2. mount DRD
# drd mount

3. check DRD
# lvlnboot -v
# vgdisplay drd00

4. Apply the patches on the mounted clone
# drd runcmd swinstall-s /tmp/patch.1.deopt

5. Check the installed patches
# drd runcmd swlist patch.1

6. Activate the image and reboot the server

# drd activate -x reboot=true



Thanks...
Kiran Jadhav

**Let's Share knowledge and keep visiting here**

Monday, August 3, 2015

Operating environment in HP-UX 11i V3 + HPUX

Operating environment in HP-UX 11i V3 + HPUX


HP-UX 11i v3 OEs run on all members of the Integrity server family, from server blades, to entry-class, midrange and Superdome systems.

Command to find out "what operating environment we have on our server":

#swlist | grep -i oe

Below are the various OE's available in HP-UX 11i V3: I have explained their uses in one liner.


HPUX11i-B-OE - HP-UX 11i V3 Base OE - Base operating environment.

HPUX11i-VSE-OE - HP-UX 11i V3 Virtual Server OE - Virtualization (Vpar; Npar; HP-VM) is possible but can not create cluster

HPUX11i-HA-OE : HP-UX 11i V3 High Availability OE - No virtualization but we can create clusters. HP Service guard cluster software will be integrated with this.

HPUX11i-DC-OE : HP-UX 11i V3 Data Center OE - It is combination of HA-OE and VSE-OE and both of which include BOE. Means we can do everything; virtualization and cluster is
supported.



Thanks...
Kiran Jadhav


**Let's Share knowledge and keep visiting here**


Monday, July 20, 2015

ntpdate: no server suitable for synchronization found + HPUX

ntpdate[9523]: no server suitable for synchronization found

While starting the ntp service, we were getting below error:

tigersrv:/home/root> /sbin/init.d/xntpd start
16 Jul 09:17:12 ntpdate[9523]: no server suitable for synchronization found

solution:

1.

tigersrv:/home/root> ntpq -p
     remote           refid      st t when poll reach   delay   offset    disp
=========================================================================
 NTP IP      0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0

The “refid” should reflect some value.


2. Try to update the date through ntp server

tigersrv:/home/root> ntpdate -d NTP IP
transmit(NTP IP)
transmit(NTP IP)
transmit(NTP IP)
transmit(NTP IP)
transmit(NTP IP)
server NTP IP, port 123
stratum 0, precision 0, leap 00, trust 000
refid [0.0.0.0], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:      00000000.00000000  Thu, Feb  7 2036  1:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036  1:28:16.000
transmit timestamp:  d9523075.8c7a1000  Thu, Jul 16 2015  9:30:29.548
filter delay:  0.00000  0.00000  0.00000  0.00000
               0.00000  0.00000  0.00000  0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
               0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

16 Jul 09:30:30 ntpdate[29299]: no server suitable for synchronization found

3. Try to ping the server; if it not pingable then check whether the server is down or not.

4. If you have other ntp server then add that entry in ntp config file etc..

Try to sync the time by using new NTP server.

tigersrv:/home/root> ntpdate -d [New Ntp server IP]

5. Edit the /etc/rc.config.d/netdaemons file

export NTPDATE_SERVER="NTP IP New NTP IP"   ---> You can mention two NTP servers IPs by giving space
export XNTPD=1
export XNTPD_ARGS=

*.- Edit the /etc/ntp.conf file
Add the following lines
server NTP IP prefer
server New NTP IP

6. stop and start ntp daemon [xntpd]

#/sbin/init.d/xntpd stop

#/sbin/init.d/xntpd start


Regards,
Kalyanjit

Friday, July 17, 2015

Dangerous/Hazardous commands in HPUX


 Dangerous/Hazardous commands in HPUX:

1. We have to be very cautious while working on Production/Development servers.

2. If we are not sure about any command then it is always preferable to go and see manual page for that command. 
#man [command]

Below are few Dangerous commands which can harm the server :

1. #rm - remove file; do not use -f option

2. #chown - change owner; careful while executing this command with -r option

3. #chmod - modify permissions of file/Dir; careful while executing this command with -r option

4. #mv - moving files/dirs; do not use -f option

5. #hostname - Display hostname of server; careful while using any option to this command

6. #date - display date of server; "-s, --set=" can change system date/time

7. #last |grep -i reboot - to grep  when the server was rebooted through last command; if we forget to put grep then the server will get reboot. 

so always use single or double quotes with grep

8. #init; Change system runlevels

9.  #ntpdate - set the date and time via NTP

10. #reboot; #shutdown - to reboot server

11. #ifconfig - Bring down/up network interfaces



I'll keep on updating the command list if i found any new dangerous command.


Thanks...
Kiran Jadhav


**Let's Share knowledge and keep visiting here**


Monday, July 6, 2015

Decimal to Hexadecimal conversion through bc command - HPUX


Binary = base is 2

Hexadecimal = base is 16

By default we use decimal value.


1. Convert Decimal to Hexadecimal through bc command :

Here we have to define obase value obase - output base; here obase=16 since we are converting the decimal values to Hexadecimal

testserver:/] bc
obase=16
198
C6

or

testserver:/] echo "obase=16; 198" |bc
C6



2. Convert Hexadecimal to Decimal through bc command:

Here we have to define ibase value ibase - input base; here ibase=16 since we are converting Hexadecimal values to the decimal values.


testserver:/] bc
ibase=16
C6
198

or

testserver:/] echo "ibase=16; C6" |bc
198


Similarly we can convert decimal to oct or decimal to Bin or decimal to any base number and vice versa.


Thanks...
Kiran Jadhav


**Let's Share knowledge and keep visiting here**

Wednesday, July 1, 2015

How to Identify Luns on EMC- Symmetrix Storage – HPUX

How to Identify Luns on EMC- Symmetrix Storage – HPUX

How to Identify Luns on EMC- Symmetrix Storage (EMC    :SYMMETRIX ) in HP11iV3

1.       Device name/Lun id’s are : 0e2f

   No need to convert it into hexadecimal like we convert it for Clariion storage

2.    Try to grep the Lun Id :

testserver:/dev/disk# /usr/local/bin/inq.HPUXIA64 |grep  -i 0e2f
/dev/rdisk/disk1428 :EMC     :SYMMETRIX       :5874  :0200e2f000 :    40266240

3.   We can verify the same in /dev/disk directory:

testserver:/dev/disk# ls -lt |more
total 0
brw-r-----   1 bin        sys          1 0x000034 May  2 14:34 disk1428

4.   Also the disks in scsimgr output; the ‘SCSI services internal state should be UNOPEN’


#scsimgr -v get_info all_lun |more

or 

#scsimgr get_info -D /dev/rdisk/disk1428 |grep -i "SCSI services internal state"

Or


#scsimgr lun_map -D /dev/rdisk/disk1428



Thanks...
Kiran Jadhav

**Let's Share knowledge and keep visiting here**

Tuesday, June 30, 2015

How to Identify New IBM disks - HPUX

How to Identify New IBM disks - HPUX


11 .    Below disk were added by storage team.

disk    5  64000/0xfa00/0xa4  esdisk   CLAIMED     DEVICE       IBM     2145
                      /dev/disk/disk5   /dev/rdisk/disk351


22 .     We cannot use inq or syminq  command as they are IBM luns; inq is only used from EMC luns (clariion and symmetrix).

33 .     By below way we can identify EMC- Clariion/EMC- Symmetrix storage
EMC- Clariion Storage (DGC  :CX4-240WDR5)

/dev/rdisk/disk112    :DGC     :CX4-240WDR5     :HP03  :Ch2 CONT   :    41943040:  13: 29d:ASSIGNED

EMC- Symmetric Storage  (EMC     :SYMMETRIX )

dev/rdisk/disk255  :EMC     :SYMMETRIX       :5874  :0200386000 :    40266240

44 .     So we used below commands to find the luns WWID given by storage team (B0C)

testserver:/homeroot> scsimgr -v get_info -D /dev/rdisk/disk5 |grep -i wwid
World Wide Identifier (WWID)                  = 0x600507680183064f9800000000000b0c





Thanks...
Kiran Jadhav

**Let's Share knowledge and keep visiting here**

Tuesday, March 31, 2015

Fiber channel (HBA - Host Based Adapter) WWN in HPUX/LINUX/AIX

Commands to get Fiber channel (HBA - Host Based Adapter) WWN in HPUX/LINUX/AIX:

At the time of server decommissioning process we ask storage team to remove storage attached to server which we are going to decommission. Then storage team may ask us to provide FC WWN details.


So here is the way to find it out:

HPUX:

#ioscan -fnCfc

#fcmsutil [/dev/fcd0, /dev/fcd1 ....] |grep -i port


Linux:

#systool -c fc_host -v |grep -i "port_name" 


AIX:

#lsdev |grep fcs


#lscfg -vl [fcs0, fcs1 ...] |grep Network



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Tuesday, March 3, 2015

Set non expire password + HPUX

Set non expire password + HPUX

We are taking "kiraan"as an username.

For trusted system:

Before:
ehorse:/> /usr/lbin/getprpw kiraan
uid=304198, bootpw=NO, audid=167, audflg=1, mintm=-1, maxpwln=-1, exptm=-1, lftm=-1, spwchg=Wed Aug 13 01:31:36 2014, upwchg=-1, acctexp=-1, llog=-1, expwarn=-1, usrpick=DFT, syspnpw=DFT, rstrpw=DFT, nullpw=DFT, admnum=-1, syschpw=DFT, sysltpw=DFT, timeod=-1, slogint=Tue Sep 30 09:40:55 2014, ulogint=Wed Feb 11 14:16:53 2015, sloginy=-1, culogin=3, uloginy=-1, umaxlntr=-1, alock=NO, lockout=1000000

Run below command:

#/usr/lbin/modprpw -m exptm=0,lftm=0,mintm=0,expwarn=0,llog=0 kiraan

After:
ehorse:/> /usr/lbin/getprpw kiraan
uid=304198, bootpw=NO, audid=167, audflg=1, mintm=0, maxpwln=-1, exptm=0, lftm=0, spwchg=Wed Aug 13 01:31:36 2014, upwchg=-1, acctexp=-1, llog=0, expwarn=0, usrpick=DFT, syspnpw=DFT, rstrpw=DFT, nullpw=DFT, admnum=-1, syschpw=DFT, sysltpw=DFT, timeod=-1, slogint=Tue Sep 30 09:40:55 2014, ulogint=Wed Feb 11 14:16:53 2015, sloginy=-1, culogin=3, uloginy=-1, umaxlntr=-1, alock=NO, lockout=0000000

For non-trusted system:

#passwd -x -1 username


Thanks...
Kiraan B Jadhhav

Monday, February 9, 2015

Password cannot be circular shift of logonid +HPUX

Error : Password cannot be circular shift of logonid
******************************************

hpuxsrv:/> passwd kalyanjit
Changing password for kalyanjit
Last successful password change for kiren: Thu Feb  5 15:06:04 2015
Last unsuccessful password change for kiren: NEVER

New password:
Password cannot be circular shift of logonid.


Trick:


testhpux:/sbin/passwd kalyanjit
New password:
Re-enter new password:

Reason: /sbin/passwd -  it allows to change the password even if it is changed 5 minutes before also. 


Thanks...
Kalyanjit


**Let's Share our knowledge and keep visiting here**

Friday, January 30, 2015

Shutdown/reboot/halt commands + HPUX

Shutdown/reboot/halt commands + HPUX

From Multi-user mode:

* shutdown -ry 0 --> reboot

* shutdown -hy 0 --> shutdown and halt


or


 init 0 --> halt


* shutdown 0 --> shutdown to single user mode


or


init s


or


ISL> hpux -is --> from console,by interrupting the auto boot process



* reboot 0 --> reboot



Note : 0 means restart/halt the server immediately.

Graphical View of Shutdown process:



From console (GSP Menu) :

  a.TC : it will create the dump

  b.RS :RST(reset)signal will be send to processor

  C.PC : power cycle




Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**




Tuesday, January 27, 2015

Root password forgot + HPUX

Root password forgot + HPUX

Situation: I was not able to do sudo as somebody changed the permission on sudoers file or sudoers file is corruped so I had to login with root user through console, but i 
got to know that i dont know root password.

While doing sudo i got below error:

mysrv:/home/> sudo su -
sudo: /opt/iexpress/sudo/etc/sudoers is mode 0440, should be 0644


Solution : Reboot the server in single user mode through console and edit the file /tcb/files/auth/r/root.

Steps:

1. Reboot the server through console either by PC or RS command:

2. interrupt the boot sequence to interact with ISL (initial system loader)

************************************
Processor is booting from first available device.

To discontinue, press any key within 10 seconds.

Boot terminated.


---- Main Menu ---------------------------------------------------------------

     Command                           Description
     -------                           -----------
     BOot [PRI|ALT|]             Boot from specified path
     PAth [PRI|ALT] []           Display or modify a path
     SEArch [DIsplay|IPL] []     Search for boot devices

     COnfiguration menu                Displays or sets boot values
     INformation menu                  Displays hardware information
     SERvice menu                      Displays service commands

     DIsplay                           Redisplay the current menu
     HElp [|]           Display help for menu or command
     RESET                             Restart the system
----
Main Menu: Enter command or menu > bo pri ISL
Interact with IPL (Y, N, or Cancel)?> Y

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


HARD Booted.

ISL Revision A.00.43  Apr 12, 2000

ISL>


3. Go to single user mode

*******************************************************

ISL> hpux -is

Boot
: disk(0/0/1/1.2.0.0.0.0.0;0)/stand/vmunix
10649600 + 2105344 + 2044264 start 0x1fe4e8

alloc_pdc_pages: Relocating PDC from 0xf0f0000000 to 0x7fa01000.
gate64: sysvec_vaddr = 0xc0002000 for 2 pages
NOTICE: autofs_link(): File system was registered at index 3.
NOTICE: cachefs_link(): File system was registered at index 5.
NOTICE: nfs3_link(): File system was registered at index 6.
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/2/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/3/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/6/0/0
td: claimed Tachyon XL2 Fibre Channel Mass Storage card at 0/7/0/0

    System Console is on the Built-In Serial Interface
Logical volume 64, 0x3 configured as ROOT
Logical volume 64, 0x2 configured as SWAP
Logical volume 64, 0x2 configured as DUMP
    Swap device table:  (start & size given in 512-byte blocks)
        entry 0 - major is 64, minor is 0x2; start = 0, size = 8388608
Starting the STREAMS daemons-phase 1
Checking root file system.
log replay in progress
replay complete - marking super-block as CLEAN
Root check done.
Create STCP device files
Starting the STREAMS daemons-phase 2
              $Revision: vmunix:    vw: -proj    selectors: CUPI80_BL2000_1108 -c 'Vw for CUPI80_BL2000_1108 build' -- cupi80_bl2000_1108 'CUPI80_BL2000_1108'  Wed Nov  8 
19:24:56 PST 2000 $
Memory Information:
    physical page size = 4096 bytes, logical page size = 4096 bytes
    Physical: 4194304 Kbytes, lockable: 3158620 Kbytes, available: 3639268 Kbytes

/sbin/ioinitrc:
/dev/vg00/lvol1: 67 files, 0 icont, 5132 used, 57066 free (162 frags, 7113 blocks)
/sbin/krs_sysinit:


Starting EMC PowerPath.


INIT: Overriding default level with level 's'

INIT: SINGLE USER MODE

INIT: Running /sbin/sh

****************************************************************

4. Run mountall command or just mount /var , /tmp, /usr by looking into /etc/fstab file.

# cat /etc/fstab

#mountall

Note: while mounting FS if any error comes then run fsck command on that LVs/FS.


5. Try to change root password. but we can't as we dont know old root password.

# passwd root
Old password:

6. So edit the trusted system file means /tcb/files/auth/r/root and nullify the u_pwd string which stores password in it.

# cat /tcb/files/auth/r/root |grep -i "u_pwd"
        :u_pwd=mGsOWDUjI0ULw4bkUQL6uxQY:\

7. After making null password or blank password

# cat /tcb/files/auth/r/root |grep -i "u_pwd"
        :u_pwd=:\

8. Now change the password for root, this time it will not ask old root password to type.

# passwd root

9. unmount all the mouted filesystems.

# umountall

10. Reboot the system 

# reboot
Shutdown at 14:45 (in 0 minutes)
System shutdown time has arrived


Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Tuesday, January 13, 2015

Genesis Partiotion - HPUX

Interview Question:

What is Genesis Partition?

Answer:

1. The first npar created in a server is referred to as Genesis partiontion.

2. It is a single cell partition built via MP (Management Processor). We can load the HP-UX 11i OE once the genesis partition is created

3. To create genesis partion. go to MP --> CM --> CC & then choose option G.       Pick a cell that contains processors & memory and it must be conneced an         I/O chasis with a core I/O card installed.

   Use the "bo" option from MP menu to boot the npar & start the installation.

4. After the installation, issue "parstatus" command to check the status &               resourcess available on that npar.


  Display the local partition number in a full sentence.
  # parstatus -w



Thanks...
Kiran Jadhav

**Let's Share our knowledge and keep visiting here**

Saturday, January 10, 2015

Bound and Unbound CPU - HPUX

Bound and Unbound CPU - HPUX:

In Vpars, there are two types of CPU

1. Bound CPU 2. Unbound CPU

* A bound cpu is assigned to handle I/O interrupts in Vpar. So every Vpar must have atleast 1 bound CPU.

* An unbound cpu is floater cpu. The CPU which is not assinged to any Vpar or which is assigned but do not handle I/O interrupts is "Unbound Cpu"

* All CPU's are initially not assigned to any Vpar so all CPU begin as unbound cpu.

* Using Vpar command we can assign cpu as bound or unbound to Vpar.

* We can dynamically migrate only unbound CPUs.

####################################

consider below cases:
vparname: myvpar
2 bound cpu; 1 unbound cpu

{To create the partition winona2 with two bound CPUs and one unbound CPU
# vparcreate -p myvpar -a cpu::3 -a cpu:::2}

Vparname: urvpar
two bound and two unbound CPUs


1.To add an unbound CPU to an existing partition,
either modify the total number of CPUs (-m cpu::total) or add to the total number of CPUs (-a cpu::total).

myvpar# vparmodify -p myvpar -m cpu::4
or add one to total:

myvpar# vparmodify -p myvpar -a cpu::1


2. To delete one unbound CPU from the partition myvpar, which is having 3 CPUs:

myvpar# vparmodify -p myvpar -m cpu::2

or

myvpar# vparmodify -p myvpar -d cpu::1



3. migrate 1 unbound cpu from myvpar to urvpar

myvpar# vparmodify -p myvpar -d cpu::1; vparmodify -p urvpar -a cpu::1



Thanks...
Kiran Jadhav

**Let's Share our knowledge and keep visiting here**

Wednesday, December 31, 2014

Identify new Lun’s added in 11.31 on EMC SYMMETRIX storage + HPUX

How to identify new Lun’s added in 11.31 on EMC SYMMETRIX storage:

   Device name       Size   

        9da                30GB   
       
Here Device name/Lun id is 9da.

{Note :

EMC SYMMETRIX - No need to convert it into hexadecimal to get Lun ID 

EMC SYMMETRIX - convert it into hexadecimal to get Lun ID }


Steps:

1.       #ioscan –fnCdisk  

2.       #insf   -e disk   

3.       #ls –lt /dev/disk |more
brw-r-----   1 bin        sys          1 0x000013 Sep 20 16:57 disk411


See the timestamp to identify newly added disks.

4.       #ioscan –m dsf /dev/disk/disk411

5.       #ioscan -m lun  

6.       #strings /etc/lvmtab |grep –i disk411 


7.    # /usr/local/bin/inq.HPUXIA64 -showvol |grep -i 9da
        ........../dev/rdisk/disk411  :EMC     :SYMMETRIX       :5874  :02009da000 :   009DA:    40266240
        /dev/rdsk/c25t8d2   :EMC     :SYMMETRIX       :5874  :02009da000 :   009DA:    40266240
        /dev/rdsk/c28t8d2   :EMC     :SYMMETRIX       :5874  :02009da000 :   009DA:    40266240


8.       #scsimgr -v get_info all_lun   < To get all status information of all the LUNs>


or       #scsimgr get_info -D /dev/rdisk/disk411 |grep "SCSI services internal state"


"SCSI services internal state" is UNOPEN then that is unused disk. If disk is used then the state will be ONLINE



Thanks...
Kiran Jadhav

**Let's Share our knowledge and keep visiting here**

Tuesday, December 23, 2014

How to find system is booted from which disk - hpux

How to find system is booted from which disk in Hpux:


On HPUX 11.31 (11iv3) :

1. From setboot command

testsrv:/] setboot
Primary bootpath : 0/0/0/2/0/0/0.0x0.0x1000000c0000000 (/dev/rdisk/disk5)
HA Alternate bootpath :
Alternate bootpath : 1/0/0/2/0/0/0.0x0.0x1010000c0000000 (/dev/rdisk/disk7)

Autoboot is ON (enabled)
Hyperthreading : ON
               : ON (next boot)

See the primary bootpath.

2. From reading the information from /stand/vmunix

testsrv:/] echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem
bootdev:
bootdev:        0x100000a

testsrv:/] ll /dev/disk/* |grep 00000a
brw-r-----   1 bin        sys          1 0x00000a Nov 30  2011 /dev/disk/disk5_p2
cr--------   1 root       root        12 0x00000a Feb 15  2013 /dev/disk/disk5_p2.pt




Thanks...
Kiraan B Jadhhav


**Let's Share our knowledge and keep visiting here**

Friday, December 19, 2014

Few points on LVM - HPUX

Few points on LVM:

1. We can create a LV of size greater than a PV size. This feature is called "Disk Spanning".

2. We can create upto 6 mirror copies simultaneously which required a product "HP MIRROR DISK/UX".

3. Mirrored data can be configured to automatically create a new mirror to a separate disk when of mirror copies fails called as "SPARING" & required a product "HP MIRROR
DISK/UX".

4. We can create a LV so that contiguous data can be distributed accross multiple disks, which speeds I/O throughput for large files by reading and writing sequentially. This
feature is called "STRIPING".



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**

Wednesday, December 17, 2014

Extending root FS (mirrored) online - hpux

Extending root FS (mirrored) online

mysrv:/> lvdisplay /dev/vg00/lvol1 |grep -i allocation
Allocation                  strict/contiguous

mysrv:/> lvdisplay /dev/vg00/lvol2 |grep -i allocation
Allocation                  strict/contiguous


mysrv:/> lvdisplay /dev/vg00/lvol3 |grep -i allocation
Allocation                  strict/contiguous


mysrv:/> lvdisplay /dev/vg00/lvol4 |grep -i allocation
Allocation                  strict

if strict policy then LVM helps to avoid creating multiple mirror copies on a single bus.
contiguous - means PEs are adjoining/touching.


This method can be used on HP-UX 11.11 / 11.23 with Legacy Addressing (/dev/dsk/c#t#d#)

HP-UX versions prior to 11.31:


Here we want to extend FS / or LV /dev/vg00/lvol3

#bdf /

1. Take ignite backup or have full backup of vg00

2. Identify primary disk and secondary/alternate disk:

2.1 # setboot
2.2 # lvlnboot -v
2.3 #cat /stand/bootconf

   primary disk= /dev/dsk/c0t8d0
   secondary/alternate disk = /dev/dsk/c1t8d1

3. Reduce the mirror on every LV under vg00; if we have 8 lvs in vg00 then remove mirror from those LVS

#lvreduce -m 0 /dev/vg00/lvol1
#lvreduce -m 0 /dev/vg00/lvol2

.
.
#lvreduce -m 0 /dev/vg00/lvol8

4. Remove the mirror disk/secondary disk (/dev/dsk/c1t8d1) from vg00

#vgreduce vg00 /dev/dsk/c1t8d1

5. Create a PV on secondary disk

#pvcreate /dev/rdsk/c1t8d1

6. Add that PV in vg00

#vgextend vg00 /dev/dsk/c1t8d1

7. Move the PEs of all the Lvs in vg00 other than lvol1, lvol2 & lvol3 as they are contiguous in nature on secondary disk(/dev/dsk/c1t8d1)

Note : here we are making space on primary disk so moved all LEs from lovl4 .... to secondary disk.

#pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t8d0 /dev/dsk/c1t8d1
#pvmove -n /dev/vg00/lvol5 /dev/dsk/c0t8d0 /dev/dsk/c1t8d1
.
.

8. Extend the root FS.

#lvextend -L {size in MB} /dev/vg00/lvol3
#fsadm -b {size in MB}m /

9.Move back all LE's of all LVs from secondary disk to primary disk.

#pvmove -n /dev/vg00/lvol4 /dev/dsk/c1t8d1 /dev/dsk/c0t8d0
#pvmove -n /dev/vg00/lvol5 /dev/dsk/c1t8d1 /dev/dsk/c0t8d0
.
.

10. Remove secondary disk from vg00 so we can make the disk as bootable disk.

vgreduce /dev/vg00 /dev/dsk/c1t8d1

11.Create a boot disk.

#pvcreate -B /dev/rdsk/c1t8d1

#mkboot -a "hpux -lq" /dev/rdsk/c1t8d1

{Change the AUTO file to hpux -lq so the host can boot without quorum if one mirror disk fails.}

12. Extend the root VG with new boot disk

#vgextend /dev/vg00 /dev/dsk/c1t8d1

13. Mirror all Lvs present on primary disk to secondary disk.

#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t8d1
#lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t8d1
.
.
.
#lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c1t8d1

14. check if root,boot,swap& dump are properly configured.

#lvlnboot -v

15. Verify low quorum is set for both disk

#lifcp /dev/dsk/c0t8d0:AUTO-
#lifcp /dev/dsk/c1t8d1:AUTO-

16. run bdf command and compare old bdf output with current bdf output

#bdf /



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**




Thursday, December 4, 2014

Identify VG is in cluster or not - hpux

How to identify VG is in cluster or not in HPUX

Just by checking the VG status we can identify whether that particular VG is in cluster or not?

#vgdisplay |grep -i "vg status"

VG status = available --> VG is online and available and not in cluster.

or

VG status = available/exclusive --> VG is cluster aware. If VG is in exclusive mode then the node on which VG is activated in exclusive mode will have read - write access to this VG; other node
will be having read only access


Thanks...
Kiraan B Jadhhav


**Let's Share our knowledge and keep visiting here**

Wednesday, December 3, 2014

Sticky bit - HPUX

Sticky bit - HPUX

If the sticky bit is set on a directory then files inside the dir will be renamed/removed only by owner of the file; the owner of the dir or the superuser.

The classic example is /tmp.

$ ls -ld /tmp
drwxrwxrwt  25 bin        bin          16384 Dec  3 09:54 /tmp

How to set sticky bit:

$ ls -ld learn
drwx------   2 kiran      users           96 Dec  3 10:03 learn

$ chmod +t learn

or
$ chmod 1700 learn

$ ls -ld learn
drwx-----T   2 kiran      users           96 Dec  3 10:03 learn

How to unset sticky bit:

$ chmod -t learn

or

$ chmod 0700 learn


if 4000 = set uid  ---> directories with set Gid permission will force all files and sub-directories created in them to be owned by the directory group and not the group of the user creating the 
file.
2000 = set Gid  --> setuid permission set on a directory is ignored on UNIX. Set UID allows an executable to be run with the privilages of the executables owner.



Thanks...
Kiran Jadhav


**Let's Share our knowledge and keep visiting here**