Operating System - HP-UX
1752618 Members
4496 Online
108788 Solutions
New Discussion

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

 
SOLVED
Go to solution
grahamswilson
Trusted Contributor

Mirroring lvol made up of multiple pv's onto a single larger pv...

Hi...

 

I did find some almost relevant posts, but wanted to seek some "fresh" advice/input...

 

We want to move from one storage environment to another and want to use mirroring to do so - but - if you have a LV made up of a bunch of PV's...and want to mirror to a single larger PV in the process...I know this works, with a simple

 

lvextend -m 1 /dev/vgXX/lvolYY /dev/disk/new_large_pv.

 

What I'm looking for is clarification on what happens in this scenario when you break the mirror.

 

If the original and new PV were the same size, I would do a

 

lvextend -m 0 /dev/vgXX/lvolYY /dev/disk/original_pv

 

which would remove the original disk and leave the new disk, but, what would I do to remove the smaller, multiple PVs from the mirror, leaving only the new larger PV?!

 

Some of these servers are older 11iv3 and dont have lvmove, and I was hoping to use mirroring rather than pvmove.

 

Any input/advice welcome.

 

5 REPLIES 5
Torsten.
Acclaimed Contributor

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

In this case you will do

 

lvextend -m 0 /dev/vgXX/lvolYY /dev/disk/original_pv1 /dev/disk/original_pv2 ...


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!   
Patrick Wallek
Honored Contributor

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

 

In this case you will do

lvextend -m 0 /dev/vgXX/lvolYY /dev/disk/original_pv1 /dev/disk/original_pv2 ...

 

I think you mean:

 

lvreduce -m 0 /dev/vgxx/lvolYY /dev/disk/original_pv1 /dev/disk/original_pv2 . . .

 

grahamswilson
Trusted Contributor
Solution

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

Fantastic!  Thank you...

 

Simply name all the smaller PV's on the command line during the lvreduce command!

 

So obvious...

 

...and thanks for the clarification, I did mean lvreduce not lvextend, but good catch and thanks for clarifying...

Torsten.
Acclaimed Contributor

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

Sorry, my fault - just did a copy and paste ... :-(


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!   
efinneran
Visitor

Re: Mirroring lvol made up of multiple pv's onto a single larger pv...

You don't have to be quite that explicit if you don't want to.  LVM uses the concept of copy 1 and copy 2 (and optionally 3). If you do an lvdisplay -v on the logical volume and scroll through all that output, you can see it list for each physical extent (line), which drive holds the first copy (I call it 'left column') and the second (right column).

 

In your case you should see al those different little drives showing up in the left column, and the new larger single physical volume in the right column.  When you do the lvremove, all you need to provide is enough information to know which copy you would like to remove versus which copy you want to keep. Provided when you specify that lvremove, that you include at least one physical drive that is on the list in the left column, that will tell LVM you want to remove the first copy and keep the second copy. As a result, it will remove all the drives listed in the left column, leaving you with a single copy on your new drive.You could list all the different drives that are present in the left column, but the result will be the same as specifying only one.

 

If you were really curious, you could do a subsequent lvdisplay -v and see that the extents listed in the right column (copy 2) have now moved to the left column and become copy 1 (the only copy at that point).

 

-- Ed