Operating System - HP-UX
1836987 Members
2198 Online
110111 Solutions
New Discussion

change which primary path to use on a VG

 
SOLVED
Go to solution
f. halili
Trusted Contributor

change which primary path to use on a VG

Hello everyone,

I have a VG and its disk have 3 ALTERNATE PATHS. See below. How can I change the primary path? I want to use c12t1d7 as the primary path not c9t1d7.

PV Name /dev/dsk/c9t1d7
PV Name /dev/dsk/c10t1d7 Alternate Link
PV Name /dev/dsk/c11t1d7 Alternate Link
PV Name /dev/dsk/c12t1d7 Alternate Link

Thanks,
f. halili
derekh
7 REPLIES 7
Jeff_Traigle
Honored Contributor
Solution

Re: change which primary path to use on a VG

pvchange -s /dev/dsk/c12t1d7
--
Jeff Traigle
Sandman!
Honored Contributor

Re: change which primary path to use on a VG

vgreduce all PVs above c12t1d7 until c12t1d7 cycles to the top of the list and then vgextend all the PVs that were above c12t1d7 in the beginning.
Sandman!
Honored Contributor

Re: change which primary path to use on a VG

vgreduce all PVs above c12t1d7 until c12t1d7 cycles to the top of the list and then vgextend all the PVs that were above c12t1d7 in the beginning i.e.

# vgreduce /dev/vgname /dev/dsk/c9t1d7 /dev/dsk/c10t1d7 /dev/dsk/c11t1d7

# vgextend /dev/vgname /dev/dsk/c9t1d7 /dev/dsk/c10t1d7 /dev/dsk/c11t1d7
Sandman!
Honored Contributor

Re: change which primary path to use on a VG

Sorry for double posts; Jeff's answer is perfect for what you are looking for.
James R. Ferguson
Acclaimed Contributor

Re: change which primary path to use on a VG

Hi:

In cases where you want to reorder a large number of pvlinks, (and can tolerate taking the volume group offline) you can 'vgexport' and 'vgimport' the volume group using the '-f outfile' to collect the pv_paths from the 'vgexport'; edit their order; and used the newly ordered members in the 'vgimport'.

See the manpages for 'vg(ex|im)port' for further details.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: change which primary path to use on a VG

Hi (again):

To add to the use of 'pvchange'. You may want also to set 'pvchange -S' (n|y) to control whether or not LVM will switch back to the primary path that you originally had.

Too, using 'pvchange -s' will not be preserved across a reboot since the order of the pv_paths in the 'etc'lvmtab' is *not* affected. A primary path is simply one that occurs *first* in the list for a volume group in the 'lvmtab'.

Regards!

...JRF...
f. halili
Trusted Contributor

Re: change which primary path to use on a VG

thanks !
derekh