Showing posts with label HP-UX. Show all posts
Showing posts with label HP-UX. Show all posts

Monday, August 1, 2011

HPUX LVM vg00 mirror

vg00 originally mirrored with disk9_p2 and disk8_p2. Want to get rid of disk9 and disk8 and use disk6 and disk7.

serverA:home/user $ ioscan -fnCdisk
Class I H/W Path Driver S/W State H/W Type Description
==================================================================
disk 0 0/0/0/2/0/0/0.8.0 sdisk CLAIMED DEVICE HP EH0146FAWJB
/dev/dsk/c0t8d0 /dev/rdsk/c0t8d0
disk 1 0/0/0/2/0/0/0.8.1 sdisk CLAIMED DEVICE HP EH0146FAWJB
/dev/dsk/c0t8d1 /dev/rdsk/c0t8d1
disk 2 0/0/0/5/0/0/0.1.6.0.0.0.1 sdisk CLAIMED DEVICE HP HSV450
/dev/dsk/c2t0d1 /dev/dsk/c2t0d1s2 /dev/rdsk/c2t0d1 /dev/rdsk/c2t0d1s2
/dev/dsk/c2t0d1s1 /dev/dsk/c2t0d1s3 /dev/rdsk/c2t0d1s1 /dev/rdsk/c2t0d1s3
disk 3 0/0/0/5/0/0/0.1.6.0.0.0.2 sdisk CLAIMED DEVICE HP HSV450
/dev/dsk/c2t0d2 /dev/dsk/c2t0d2s2 /dev/rdsk/c2t0d2 /dev/rdsk/c2t0d2s2
/dev/dsk/c2t0d2s1 /dev/dsk/c2t0d2s3 /dev/rdsk/c2t0d2s1 /dev/rdsk/c2t0d2s3
disk 4 0/0/0/5/0/0/1.1.6.0.0.0.1 sdisk CLAIMED DEVICE HP HSV450
/dev/dsk/c4t0d1 /dev/dsk/c4t0d1s2 /dev/rdsk/c4t0d1 /dev/rdsk/c4t0d1s2
/dev/dsk/c4t0d1s1 /dev/dsk/c4t0d1s3 /dev/rdsk/c4t0d1s1 /dev/rdsk/c4t0d1s3
disk 5 0/0/0/5/0/0/1.1.6.0.0.0.2 sdisk CLAIMED DEVICE HP HSV450
/dev/dsk/c4t0d2 /dev/dsk/c4t0d2s2 /dev/rdsk/c4t0d2 /dev/rdsk/c4t0d2s2
/dev/dsk/c4t0d2s1 /dev/dsk/c4t0d2s3 /dev/rdsk/c4t0d2s1 /dev/rdsk/c4t0d2s3
serverA:home/user $

do_mirr_vg00.ksh -m /dev/disk/disk6

OR


echo "3
EFI 500MB
HPUX 100%
HPSP 400MB" > /tmp/idf

echo yes | /usr/sbin/idisk -f /tmp/idf -w /dev/rdsk/c0t8d0
/usr/sbin/insf -v -e -H ${ALTPATH}
ll /dev/rdsk/c0t8d0s2
pvcreate -ff -B /dev/rdsk/c0t8d0s2
mkboot -e -l /dev/rdsk/c0t8d0
echo 'boot vmunix -lq' > /tmp/auto
efi_cp -d /dev/rdsk/c0t8d0s1 /tmp/auto /efi/hpux/auto
#check auto file betul ke tak
efi_cp -d /dev/rdsk/c0t8d0s1 -u /efi/hpux/auto /tmp/auto2
vgextend vg00 /dev/dsk/c0t8d0s2

(-s to *not* sync the new mirror copies, so have to use lvsync or vgsync to synchronize the mirrors)
vgdisplay -v vg00 | grep lvol | awk '{print($2)}' > /tmp/lv.txt
while read line
do
lvextend -m 1 -s $line /dev/dsk/c0t8d0s2
done</tmp/lv.txt

