Operating System - HP-UX
1832429 Members
3362 Online
110042 Solutions
New Discussion

Re: Add new disk (mirror)

 
Akif_1
Super Advisor

Add new disk (mirror)

Hi,

OS:HP-UX 11.11
Server:rp5410

Iam bit new to this mirror disk concept need an expert view upon my below issue.

#This problem of up gradation related to DATA DISK only NOT boot disk's(vg00)

Planned to upgrade mirror data disk (ex 50GB) to new disk (ex 100GB).

Scenario 1:

How to restore old disk data on new disk, Is it possible to insert new disk one by one and later increase VG&LV's for more space requirement.

Scenarios 2:

Forget about restoring old data.

If i remove old disk and insert both new disk, how to MIRROR those disk and rest process will be to make VG & LV as per client requirements.

I appreciate all who contribute a worth info.

Have a nice day :)

T(ogether) E(very one) A(chive) M(ore)
17 REPLIES 17
Michal Kapalka (mikap)
Honored Contributor

Re: Add new disk (mirror)

hi,

both of you scenarios are posible to do :

1, just simple reduce 1 mirror copy and replace the disk to bigger size, and them if its mirrored, them replace with the same procedure the second disk, of course at the end you can increase the LVOLS/fs size.

offline = extendfs
online = fsadm

