Operating System - HP-UX
1753454 Members
6317 Online
108794 Solutions
New Discussion юеВ

Re: Alt Links: lvmtab vs pvchange -s

 
SOLVED
Go to solution
SM_3
Super Advisor

Alt Links: lvmtab vs pvchange -s

The lvmtab displays a hierarchy of disk devices.

If one controller precedes the other then the given controller is Primary.

We can change the primary path via vgreduce and this is reflected in lvmtab (i.e. the order of the devices).

If we use pvchange -s, the disk device can become primary but it's not reflected in lvmtab, but is in vgdisplay.

In this case does lvmtab preside over vgdisplay?

5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Alt Links: lvmtab vs pvchange -s

Hi:

In reality, the *first* path defined for a disk in '/etc/lvmtab' constitutes the primary link. The behavior you see is as expected. To permanently change a primary to a secondary link, promoting the secondary to primary, use 'vgreduce ' then 'vgextend . This swaps the order in 'etc/lvmtab'.

Regards!

...JRF...
Sachin Patel
Honored Contributor

Re: Alt Links: lvmtab vs pvchange -s

I thought vgscan creats new lvmtab file. So I start reading man page of vgscan and interesting enough I found


Since vgscan search each disks on the system in the order of where
they have configured. When vgscan reconstruct /etc/lvmtab file, the
order of disks in the file could be different than it was before. The
following will happen:

The designated primary and alternate link might not be the same
as it was configured before.

Alternate links will be added to the /etc/lvmtab file even if
they might not be configured in the volume group initially.

The boot information might be incorrect due to different order of
disks in the new /etc/lvmtab file.

In order to correct the above problems, do the following:

Use vgchange with -a option to activate all volume groups.

Use lvlnboot with -R option to correct boot information on disk.

Use vgreduce to reduce any alternate links that were added to the
/etc/lvmtab file by vgscan, but they were not needed.

If the original primary path of a disks become an alternate path
after /etc/lvmtab file is reconstructed, the order can be easily
reverted by using vgreduce to remove the primary path and use
vgextend to add the path back again.


Sachin
Is photography a hobby or another way to spend $
SM_3
Super Advisor

Re: Alt Links: lvmtab vs pvchange -s

So lvmtab does preside over pvchange, in this case.

Thanks.
S.K. Chan
Honored Contributor
Solution

Re: Alt Links: lvmtab vs pvchange -s

This is what I noticed. I have the same order of PVs as it appears in lvmtab and vgdisplay output. After I switched it with ..
# pvchange -s
.. it got switched in the vgdisplay output but not in lvmtab file (this is expected). Next I rescan/recreate lvmtab file to see if it would put them in order as it appear in vgdisplay. It does not. It seems using pvchange does not change the outcome of how the disks are arranged in lvmtab.
SM_3
Super Advisor

Re: Alt Links: lvmtab vs pvchange -s

Mmmm.

ok

thanks for that!

thanks to all...