Operating System - HP-UX
1825678 Members
3582 Online
109686 Solutions
New Discussion

Re: LVM mirror configuration

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Hi

We are using HP-UX 11.00.

LVM Mirroring is configured.

Ex:

root@lgapps:/root > lvdisplay -v /dev/vg00/lvol4
--- Logical volumes ---
LV Name /dev/vg00/lvol4
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 1024
Current LE 128
Allocated PE 256
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t6d0 128 128
/dev/dsk/c2t6d0 128 128

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c1t6d0 00575 current /dev/dsk/c2t6d0 00575 current
00001 /dev/dsk/c1t6d0 00576 current /dev/dsk/c2t6d0 00576 current
00002 /dev/dsk/c1t6d0 00577 current /dev/dsk/c2t6d0 00577 current
00003 /dev/dsk/c1t6d0 00578 current /dev/dsk/c2t6d0 00578 current
00004 /dev/dsk/c1t6d0 00579 current /dev/dsk/c2t6d0 00579 current
00005 /dev/dsk/c1t6d0 00580 current /dev/dsk/c2t6d0 00580 current
00006 /dev/dsk/c1t6d0 00581 current /dev/dsk/c2t6d0 00581 current
00007 /dev/dsk/c1t6d0 00582 current /dev/dsk/c2t6d0 00582 current
00008 /dev/dsk/c1t6d0 00583 current /dev/dsk/c2t6d0 00583 current
00009 /dev/dsk/c1t6d0 00584 current /dev/dsk/c2t6d0 00584 current
00010 /dev/dsk/c1t6d0 00585 current /dev/dsk/c2t6d0 00585 current
00011 /dev/dsk/c1t6d0 00586 current /dev/dsk/c2t6d0 00586 current
00012 /dev/dsk/c1t6d0 00587 current /dev/dsk/c2t6d0 00587 current
00013 /dev/dsk/c1t6d0 00588 current /dev/dsk/c2t6d0 00588 current
00014 /dev/dsk/c1t6d0 00589 current /dev/dsk/c2t6d0 00589 current
00015 /dev/dsk/c1t6d0 00590 current /dev/dsk/c2t6d0 00590 current


But the problem is that i am not able to find LVM mirroring softwares. i used following commands.


# swlist â l product | grep -i mirror

or

# swlist -l product |grep -i DynRootDisk


So what is the other LVM mirroring software installed?

Pls explain me.
Pete Randall
Outstanding Contributor

Re: LVM mirror configuration

Try this:

swlist |grep -i mirror


Pete

Pete
senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Thanks a lot.

it is working fine.
senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Do we need to create LVM mirroring in two different PV?

Ex:

# lvcreate -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0

# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2


Am i correct?


And if one mirror disks fail, then how to replace the mirroring to new disk?

Pls explain me in detail.
James R. Ferguson
Acclaimed Contributor

Re: LVM mirror configuration

Hi Senthil:

> Do we need to create LVM mirroring in two different PV?

Absolutely yes. Think about why you mirror in the first place. Mirroring provides high-availability. If there is a failure on one particular physical disk, the last thing you would want is to have all of the mirror copies on that disk. You might or might not survive the failure!

By default, LVM mirroring (which is performed at the _logical volume_ level has a 'strict' allocation policy. That is, the mirrors of a logical extent cannot share the same physical volume; see the 'lvcreate' manpages; so you won't be able to do otherwise.

> And if one mirror disks fail, then how to replace the mirroring to new disk?

That is best answered by reading the whitepaper below since there are different scenarios for failure:

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

Regards!

...JRF...
Md. Zubair Hoque
Occasional Advisor

Re: LVM mirror configuration

Please see the attached. This is just an example. Depending on this make your plan according your system configuration.
avizen9
Esteemed Contributor

Re: LVM mirror configuration

attached steps for mirroring go through it, thanks,
Kranti Mahmud
Honored Contributor

Re: LVM mirror configuration

Hi Senthil,

Attached is the document all about LVM.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
R.K. #
Honored Contributor

Re: LVM mirror configuration

Hello Senthil,

Please find the attached doc that I use in case of disk replacements.

Regds,
R.K.
Don't fix what ain't broke
Suraj K Sankari
Honored Contributor

Re: LVM mirror configuration

HI,
>>Do we need to create LVM mirroring in two different PV?

YES

>># lvcreate -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0
>># lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2
>>Am i correct?

Yes you are correct make sure about disk /dev/dsk/c5t1d2


>>And if one mirror disks fail, then how to replace the mirroring to new disk?

First make sure which disk you are going to replace root disk or not root disk according to you need to plan for more detail see the attached file When_Good_Disks_Go_Bad.pdf.


Suraj

senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Hi

If it is not boot disk then we can do as follows.

1) First removing the mirror lvm from disk:

