1851975 Members
3746 Online
104063 Solutions
New Discussion

Re: mirroring VG

 
kholikt
Super Advisor

mirroring VG

Hi,

What's the proper steps to mirror a non root vg volume group? How to test out the mirror disk after setup?
abc
17 REPLIES 17
Sudeesh
Respected Contributor

Re: mirroring VG

use vgdisplay
and look for free PE to verify enough space is available in the vg for mirrioring.

Then use
lvextend -m 1
for mirroring.

Use lvdisplay -v and verify nothig is shown as stale.This confirm mirror is fine.

#vgdisplay -v /dev/vg01
#lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c0t5d0 (assuming this disk is already added to vg01)

#lvdisplay -v /dev/vg01/lvol1


You can go through man pages for details of the command.


Sudeesh




The most predictable thing in life is its unpredictability
kholikt
Super Advisor

Re: mirroring VG

in this case if the disk failed, how can I switch to the mirror. Is this auto?
abc
Steven E. Protter
Exalted Contributor

Re: mirroring VG

How to test:
pull or disable the primary drive and see if access remains online.

Then re-enable, allow for resynch and test the reverse.

Procedure for root:
pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk


Procedure for non-root
pvcreate -B /dev/rdsk/c1t0d0 #use real disk

vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Naveej.K.A
Honored Contributor

Re: mirroring VG

Hi,

You may not have to use the -B option to create a PV for a non root disk.

pvcreate -f /dev/rdsk/c1t0d0 #use real disk

vgextend /dev/vg01 /dev/dsk/c1t0d0 # same thing

lvcreate /dev/vg01
lvchange -s /dev/vg01/lvol1

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

I also recommend to change the allocation policy to strict so that the mirror copies reside on different PVs. This has to be done before creating the mirror.

Regards,
Naveej
practice makes a man perfect!!!
kholikt
Super Advisor

Re: mirroring VG

Hi,

Let say I have four disk, I need to create one VG with three LV. The disk size is 146G.

I need to create the following LV and mirroring

DataLV 80G
DataLV2 30G
DataLV3 rest of space.

I think I need to create the LV on two disks and mirrors to another two disk.

How could I accomplish this
abc
Sudeesh
Respected Contributor

Re: mirroring VG

If one of the disks fail system will automatically switch to mirror copy. No manual intervention required.


The most predictable thing in life is its unpredictability
kholikt
Super Advisor

Re: mirroring VG

Oops sorry the physical disk size is 72GB not 146GB
abc
kholikt
Super Advisor

Re: mirroring VG

Hi,

With 4 x 72 GB hard disk how can I accomplish the following LV.

DATA1 --- 30GB
DATA2 -- 80GB
DATA3 â Rest of the space

And I need to mirror to the other two di
abc
Sudeesh
Respected Contributor

Re: mirroring VG

First add two disks to vg01
c0t1d0
c0t2d0

#lvreate -L 81920 -n /dev/vg01/Data1 /dev/vg01
#lvcreate -L 30720 -n /dev/vg01/Data2 /dev/vg01
#lvcreate -L -n /dev/vg01/Data3 /dev/vg01

u can execute newfs now...
add next two disks to vg01
c0t4d0
c0t5d0

#lvextend -m 1 /dev/vg01/Data1
#lvextend -m 1 /dev/vg01/Data2
#lvextend -m 1 /dev/vg01/Data3

u r done



Sudeesh
The most predictable thing in life is its unpredictability
Naveej.K.A
Honored Contributor

Re: mirroring VG

Hi,

pvcreate all Physical volumes (use raw device files)

say PV1, PV2, PV3, PV4

mkdir /dev/vgdata
mknod /dev/vgdata/group c 64 0x030000
(check the conflict of minor numbers)

vgcreate vgdata PV1 PV2 PV3 PV4

lvcreate -n data1 -L 30000 /dev/vgdata
lvchange -s y -C y /dev/vgdata/data1
lvextend -m 1 /dev/vgdata/data1 PV2

lvcreate -n data2 -L 80000 /dev/vgdata
lvchange -s y -C y/dev/vgdata/data2
lvextend -m 1 /dev/vgdata/data2 PV3

lvcreate -n data3 -L 34000 /dev/vgdata
lvextend -m 1 /dev/vgdata/data3 PV4

In any case, one of the LV's mirror copy or part of mirror copy will reside on the same PV.

Regards,
Naveej
practice makes a man perfect!!!
Sudeesh
Respected Contributor

Re: mirroring VG

Steps I have given will ensure Mirror copies are created on diffrent PVs.
The most predictable thing in life is its unpredictability
Nguyen Anh Tien
Honored Contributor

Re: mirroring VG

pvcreate -f /dev/rdsk/c3t2t0
pvcreate -f /dev/rdsk/c3t2t1
mkdir /dev/vg09
mknod /dev/vg09/group c 64 0x090000
vgcreate vgd09 /dev/dsk/c3t2t0 /dev/dsk/c3t2t1
#####lvcreate
lvcreate -n lvol001 /dev/vg09
#mirror to /dev/dsk/c3t2t1
lvextend -m 1 /dev/vgdata/data1 /dev/dsk/c3t2t1

check mirror by:
#[server1:/] vgdisplay -v vg09
HP is simple
kholikt
Super Advisor

Re: mirroring VG

Any idea how long it take to complete a 40GB mirroring if there is no data in the disk
abc
Ravi_8
Honored Contributor

Re: mirroring VG

In my case it's 10-15 mins. it's depend on CPU speed and I/O's
never give up
kholikt
Super Advisor

Re: mirroring VG

but it took more than 1 hrs now
abc
Jannik
Honored Contributor

Re: mirroring VG

Hi,

This document is the official way of mirroring you root and other disks:
http://www5.itrc.hp.com/service/iv/node.do?admit=552267591+1108810758895+28353475&node=prodITRC/WW_Start/N1|16|11

You can use this script to see how fare the mirroring process are:

#!/usr/bin/ksh
for i in /dev/vg00/lvol?
do
echo $i
lvdisplay -v $i | grep -i stale | wc -l
done

The script will count the stale partitions that has not been mirrored yet.
jaton
Devender Khatana
Honored Contributor

Re: mirroring VG

Hi,

It can take this much time. The volume of data do not effect the mirroring time as it mirrors at physical extent level i.e. one level below the data level. It has to mirror full irrespective of data in LVOLs.Allthough it is possible that mirroring will be slow if there is some application using the system. In that case I/Os from the drives will be shared between the applications and mirroring casing mirror to get less IOs and subseqentially more time.

It is also possible if you have two different drives then mirroring will be done at the rate what is supported by the slower of the two drives.

A good thought here would be that you can mirror two LVOL's at almost half time and double throughput if you have two Vg's created in your 4 disks i.e. two disks in each VG. This way you can mirror one LVOL of each VG at a time and all 4 disks will be used equally for mirroring. Whereas if you have one VG in 4 disks only two disks will be in use at a time and other 2 will be idle because of limitation of LVm that do not allow to mirror more that one LVOL in a VG at a time.

This anyway is not a major problem as you have to establish mirror only once. This can be of great use if you break mirrors for backup etc. frequently.

HTH,
Devender
Impossible itself mentions "I m possible"