HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

removing disk from volume group where associated lvm's are mirrored with stripping...

 
SOLVED
Go to solution
sabinkarvijay
Frequent Advisor

removing disk from volume group where associated lvm's are mirrored with stripping...

Hi All,

We would like to replace one of the hard disk in Hp Ux 11iv1(B.11.11), I am not sure on how to remove the specific Physical Volume from Volume group and make the disk available for the hardware engineer to replace the new disk in place of old one:

I have attached the outputs of different commands which will give an idea.

I am aware of pre-disk replacement tasks for normal lvm mirrored disk, if i am right:

for normal lvm one, we can fallow the below:

1) firstly we will reduce the mirror from each logical volume

2) then will remove the physical volume from the volume group

once it's done, we will ask the hardware engineer to replace the existing one with a new disk.

For this case where the logical volume is mirrored with stripping, how we need to proceed?

Please let me know if you need any further information on this...


Thanks in Advance,

Regards,
Vijay Sabinkari.
18 REPLIES
Steven E. Protter
Exalted Contributor
Solution

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Shalom,

Take your steps until pvdisplay shows the disk is clean of all logical volume information.

Then you can vgreduce the disk out of the volume group.

If the disk is in need of replacement you may run into trouble. A guide.

http://docs.hp.com/en/7161/LVM_OLR_whitepaper.pdf

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
James R. Ferguson
Acclaimed Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Vijay:

> For this case where the logical volume is mirrored with stripping, how we need to proceed?

Why do you think it is mirrored and stripped [which at 11.11 isn't an option]?

The logical volume you show is mirrored (Mirror copies=1) but has no stripes (Stripes=0).

Regards!

...JRF...
Tingli
Esteemed Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

I never did this before. But I think you can split mirror then rebuild the stripe with the new disk.
sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Steven,

can i do the below:

firstly i am reducing the mirror copy of logical volumes associated with PV /dev/dsk/c3t12d0:

--->lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0

lvreduce -m 0 /dev/vg01/lvol24 /dev/dsk/c3t12d0

lvreduce -m 0 /dev/vg01/lvol25 /dev/dsk/c3t12d0

lvreduce -m 0 /dev/vg01/lvol26 /dev/dsk/c3t12d0

lvreduce -m 0 /dev/vg01/lvol27 /dev/dsk/c3t12d0


---------------------------------------------

then i will go for vgreduce to make the disk c3t12d0 out of the volume group:

vgreduce /dev/vg01 /dev/dsk/c3t12d0

Is there anything else I need to do Steven before going for replacing the disk with the new one?

Thanks in Advance,

Regards,
Vijay Sabinkari.

Patrick Wallek
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

If you are reducing mirrors, you need to specify ALL Disks that hold a particular mirror copy, not just c3t12d0.

sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Patrik,

do you mean to say , I need to consider other disks which are showing while lvdisplay:

/dev/dsk/c3t8d0 4499 4499
/dev/dsk/c3t10d0 4499 4499
/dev/dsk/c3t12d0 1751 1751
/dev/dsk/c3t14d0 1751 1751

Thanks in Advance,

Regards,
Vijay Sabinkari
Torsten.
Acclaimed Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

There is no striping!

Find out what disks are mirrored and remove one copy, e.g.

# lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t10d0 /dev/dsk/c3t14d0

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!   
sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi All,

I had one small query here:

Please find the attachment for lvdisplay output:

here how the mirroring is happened, could anyone please explain me..

As i know c3t8d0 data is syncd with c3t12d0 and c3t14d0 data also is syncd with c3t12d0...

Is it correct?

1) If it is correct, i would like to sync the c3t8d0 data with another disk, for that can i fallow the below:

reducing the mirror copy c3t12d0 which is having the data of the disk c3t8d0:


lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0 /dev/dsk/c3t8d0

and I would like to make new copy of mirror for data in c3t8d0 in the disk c3t10d0:

lvextend -m 1 /dev/vg01/lvol23 /dev/dsk/c3t10d0 /dev/dsk/c3t8d0

Please suggest me how can i proceed on this...

Thanks in Advance,

Regards,
Vijay Sabinkari.
Ganesan R
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi,

Your setup is not complicated. It is very simple.