#lvreduce -m 0 /dev/vg01/lvol3 /dev/dsk/c5t1d2

2) removing the disk from vg01:

#vgreduce /dev/vg01 /dev/dsk/c5t1d2

3) Adding new disk as physical disk

#pvcreate -f /dev/rdsk/c3t6d0

4) Including new disk into vg.

#vgextend /dev/vg01 /dev/dsk/c3t6d0

5) To create new mirror:

# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c3t6d0


Are my steps correct?

R.K. #
Honored Contributor

Re: LVM mirror configuration

If the disks are of same size, you can simply do a vgcfgrestore and then vgsync.
Replacing non-root disks is the same on Itanium or PA-risc. Use the following procedure:

# pvcreate /dev/rdsk/cXtXdX
# vgcfgrestore -n vgXX /dev/rdsk/cXtXdX
# vgchange -a y vgXX
# vgsync vgxx
# vgdisplay -v /dev/vgxx (To verify the results)
Don't fix what ain't broke
Johnson Punniyalingam
Honored Contributor

Re: LVM mirror configuration

1) First removing the mirror lvm from disk:

#lvreduce -m 0 /dev/vg01/lvol3 /dev/dsk/c5t1d2

2) removing the disk from vg01:

#vgreduce /dev/vg01 /dev/dsk/c5t1d2

3) Adding new disk as physical disk

#pvcreate -f /dev/rdsk/c3t6d0

4) Including new disk into vg01

#vgextend /dev/vg01 /dev/dsk/c3t6d0

5) To create new mirror:

# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c3t6d0

above steps are correct. but

if its already mirrored and you are changing the faulty mirror disk. you no need to do "lvextend -m" to remirror again.

Just follow belows :-

# pvcreate /dev/rdsk/cXtXdX
# vgcfgrestore -n vgXX /dev/rdsk/cXtXdX
# vgchange -a y vgXX
# vgsync vgxx

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Steven E. Protter
Exalted Contributor

Re: LVM mirror configuration

Shalom,

Response to your last query.

See this document:
http://www.hpux.ws/?p=21

Minor variations for 11.23 or 11.31.

Note many modern servers have hardware mirroring which lowers system load. This can eliminate the need for software mirroring.

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
johnsonpk
Honored Contributor

Re: LVM mirror configuration

Hi Senthil/Suraj :

Reg:>># lvcreate -L 1000 /dev/dsk/c3t2d0

>># lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2

There is no way to specify the PV during lvcreation as far as I know..so you may need to follow the below steps to control the LE on the disks as per your wish..

1)Create a logical volume with size 0
#lvcreate -n lvol3 /dev/vg01
2)extend the lv to the disk you desired with correct size
#lvextend -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0
3)create a mirror copy in the scond disk
# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2

There is many ways to archive this ..one way is to use the lvmpvg and create lv with pvg strict policy


Thanks!!
Johnson
johnsonpk
Honored Contributor

Re: LVM mirror configuration

Hi Senthil/Suraj :



Reg:>># lvcreate -L 1000 /dev/dsk/c3t2d0



>># lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2



There is no way to specify the PV during lvcreation as far as I know..so you may need to follow the below steps to control the LE on the disks as per your wish..