lvsync -T $(ls /dev/vg00/lvol* | sort -n -k1.15)

lvlnboot -b /dev/vg00/lvol1
lvnboot -R
lvlnboot -v vg00 | awk '/Boot Disk/ {printf("l %s\n",$1)}' > /stand/bootconf
setboot

serverA:home/user $ vgdisplay -v vg00 | grep lvol
LV Name /dev/vg00/lvol1
LV Name /dev/vg00/lvol2
LV Name /dev/vg00/lvol3
LV Name /dev/vg00/lvol4
LV Name /dev/vg00/lvol5
LV Name /dev/vg00/lvol6
LV Name /dev/vg00/lvol7
LV Name /dev/vg00/lvol8
LV Name /dev/vg00/lvol9
LV Name /dev/vg00/lvol10
LV Name /dev/vg00/lvol11
LV Name /dev/vg00/lvol12
serverA:home/user $ lvdisplay -v /dev/vg00/lvol1 | more
[34;1H [0K--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 2
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1536
Current LE 96
Allocated PE 288
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/disk/disk9_p2 96 96
/dev/disk/disk8_p2 96 96
/dev/disk/disk6_p2 96 96

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2 PV3 PE3 Status 3
00000 /dev/disk/disk9_p2 00000 current /dev/disk/disk8_p2 00000 current /dev/disk/disk6_p2 00000 current
00001 /dev/disk/disk9_p2 00001 current /dev/disk/disk8_p2 00001 current /dev/disk/disk6_p2 00001 current
00002 /dev/disk/disk9_p2 00002 current /dev/disk/disk8_p2 00002 current /dev/disk/disk6_p2 00002 current
00003 /dev/disk/disk9_p2 00003 current /dev/disk/disk8_p2 00003 current /dev/disk/disk6_p2 00003 current
00004 /dev/disk/disk9_p2 00004 current /dev/disk/disk8_p2 00004 current /dev/disk/disk6_p2 00004 current
00005 /dev/disk/disk9_p2 00005 current /dev/disk/disk8_p2 00005 current /dev/disk/disk6_p2 00005 current
00006 /dev/disk/disk9_p2 00006 current /dev/disk/disk8_p2 00006 current /dev/disk/disk6_p2 00006 current
00007 /dev/disk/disk9_p2 00007 current /dev/disk/disk8_p2 00007 current /dev/disk/disk6_p2 00007 current
^C
serverA:home/user $

read more...

Patching HPUX server using Dynamic Root Disk

Check it out here: http://jreypo.wordpress.com/2010/05/24/patching-a-server-using-dynamic-root-disk/

read more...

Tuesday, January 11, 2011

vxrestore / vxdump

# vxdump 0fu /dev/rmt/0m /var ; dump vxfs file system /var to tape /dev/rmt/0m using level 0 and update /var/adm/dumpdates

# vxrestore tf /dev/rmt/0m | grep eaaa ; obtain table of contents from tape /dev/rmt/0m and look for filename containing "eaaa"

# vxrestore -yxf /dev/rmt/0m ; restore the whole content of the tape into current dir, answer 1 and y

# mt -f /dev/rmt/0m rewind ; rewind tape after listing the tape

read more...

Thursday, August 23, 2007

HP-UX: Processors

[ROOT abc24]usr/sam # /usr/sbin/diag/contrib/pdcinfo -no_banner | grep "CPU("
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
CPU(0)  PA8700 3.1
CPU(1)  PA8700 3.1
CPU(2)  PA8700 3.1
CPU(3)  PA8700 3.1
[ROOT abc24]/tmp # echo "selclass qualifier cpu;info;wait;infolog" | cstm > /tmp/cpuinfo

[ROOT abc24]/tmp # more cpuinfo | grep "CPU Slot Number"
CPU Number:                0            CPU Slot Number:          0
CPU Number:                1            CPU Slot Number:          1
CPU Number:                2            CPU Slot Number:          2
CPU Number:                3            CPU Slot Number:          3
CPU Number:                8            CPU Slot Number:          0
CPU Number:                9            CPU Slot Number:          1
CPU Number:                11           CPU Slot Number:          3
[ROOT abc24]var/sam # icod_stat -p

Version:                   4.0
Contract type:             iCOD-purchase
License applied:           yes

Hostname:                  abc24
DNS domain name:           abc24.def.hij.com
IP address:                12.34.56.78
NIS domain name:           .
System model:              9000/800/SD64000
Serial number:             XX123456XX
Software ID:               deadbeef

Contact name:              UNIX Support
Contact e-mail:            ux@gggi.com
Contact phone:             (12)3456-6777

Total processors:                              8
Active processors:                             7
Inactive processors that can be activated:     1
Inactive processors that cannot be activated:  0
Deconfigured processors:                       0
Requested active processors:                   7

Requested active processors specified for all partitions:

Requested
Active      Total
Processors  Processors  Partition
==========  ==========  =========
0           4           ux123 (par0)
7           8           Database abc24 (par1) (local)
4           4           App6 abc26 (par2)
2           4           QA App abc21 (par4)
n/a         0           Unassigned cells
---------------------------------------------------------
13 total requested active processors specified for complex
[ROOT abc24]var/sam #

PS: PA-8700 - single core CPU

read more...

Tuesday, August 21, 2007

HP-UX, bdf, du and ...

If you ever encounter a file system full, say, at this particular partition:
[ROOT gitu2]Z24/X41 # uname -a
HP-UX gitu2 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT gitu2]Z24/X41 # bdf /usr/sap/Z24/X41
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol30 4620288 4610752 9038 100% /usr/sap/Z24/X41
[ROOT gitu2]Z24/X41#


and you have been trimming, deleting files like crazy, say, you've delete a 1.7G file but when you issue bdf, the utilization still at 100%. But when you checked with du, it shows the current utilization on that particular partition/directory has been reduced. WTF?!

Don't worry dude/dudette. Basically, there are some processes running that currently writing on some files on that directories and until those processes are stopped finishing writting you will not see the free space in bdf.

To identify the processes, run this:
[ROOT gitu2]Z24/X41 # fuser -cu /usr/sap/Z24/X41
/usr/sap/Z24/X41: 7314co(z24adm) 15790co(z24adm) 24426co(z24adm) 10374co(z24adm) 8094mcto(z24adm) 10514co(z24adm) 24418co(z24adm) 24433co(z24adm) 24458co(z24adm) 24432co(z24adm) 24446co(z24adm) 22457co(z24adm) 24385co(z24adm) 12656co(z24adm) 24444co(z24adm) 24439co(z24adm) 24442co(z24adm) 24451co(z24adm) 24438co(z24adm) 24386co(z24adm) 26313co(z24adm) 4756co(z24adm) 24428co(z24adm) 24435co(z24adm) 17512co(z24adm) 24459co(z24adm) 20846co(z24adm) 24431co(z24adm) 24460co(z24adm) 9184co(z24adm) 3585co(z24adm) 24440co(z24adm) 24448co(z24adm) 24417co(z24adm) 24430co(z24adm) 24443co(z24adm) 24338c(z24adm) 24441co(z24adm) 12555co(z24adm) 24461co(z24adm) 24434co(z24adm) 24436co(z24adm) 24445co(z24adm) 24429co(z24adm) 4539c(root) 24437co(z24adm) 11852co(z24adm) 24449co(z24adm) 24450co(z24adm) 26830co(z24adm) 28242c(root)

[ROOT gitu2]Z24/X41 #


Ah-ha! It will listed all the eeeviiilll processes. What you need to do is kill all those processes and voila!, you'll get your free space back.

** ACHTUNG **
Don't simply kill the processes until you pretty sure it is safe to kill with the owner of the processes (backup team, or whatever). Use j00r brain d00dz.
** ACHTUNG **

read more...