Primary copy of the lv is residing on c3t8d0 and c3t14t0.(Total PE's 4499+1751=6250). This data is mirrored to single disk c3t12d0.

Now you don't any issue to replace any of the disk. If you want to make this lv in simple way, move all the PE's from c3t14t0 to c3t8d0 if you have 1751 PE's free. So that you can have primary on c3t8d0 and mirror on c3t12d0.

If you tell us your current requirement, we can guide you further.

Best wishes,

Ganesh.
James R. Ferguson
Acclaimed Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi:

> As i know c3t8d0 data is syncd with c3t12d0 and c3t14d0 data also is syncd with c3t12d0...Is it correct?

Yes.

> If it is correct, i would like to sync the c3t8d0 data with another disk, for that can i fallow the below:

> reducing the mirror copy c3t12d0 which is having the data of the disk c3t8d0:

This will mean that the mirrored extents on c3t14d0 are no longer mirrored, either.

# lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0

NOTE that I corrected this.

> and I would like to make new copy of mirror for data in c3t8d0 in the disk c3t10d0:

# lvextend -m 1 /dev/vg01/lvol23 /dev/dsk/c3t10d0 /
Yes, once you have 'pvcreate'd the physical disk; and 'vgextend'ed it into the volume group.

Regards!

...JRF...
Ganesan R
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi,

Forgot to update you this..

You said,
>>>reducing the mirror copy c3t12d0 which is having the data of the disk c3t8d0:


lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0 /dev/dsk/c3t8d0<<<

Again I want to make it clear that one copy of data is there on c3t8d0+c3t14d0 and other copy is on c3t12d0. So your above command won't work. You can either reduce the first copy from c3t8d0+c3t14d0 or second copy from c3t12d0. So the two possiblities are,

lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t14d0 /dev/dsk/c3t8d0
lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0

You decide which copy you want to reduce. After that you can extend the mirror with new disk or whatever disk you want.
Best wishes,

Ganesh.
sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

My current requirement is:

I would like to reduce the mirror copy c3t12d0 and would like to sync the data of c3t8d0 with c3t10d0(New disk) , and c3t14d0 data with c3t12d0..

How can i proceed?

Thanks in advance,

Regards,
Vijay Sabinkari.
Ganesan R
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Again,

>>>I would like to reduce the mirror copy c3t12d0 and would like to sync the data of c3t8d0 with c3t10d0(New disk) , and c3t14d0 data with c3t12d0..<<<

I am bit confused now. Will go your requirement step by step.
Your first step,I would like to reduce the mirror copy c3t12d0.

#lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0

Now you don't have mirror and the lv is distributed on two disks c3t8d0+c3t14d0.

Your second step, and would like to sync the data of c3t8d0 with c3t10d0(New disk) , and c3t14d0 data with c3t12d0..

sync the data on c3t8d0 with c3t10d0 means what? you want to move the data from c3t8d0 with c3t10d0 or mirror the data from c3t8do with c3t10d0? If move use pvmove command. if mirror the entire lv (both c3t8+c3t14 data)will be mirrored with c3t10d0. You don't have option to mirror portion of lv to one disk and remaining portion of the lv to another disk.

Best wishes,

Ganesh.
sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Ganeshan,

I will explain you clearly:

Previously the logical volume : lvol23 associated with four disks as below:


#lvdisplay -v /dev/vg01/lvol23

--- Logical volumes ---
LV Name /dev/vg01/lvol23
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 25000
Current LE 6250
Allocated PE 12500
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/c3t8d0 4499 4499
/dev/dsk/c3t10d0 4499 4499
/dev/dsk/c3t12d0 1751 1751
/dev/dsk/c3t14d0 1751 1751

now when we reduced the disk c3t12d0, lvol23 was associated with only two disks i.e. c3t8d0 and c3t14d0..

once we have done increasing the lv as below:

lvextend -m 1 /dev/vg01/lvol23 /dev/dsk/c3t12d0

lv has been increased as below:

--- Logical volumes ---
LV Name /dev/vg01/lvol23
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 25000
Current LE 6250
Allocated PE 12500
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/c3t8d0 4499 4499
/dev/dsk/c3t14d0 1751 1751
/dev/dsk/c3t12d0 6250 6250

previously only 1751 PE's were taken from the PV c3t12d0, now it took 6250 PE's from that..

now the other disk is available c3t10d0 where it has 4499 PE's,

Is there anything we can do with this Logical Volume to become as previous state?

Regards,
Vijay
Ganesan R
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Vijay,

I could understand what you did.

>>now when we reduced the disk c3t12d0, lvol23 was associated with only two disks i.e. c3t8d0 and c3t14d0..<<

Yes. You should understand onething here. When you reduce the lv from c3t12d0, it will reduce the lv from both c3t12d0 and c3t10d0. because the mirror copy is distributed on both disks. At this stage you have only one copy on c3t8d0+c3t14d0.

>>once we have done increasing the lv as below:
lvextend -m 1 /dev/vg01/lvol23 /dev/dsk/c3t12d0
lv has been increased as below:
previously only 1751 PE's were taken from the PV c3t12d0, now it took 6250 PE's from that..<<

This is what I have explained in earlier reply. When you extend the mirror, the mirror data will be copied to the first available disk then goto the next disk if space is not enough. In your case the entire data is mirrored to c3t12d0 since it has enough space. Now the data is like this...
Primary(c3t8+c3t14) <=> Mirror(c3t12)

>>now the other disk is available c3t10d0 where it has 4499 PE's,

Is there anything we can do with this Logical Volume to become as previous state?<<

Why do you want do so? there is no benefit out of it. You can use c3t10d0 for some other purpose. And also you can consider to have primary copy on single disk (either on c3t8 or c3t12) instead of two disks provided if you have enough space(6250 free PE's) on any one of the disk.

Hope this helps you..


Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi Vijay,

There is typo error in my last reply..

//And also you can consider to have primary copy on single disk (either on c3t8 or c3t12) instead of two disks provided if you have enough space(6250 free PE's) on any one of the disk.//

I have mentioned the disk name c3t12 instead of c3t14.Correct sentence is,
//And also you can consider to have primary copy on single disk (either on c3t8 or c3t14) instead of two disks provided if you have enough space(6250 free PE's) on any one of the disk.//

Sincere apologize for the mistake..

Best wishes,

Ganesh.
Steven E. Protter
Exalted Contributor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Shalom,

You ask:

Is there anything we can do with this Logical Volume to become as previous state?

Answer:
Yes, you can back up the data, and rebuild the raid array from scratch. Then you can restore the data.

This scheme strikes me as overly complex.

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
sabinkarvijay
Frequent Advisor

Re: removing disk from volume group where associated lvm's are mirrored with stripping...

Hi All,

Finally I did the below,

lvreduce -m 0 /dev/vg01/lvol23 /dev/dsk/c3t12d0

lvextend -m 1 /dev/vg01/lvol23 /dev/dsk/c3t10d0 /dev/dsk/c3t12d0

Now it has been like previous..

Thanks all for your prompt responses..

Regards,
Vijay Sabinkari.