1)Create a logical volume with size 0

#lvcreate -n lvol3 /dev/vg01

2)extend the lv to the disk you desired with correct size

#lvextend -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0

3)create a mirror copy in the scond disk

# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c5t1d2



There is many ways to archive this ..one way is to use the lvmpvg and create lv with pvg strict policy





Thanks!!

Johnson

senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Hi Johnson Punniyalingam ,

A)so you are telling that we should not follow below steps to add new mirror disks?

3) Adding new disk as physical disk

#pvcreate -f /dev/rdsk/c3t6d0

4) Including new disk into vg01

#vgextend /dev/vg01 /dev/dsk/c3t6d0

5) To create new mirror:

# lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/c3t6d0




B)what is the purpose of these commands?

# vgchange -a y vgXX (by default VGs are backuped then why we are using this command.)

# vgsync vgxx


Hi johnsonpk,

C)we should not use like below?

# lvcreate -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0

D)Instead we have to use below method if we want to create the logical volume in spcified disk?

1)Create a logical volume with size 0
#lvcreate -n lvol3 /dev/vg01
2)extend the lv to the disk you desired with correct size
#lvextend -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0

Guys pls clarify myself.
R.K. #
Honored Contributor

Re: LVM mirror configuration

Hello Senthil,

See what happens when I tried below command:

root> lvcreate -L 1000 /dev/vg01/lvol31 /dev/dsk/c2t1d0
Volume group "/dev/vg01/lvol31" does not exist in the "/etc/lvmtab" file.
Volume group "/dev/vg01/lvol31" does not exist in the "/etc/lvmtab_p" file.

So that clearly shows we need to create the LV first & then extend it by lvextend command.


You are correct, first create Lvol of size 0 and then extend it.
#lvcreate -n lvol3 /dev/vg01
#lvextend -L 1000 /dev/vg01/lvol3 /dev/dsk/c3t2d0

Man lvcreate also do not have any entry for lvcreate with disk name.


And for vgchange -a y vgXX, it reactivates the VG and activate each specified volume group and all associated physical and logical volumes for read-write access. So in turns it syncronizes the VG. So somtime we would not require "vgsync" command after "vgchange -a y vgXX".

Hope this helps.
R.K.
Don't fix what ain't broke
avizen9
Esteemed Contributor

Re: LVM mirror configuration

Hello Senthil,
you dont need to confuse here, just follow basic steps for mirroring as mentioned. if you face any difficulty let us know, thanks,
johnsonpk
Honored Contributor

Re: LVM mirror configuration

>>>Hi Johnson Punniyalingam ,

>>>A)so you are telling that we should not follow below steps to add new mirror disks? ..

no ..The below steps are ok

3) Adding new disk as physical disk

#pvcreate -f /dev/rdsk/c3t6d0

4) Including new disk into vg01

#vgextend /dev/vg01 /dev/dsk/c3t6d0

Then...

5)Create a logical volume with size 0
#lvcreate -n lvol3 /dev/vg01
6)extend the lv to the disk you desired with correct size
#lvextend -L 1000 /dev/vg01/lvol3
7)create a mirror copy in the scond disk
# lvextend -m 1 /dev/vg01/lvol3


Hope you are clear now..


Thanks
Johnson
Ganesan R
Honored Contributor

Re: LVM mirror configuration

Hi Senthil,

I reiterate you to read this document instead making yourself confused.

http://docs.hp.com/en/5992-4589/5992-4589.pdf

It's a good document on LVM.
Best wishes,

Ganesh.
senthil_kumar_1
Super Advisor

Re: LVM mirror configuration

Hi All,

I have following doubts, please clarify me.

1)Can i use bleow command to add 2 mirrors:

# lvextend â m 2 /dev/vg01/lvhome


2)From that, how to remove only one mirror (for example mirror - 1)?
Pete Randall
Outstanding Contributor

Re: LVM mirror configuration

1) yes.

2) lvreduce -m 1 blah...blah...blah


Pete

Pete