1834809 Members
2794 Online
110070 Solutions
New Discussion

Re: pvchange -s

 
SOLVED
Go to solution
Jason_309
Regular Advisor

pvchange -s

After doing a pvchange -s. I do a lvdisplay -v to see which is which and it still shows the orginal primary disk as the primary disk.
17 REPLIES 17
James R. Ferguson
Acclaimed Contributor

Re: pvchange -s

Hi Jason:

The "permanent" way to swap a primary and alternate pvlink is to 'vgreduce' the primary pvlink, thereby promoting the secondary (alternate) pvlink to a primary. Then, 'vgextned' the original path just 'vgreduce'd. This adds the old primary link back as an "alternate".

If you do a 'strings '/etc/lvmtab' before and afterwards, you will see that the primary link is simply the *first* path listed. Of course, you can have up to seven (7) alternate links for each primary.

Regards!

...JRF...
Jason_309
Regular Advisor

Re: pvchange -s

James Thanks you. So the pvchange does not work? I need to do this hot.
James R. Ferguson
Acclaimed Contributor

Re: pvchange -s

Hi (again) Jason:

The 'pvchange -s pv_path' does work --- it causes LVM to start using the pv_path specified. It is not "permanent" in the sense that it the '/etc/lvmtab' is modified changing the order of pv_links specified therein. Hence, upon reboot, your change is lost.

Regards!

...JRF...
Jason_309
Regular Advisor

Re: pvchange -s

Maybe i am looking at the wrong thing, but on lvdisplay it shows the primary as the primary still. example:

lvdisplay:
/dev/dsk/c4t3d0
/dev/dsk/c6t11d0

#pvchange -s /dev/dsk/c6t11d0

lvdisplay:
/dev/dsk/c4t3d0
/dev/dsk/c6t11d0

Victor BERRIDGE
Honored Contributor

Re: pvchange -s

Hi Jason,
It doesnt look like alternate paths to me, but more like 2 PVs in a same group, and your lv spans on both...


Just thoughts

All the best
Victor
James R. Ferguson
Acclaimed Contributor

Re: pvchange -s

Hi Jason:

Use 'vgdisplay -v vgNN' to see what LVM considers a primary versus an alternate link.

This will match the order (primary first) as seen in '/etc/lvmtab'.

'pv_links' belong to the *volume group* layer.

Regards!

...JRF...
Jason_309
Regular Advisor

Re: pvchange -s

It is a picture of the two disks in the mirror for lvol1, the first is the primary the second is the secondary.
James R. Ferguson
Acclaimed Contributor

Re: pvchange -s

Hi Jason:

Use 'vgdisplay -v vgNN' to see what LVM considers a primary versus an alternate link.

This will match the order (primary first) as seen in '/etc/lvmtab' or governed by the last 'pvchange -s'.

'pv_links' belong to the *volume group* layer.

Regards!

...JRF...
Jason_309
Regular Advisor

Re: pvchange -s

I just noticed that the pv's have autoswitch on. Would this un do the pvchange?


James R. Ferguson
Acclaimed Contributor

Re: pvchange -s

Hi (again) Jason:

From the 'pvchange(1M)' manpages, for the '-S' option [note the CAPITAL letter]: "LVM is directed to automatically switch from the path it is using whenever a better path to the physical volume is available. LVM will switch paths when a better path recovers (after it had failed earlier), or if the current path fails and another path is available. This is the default."

Thus, reread my last posts and compare the information shown from 'strings /etc/lvmtab' and 'vgdisplay -v vgNN' using (1) 'pvchange -s' versus 'vgreduce'/'vgextend'.

LVM does *not* use alternate links to dynamically load-balance I/O traffic. On EMC SANs you can purchase PowerPath to provide this feature.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: pvchange -s

I'm confused by what you are doing. What is it you are trying to accomplish?

If you have 2 disks and the LVOLs on them are mirrored, you really do not gain anything by trying to make one the "primary" over the other. When HP-UX does a read, it will read the data from the disk that responds the fastest. When doing writes, it has to write to both disks to keep the mirror sync'ed so trying to switch the primary will not give a performance gain.
Jason_309
Regular Advisor

Re: pvchange -s

I have all the C4's as the primary and the C6's and secondary. I wanted to stagger them. Evens on the C4 and odds on the C6. I was told this would help with performance.
Jason_309
Regular Advisor

Re: pvchange -s

I have all the c4's as the primary and the c6's and secondary. I wanted to stagger them. Evens on the c4 and odds on the c6. I was told this would help with performance.
Patrick Wallek
Honored Contributor

Re: pvchange -s

If everything is mirrored, I seriously doubt that changing the primary and secondary will give a performance gain.

Jason_309
Regular Advisor

Re: pvchange -s

Is the number following the c a channel or controler number? If they are trying to use c4 wouldnt that cause a bottle neck? I dont know much about this stuff. We had a unix guy come in and he said this would help.
Jason_309
Regular Advisor

Re: pvchange -s

James, If you read this again. Is it correct that it does not matter which is primary?
Mridul Shrivastava
Honored Contributor
Solution

Re: pvchange -s

There are two things:

1. One is Mirroring: In this scenario there is nothing like primary and secondary and it works like patrik explained above ( while reading it reads from the disk which has fast access and while writing it writes to both), so there is no funda of primary and secondary.

2. Second thing is alternate paths: In this scenario both paths are pointing to the same disk ( no mirror), So if we have 10 VGs with alternate paths. Suppose one starts with c4 and other with c11, in that case it is advisable to use load sharing. Mean set primary path c4 for 5 vgs and c11 for rest, so both the interface cards will carry the data in shared mode. ( Not to overload one interface while other is carrying no data at all).

I hope it clears the doubt, please feel free to post if you still have doubts...

Cheers..
Time has a wonderful way of weeding out the trivial