2, backup your system via ignite (tape/server),
restore the system to the new disk ( in advanced type of restoration/installation you will be able change the size of LVOLs, and them mirror it together.

i'm using this commands in simple shell script :
#primary disk : c2t0d0 / hwpath : 0/1/1/0.0.0
#for mirroring disk : c2t1d0 / hwpath : 0/1/1/0.1.0


set -x
pvcreate -B -f /dev/rdsk/c2t1d0
mkboot /dev/rdsk/c2t1d0
mkboot -a "hpux -lq" /dev/rdsk/c2t0d0
mkboot -a "hpux -lq" /dev/rdsk/c2t1d0
vgextend /dev/vg00 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t1d0
.....
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t1d0
lvlnboot -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot -a 0/1/1/0.1.0
setboot

Best regards.

mikap
Michal Kapalka (mikap)
Honored Contributor

Re: Add new disk (mirror)

hi,

and i forgot to say :

in the second option, if you do not need the OLD data, just remove the LVOLS, from the vg, and them remove the PVs from VG, remove vg , pvcreate on the new disks, ( pvcreate -f /dev/rdsk/diskx )

create a new VG with all PVs, and them create lvol(s) and mirror it ( maybe you will do PVG groups ).

mikap
Torsten.
Acclaimed Contributor

Re: Add new disk (mirror)

This procedure is related to boot disks, for "normal" data disks it is even easier.

The problem is if you use a new bigger disk. Most of the times the current configuration does not allow the bigger disk (check vgdisplay -v -> max_PE and PE size).

In such case backup data, re-create the vg, create and mirror the LVOL and restore data.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Akif_1
Super Advisor

Re: Add new disk (mirror)

Hi Michal & Torsten,

I appreciate your quick response.

I will try to replace the new disk one by one if succeed nothing to worry about data and mirroring,

In case any failure if i opt scenario 2 on normal data disk NOT boot disk (vg00). let sat vgoracle.

to create mirror on two new data disk can i follow below steps.


2, backup your system via ignite (tape/server),

#NO tape drive attach backup not possible.

i'm using this commands in simple shell script :
#primary disk : c2t0d0 / hwpath : 0/1/1/0.0.0
#for mirroring disk : c2t1d0 / hwpath : 0/1/1/0.1.0


set -x
pvcreate -B -f /dev/rdsk/c2t1d0
mkboot /dev/rdsk/c2t1d0
mkboot -a "hpux -lq" /dev/rdsk/c2t0d0 (4 normal disk mkboot ok/not)
mkboot -a "hpux -lq" /dev/rdsk/c2t1d0
vgextend /dev/vgoracle /dev/dsk/c2t1d0
lvextend -m 1 /dev/vgoracle/lvol1 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vgoracle/lvol2 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vgoracle/lvol3 /dev/dsk/c2t1d0
lvextend -m 1 /dev/vgoracle/lvol4 /dev/dsk/c2t1d0
.....
lvextend -m 1 /dev/vgoracle/lvol8 /dev/dsk/c2t1d0
lvlnboot -r /dev/vgoracle/lvol3
lvlnboot -s /dev/vgoracle/lvol2
lvlnboot -d /dev/vgoracle/lvol2
lvlnboot -b /dev/vgoracle/lvol1
lvlnboot -R
lvlnboot -v
setboot -a 0/1/1/0.1.0


Rgd's
T(ogether) E(very one) A(chive) M(ore)
Prabhi
Advisor

Re: Add new disk (mirror)

You can use the below command to restore the data

#vgcfgrestore -n vg00 /dev/rdsk/c1tXdX
#Vgchange -a y vg00
# vgsync vg00
Akif_1
Super Advisor

Re: Add new disk (mirror)

Hi All,

#vgcfgrestore -n /dev/vg03 /dev/rdsk/c2t0d0
#vgchange -n y /dev/vg03
#vgsync vg03

After successful migration of mirror disk from 73GB to 146GB still the FREE PE 0 , how to recover the space to extend LV's.

#vgdisplay vg03
--- Volume groups ---
VG Name /dev/vg03
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 4
Open LV 4
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 17502
VGDA 4
PE Size (Mbytes) 16
Total PE 8748
Alloc PE 8748
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

Rgd's
T(ogether) E(very one) A(chive) M(ore)
Akif_1
Super Advisor

Re: Add new disk (mirror)

Any update will be appreciated ..........
T(ogether) E(very one) A(chive) M(ore)
Torsten.
Acclaimed Contributor

Re: Add new disk (mirror)

You replaced the disk with a larger disk and used vgcfgrestore? So you are using exactly the same size as the older disk. You need to pvcreate the larger disk!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Akif_1
Super Advisor

Re: Add new disk (mirror)

Hi Torsten,

You replaced the disk with a larger disk and used vgcfgrestore?
#Yes i used #vgcfgrestore #
vgchange -a y vgxx
#vgsync vgxx

Kindly provide me the steps after this to claim new disk space.

Regard's
T(ogether) E(very one) A(chive) M(ore)
Chandrahasa s
Valued Contributor

Re: Add new disk (mirror)

Hi Akif find given solution below:
Since new disk is higher size you need to run pvcreate on 146GB disk you can follow following steps

PHASE 1
Its suggestable to take backup of all mount ponts which are fall in vg03
******************************************************************************************

PHASE 2(reduce the disk 146 from mirror)

1)lvredeuce -m 0 /dev/vg03/lvolxx /dev/dsk/c2t0d0 (c2t0d0 as you mentioned)
-----reduce all lv from the 146gb disk /dev/dsk/c2t0d0--
2)vgreduce /dev/vg03 /dev/dsk/c2t0d0
*********************************************************************************************

PHASE 3(adding 146gb /dev/dsk/c2t0d0 disk to vg03)

1)pvcreate /dev/rdsk/c2t0d0 ---(no need to make bootable since you mentioned this is only data volume)
2)vgextend /dev/vg03 /dev/dsk/c2t0d0
3)vgdisplay ---conform vg03 have two disks
4)unmount all mount points which belogns to vg03
5)pvmove /dev/dsk/cxtxdx /dev/dsk/c2t0d0 -----(cxtxdx is yours 50gb old disk)
6)lvdisplay -v /dev/vg03/lvolxx ---conform each lv that lvs moved to c2t0d0
7)mont all mount points and conform data avialable
8)vgreduce /dev/dsk/vg03 /dev/dsk/cxtxdx (cxtxdx will be old 50Gb disk)
9)vgdidplay ---conform only one 146gb c0t2d0 now exists in vg03)

Here vgdisplay will show free PE also you can extnd each lv acconrding to your requirement.
this can done using lvextend and extndfs command
Need to Umount mount points
lvextend -l no of les /dev/dsk/c2t0d0
extendfs -F vxfs /dev/vg03/lvolx

