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

read more...

Wednesday, January 26, 2011

Solaris - CPU

Nothing fancy, just a quick note for thyself

# psrinfo -vp
The physical processor has 1 virtual processor (0)
x86 (GenuineIntel family 6 model 23 step 10 clock 2387 MHz)
Intel(r) Core(tm)2 Duo CPU P8600 @ 2.40GHz
#


Macam cat /proc/cpuinfo kat linux,

# kstat cpu_info
module: cpu_info instance: 0
name: cpu_info0 class: misc
brand Intel(r) Core(tm)2 Duo CPU P8600 @ 2.40GHz
cache_id 0
chip_id 0
clock_MHz 2387
clog_id 0
core_id 0
cpu_type i386
crtime 31321.127312219
current_clock_Hz 2387348216
current_cstate 0
family 6
fpu_type i387 compatible
implementation x86 (GenuineIntel family 6 model 23 step 10 clock 2387 MHz)
model 23
ncore_per_chip 1
ncpu_per_chip 1
pg_id -1
pkg_core_id 0
snaptime 33573.371480431
state on-line
state_begin 1295996392
stepping 10
supported_frequencies_Hz 2387348216
supported_max_cstates 0
vendor_id GenuineIntel

#

read more...

Monday, January 24, 2011

Solaris Zone

Create zone:
bash-3.00# zonecfg -z 1
1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:1> create
zonecfg:1> set zonepath=/opt/zones/1
zonecfg:1> add net
zonecfg:1:net> set physical=e1000g0
zonecfg:1:net> set address=192.168.1.111
zonecfg:1:net> end
zonecfg:1> add inherit-pkg-dir
zonecfg:1:inherit-pkg-dir> set dir=/opt
zonecfg:1:inherit-pkg-dir> end
zonecfg:1> verify
zonecfg:1> commit
zonecfg:1> exit

# zoneadm -z 1 install
Preparing to install zone <1>.
Creating list of files to copy from the global zone.
Copying <2924> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1102> packages on the zone.
Initialized <1102> packages on zone.
Zone <1> is initialized.
The file contains a log of
the zone installation.
#

# zoneadm -z 1 boot
# zlogin -C 1
(follow on screen instructions)

If you want to rename zone:
# zoneadm -z 1 halt
# vi /etc/zones/index (rename "1" to your new zone name, i.e. zone1x86)
# cd /etc/zones/
# mv 1.xml zone1x86.xml
# vi zone1x86.xml (change any reference "1" to new zone name, i.e. zone1x86)
# zoneadm -z zone1x86 boot


Cloning zone1x86 to zone2x86:
# zonecfg -z zone1x86 export > zone2x86.cfg
# vi zone2x86.cfg (change zone1x86 to your new zone name, i.e. zone2x86 and IP address)
"zone2x86.cfg" 23 lines, 331 characters
create -b
set zonepath=/opt/zones/zone2x86
set autoboot=false
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add inherit-pkg-dir
set dir=/opt
end
add net
set address=192.168.1.112
set physical=e1000g0
end
"zone2x86.cfg" 23 lines, 331 characters
# zonecfg -z zone2x86 -f zone2x86.cfg
# zoneadm -z zone1x86 halt
# zoneadm -z zone2x86 clone zone1x86
Copying /opt/zones/zone1x86...
grep: can't open /a/etc/dumpadm.conf
#

Verify zones are correctly installed:
# zoneadm list -vi
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1x86 installed /opt/zones/zone1x86 native shared
- zone2x86 installed /opt/zones/zone2x86 native shared
#

Boot zones:
# zoneadm -z zone1x86 boot
# zoneadm -z zone2x86 boot

read more...

Sunday, January 23, 2011

Luser Attitude Readjustment Tool



lart(8)         lart(8)

NAME
       lart  - Luser  Attitude Readjustment Tool - use a lart to
       adjust lusers' attitudes

