1752318 Members
6321 Online
108786 Solutions
New Discussion юеВ

LVM mirror configuration

 
SOLVED
Go to solution
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