1754824 Members
4511 Online
108825 Solutions
New Discussion юеВ

volume group

 
SOLVED
Go to solution
Jade Bulante
Frequent Advisor

volume group

What is the command to determine which physical volume in the volume group is the primary and which one is the mirrored copy??

Need help.
9 REPLIES 9
Andrew_4
Honored Contributor
Solution

Re: volume group

As far as I know, there isn't really a primary/secondary aspect to mirroring... they are both considered the same when a failed disk occurs..

However, if you reduce a mirror without specifing which disk to reduce, then it will probably take he disk that is in the right hand column of the lvdisplay -v LV output...

Just my thoughts... Can anyone correct me ?

Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
Animesh Chakraborty
Honored Contributor

Re: volume group

Hi jade,
Are you looking for this command ?

#lvdisplay -v /dev/vg00/lvol3|more
Will show the of physical volumes


--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t6d0 35 35
/dev/dsk/c2t6d0 35 35
Normally we call first disk as primary but it hardly matters as both the disk are same.

Thanks
Animesh
Did you take a backup?
Santosh Nair_1
Honored Contributor

Re: volume group

I believe if you do a lvdisplay -v on the logical volume, the table showing the logical extends lists the primary disk first followed by the mirror disk.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Santosh Nair_1
Honored Contributor

Re: volume group

Hmm, I just created two LVs on the same VG with two disks.
On the first LV I created on disk1 and extended (lvextend -m 1) to disk2.
On the second LV I created on disk2 and extended it to disk1.

The output from lvdisplay -v shows both LVs similarly, i.e. that they both span both disk, and list both disk in the same order, i.e. lexigraphically (?). BUT, the logical extents area list disk1 as PV1 and disk2 as PV2 on the first LV, whereas the the second LV list disk2 as PV1 and disk1 as PV2.

So doesn't this mean that PV1 is the primary disk and PV2 is the mirror copy?

-Santosh
Life is what's happening while you're busy making other plans
Sanjay_6
Honored Contributor

Re: volume group

Hi Jade,

My opinion is Santosh is right. When you do lvdisplay -v /dev/vg_name/lv_name it show you the distribution of extent and refer to the first link as PV1 and the other as PV2. So it should be safer to say that the disk on which the first extent is there would be the primary disk and the disk on which the copy of that extent is present is the seconday copy. This is if you are having mirror on different disks.

Hope this helps.

Thanks
SUDHAKARAN.
Occasional Advisor

Re: volume group

Hi,
you can try
#lvlnboot -v

The Hard disk shown first is generally taken as the primary HDD and the second as Mirrored HDD.

HTH,
S.Sudhakaran.
Unix Administrator
Marcin Wicinski
Trusted Contributor

Re: volume group

Hi,

Just execute
# lvdisplay -v /dev/vg##/lvol#

In --Logical extents-- section you will get information on how PEs are distributed and which PV is primary and which is mirror.

Later,
Marcin Wicinski
Wodisch
Honored Contributor

Re: volume group

Hello Jade,

it depends upon which mirror copy was broken, and
then the "surviving" one is mirrored onto the other
(after this has been replaced, and re-activated).

But you can ask your kernel, from which of the disks
it did actually boot, if that is, what you are looking for:

echo "boot_string/S" | adb /stand/vmunix /dev/mem

HTH,
Wodisch
Jeff Gyurko
Frequent Advisor

Re: volume group

Jade,

There is no command that specifcally says that PV? is the primary.

The general understanding when working with LVM is that the left hand column of your lvdisplay -v is the "primary" while the right
hand column is the mirror. If you were to do an lvdisplay -v before you mirror the output would be displayed on the left hand side for the physical extents which is why most equate the "primary" with the left side of the output.

If you were to do an lvreduce and specify PV1 as the mirror to get rid of, then PV2 would assume the left side of the lvdisplay -v output. Consequently if you were to establish a mirror copy again specifying PV1, it would be on the right side of the lvdisplay output.

It's really what you are comfortable with when you talk about mirrors but I've always equated the "primary" with the lefthand side and the mirror with the righthand side of the lvdisplay -v output. Others may see it differently though.

My $.02

Jeff