SYNOPSIS
       lart [ -use tool ] [ -bBfFgklp ] 

DESCRIPTION
       lart adjusts the attitudes of those pesky, clueless people
       who  rely  upon their  admins for everything from picking
       their mice off of the floor to turning on their monitors;
       namely, the  luser(8). Running lart with the appropriate
       arguments will cause  the  specified  luser  to run  away
       screaming in agony.  Alternatively, you can make the luser
       buy you a beer, after killing all of their processes.


read more...

Solaris 10 x86 on VMWare disk mirror


umount /export/home

bash-3.00# format
Searching for disks...done



AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0
          /pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number):


select 0
p
p
7
enter
enter
0
0
label
y
p
3
enter
enter
981
40mb
p
7
home
enter
987
$
label
y
name
root
q
disk
1
p
p
select
(select "root")
label
y

comment /export/home in /etc/vfstab
newfs /dev/rdsk/c1t0d0s7
uncomment /export/home
mount -a

metadb -afc 3 c1t0d0s3 c1t1d0s3
metainit -f d10 1 1 c1t0d0s0
metainit -f d20 1 1 c1t0d0s1
metainit -f d70 1 1 c1t0d0s7
#metainit -f d80 1 1 c1t0d0s8
metainit d1 -m d10
metainit d2 -m d20
metainit d7 -m d70
#metainit d8 -m d80

sub-mirror:
metainit -f d11 1 1 c1t1d0s0
metainit -f d21 1 1 c1t1d0s1
metainit -f d71 1 1 c1t1d0s7
#metainit -f d81 1 1 c1t1d0s8

metaroot d1

edit /etc/vfstab
tukar:
1. /dev/dsk/c1t0d0s1 jadi /dev/md/dsk/d2
2. /dev/dsk/c1t0d0s7 jadi /dev/md/dsk/d7 (/dev/md/rdsk...)


reboot

metattach d1 d11
metattach d2 d21
metattach d7 d71
#metattach d8 d81

bash-3.00# metastat
d7: Mirror
Submirror 0: d70
State: Okay
Submirror 1: d71
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 5060475 blocks (2.4 GB)

d70: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes


d71: Submirror of d7
State: Resyncing
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Okay Yes


d2: Mirror
Submirror 0: d20
State: Okay
Submirror 1: d21
State: Resyncing
Resync in progress: 4 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1076355 blocks (525 MB)

d20: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes


d21: Submirror of d2
State: Resyncing
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Okay Yes


d1: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d11
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 14667345 blocks (7.0 GB)

d10: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s0 0 No Okay Yes


d11: Submirror of d1
State: Resyncing
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,sd@f13b360d84d3b15f40006e7540000
c1t0d0 Yes id1,sd@f000000004d3b6fa3000592b50000
bash-3.00#

disk status after mirror sync'ed:
bash-3.00# metastat
d7: Mirror
Submirror 0: d70
State: Okay
Submirror 1: d71
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 5060475 blocks (2.4 GB)

d70: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s7 0 No Okay Yes


d71: Submirror of d7
State: Okay
Size: 5060475 blocks (2.4 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s7 0 No Okay Yes


d2: Mirror
Submirror 0: d20
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1076355 blocks (525 MB)

d20: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s1 0 No Okay Yes


d21: Submirror of d2
State: Okay
Size: 1076355 blocks (525 MB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s1 0 No Okay Yes


d1: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d11
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 14667345 blocks (7.0 GB)

d10: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t0d0s0 0 No Okay Yes


d11: Submirror of d1
State: Okay
Size: 14667345 blocks (7.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c1t1d0s0 0 No Okay Yes


Device Relocation Information:
Device Reloc Device ID
c1t1d0 Yes id1,sd@f13b360d84d3b15f40006e7540000
c1t0d0 Yes id1,sd@f000000004d3b6fa3000592b50000
bash-3.00#

read more...