if u have online jfs
No need to umount mount points

lvextnd -l no of les /dev/dsk/c2t0d0
fsadm -F vxfs -o largefils /mountpoint

**************************************************************************************************
PHASE4(mirrorig 146gb disk with new 146gb disk)
1)insert new disk
2)ioscan -fnC disk
3)pvcreate /dev/dsk/cytydy----(not need to make cytydy bootable since you mentioned vg03 only data voume.cytydy is new 146 gb as example)
4)vgextend vg03 /dev/dsk/cytydy
5)lvextnd -m 1 /dev/vg03/lvolxx /dev/dsk/cytydy----(mirror all lvs)
*****************************************END********************************************************

Regards,
Chandra
Akif_1
Super Advisor

Re: Add new disk (mirror)


Thanks Chandra for your valuable input's ,

I will follow your guide and let u know, Kindly provide the steps to mirror LV's after replacing disk (146GB) one by one.


To be more clear:

#Mirror disk 50GB (vg03) replace by 146GB , But vgdisplay FREEPE 0 value .



T(ogether) E(very one) A(chive) M(ore)
Torsten.
Acclaimed Contributor

Re: Add new disk (mirror)

The previous post is step by step, isn't it???

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Chandrahasa s
Valued Contributor

Re: Add new disk (mirror)

Hi,
Provide vgdisplay -v vg03 output i can help for mirroring 146gb disk

Note:if you do pvmove(as explained earlier post) you can find free pe s on vg03.

Regards,
Chandra
Akif_1
Super Advisor

Re: Add new disk (mirror)

The below output is of (73GB) old disk and assume this as (146GB) , Can you guide me to mirror this,

Thanks for all whose contribution solve my issue.

ra/>vgdisplay -v vg03
--- Volume groups ---
VG Name /dev/vg03
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 4
Open LV 4
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 17502
VGDA 4
PE Size (Mbytes) 16
Total PE 8748
Alloc PE 8748
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg03/lvol1
LV Status available/syncd
LV Size (Mbytes) 18000
Current LE 1125
Allocated PE 2250
Used PV 1

LV Name /dev/vg03/lvol2
LV Status available/syncd
LV Size (Mbytes) 18000
Current LE 1125
Allocated PE 2250
Used PV 1

LV Name /dev/vg03/lvol3
LV Status available/syncd
LV Size (Mbytes) 18000
Current LE 1125
Allocated PE 2250
Used PV 1

LV Name /dev/vg03/lvol4
LV Status available/syncd
LV Size (Mbytes) 15984
Current LE 999
Allocated PE 1998
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4374
Free PE 0
Autoswitch On

PV Name /dev/dsk/c2t0d0
PV Status available
Total PE 4374
Free PE 0
Autoswitch On

Regard's
T(ogether) E(very one) A(chive) M(ore)
Chandrahasa s
Valued Contributor

Re: Add new disk (mirror)

Hi Akif,
Solution given below:
i Will take new 146gb disk device file as "cytydy"

pvcreate /dev/rdsk/cytydy
vgextend /dev/vg03 /dev/dsk/cytydy
lvextend -m 1 /dev/vg03/lvol1 /dev/dsk/cytydy
lvextend -m 1 /dev/vg03/lvol2 /dev/dsk/cytydy
lvextend -m 1 /dev/vg03/lvol3 /dev/dsk/cytydy
lvextend -m 1 /dev/vg03/lvol4 /dev/dsk/cytydy
vgdisplay -v vg03 --conform the vg03 have both disk.

Regards,
Chandra
Sp4admin
Trusted Contributor

Re: Add new disk (mirror)

Akif,

Look like the above post answers your question. Here is a good document on how to mirror disk and recover from failed disk.

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

sp,
Akif_1
Super Advisor

Re: Add new disk (mirror)

Thanks all for their co-operation in their respective specialized area ..........

Have a charming day everyday
T(ogether) E(very one) A(chive) M(ore)