LVM and VxVM

Error in lvextend (HP-UX 11.11)?

 
SOLVED
Go to solution
Michael Roeder
Frequent Advisor

Error in lvextend (HP-UX 11.11)?

Hello,

i guess i've found a bug:

Doing: lvextend -m 3 /dev/vg03/opt /dev/dsk/c0t1d0
Usage: lvextend
...
"MirrorCopies": Must be either 1 or 2.

the command has added the disk /dev/dsk/c0t1d0 to my /etc/lvmtab:

# strings /etc/lvmtab
/dev/vg03
/dev/dsk/c0t2d0
/dev/dsk/c0t12d0
/dev/dsk/c0t11d0
/dev/dsk/c0t1d0

The next lvreduce operation will automatically correct the lvmtab.
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: Error in lvextend (HP-UX 11.11)?

No, no bug. You have just reached the limit of the number of mirrors of 1 LV you can have.

Check the lvextend man page.

-m mirror_copies
Set the number of mirror copies allocated for each logical extent. A mirror copy contains the same data as the original. mirror_copies can have the value 1 or 2. It must be greater than the current value.
Uday_S_Ankolekar
Honored Contributor

Re: Error in lvextend (HP-UX 11.11)?

Values for lvextend -m option should be either 1 or 2. number 3 or more is not allowed.
Good Luck..
Michael Roeder
Frequent Advisor

Re: Error in lvextend (HP-UX 11.11)?

Well, i mean, the 4 entries in lvmtab are too much when only 2 mirror copies are possible.
Jeff Schussele
Honored Contributor

Re: Error in lvextend (HP-UX 11.11)?

Hi Michael,

I think you're confusing the -m value - it's TOTAL mirror copies, not disks composing mirror.
You want lvextend with the disk devices only - you WILL need to add TWO disks to keep the mirror.
To me it appears you had two mirror pairs composed of one disk each. You tried to add the other disks. But IF you already had a mirror, all you have to do is add the two other disks to the VG & then to the LV. System will assume you wish to retain the mirror & use them accordingly.

So just lvreduce the two new disks & readd with:

lvextend /dev/vg03/opt /dev/dsk/c0t1d0 /dev/dsk/c0t11d0

That should do it - check with vgdisplay -v or lvdisplay -v .

NOW IF you didn't have a mirror to begin with then the command will be:

lvextend -m 1 /dev/vg03/opt /dev/dsk/c0t1d0 /dev/dsk/c0t11d0

And then you'll have a mirror copy - but NO new space.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Roeder
Frequent Advisor

Re: Error in lvextend (HP-UX 11.11)?

Jeff,

i have written a complete mirror script for all possible disks (it is not finished, but it does a very good job - nothing to think any more). The point is, i am changing some disks (upgrade to larger and changing HW-path [without export/import]) and thus testing the script. I had
# strings /etc/lvmtab
/dev/vg03
/dev/dsk/c0t2d0
/dev/dsk/c0t12d0

then i mirrored (2nd mirror, 3 disks) to /dev/dsk/c0t11d0. Before removing /dev/dsk/c0t2d0, i started one more mirror (3rd mirror, 4th disk) try. I KNOW that only 2 mirrors are possible, but does HP? The output was the error message of lvextend (of course), but the bug was, the i have got the 4th entry /dev/dsk/c0t1d0
to lvmtab. I suppose you can do the same and follow to this behavior.
That IS A BUG for me (and i think for HP, too). Well, there are some cases where we have to write a new lvmtab manually.

I apologize for any misunderstandings.
Michael Roeder
Frequent Advisor

Re: Error in lvextend (HP-UX 11.11)?

Here is the output as attachment.
Michael Steele_2
Honored Contributor

Re: Error in lvextend (HP-UX 11.11)?

Number of mirrors allowed in 'lvextend' is 0, 1 or 2.

Regarding "...i am changing some disks (upgrade to larger ..."

What are the new disk sizes please?

Did you vgextend in the new disks into the old VG or did you vgcreate a new VG with the new, larger disks?

I ask because somewhere around 36 GB you need to make new VG's and increase the MAX_PE and / or PE_SIZE, or you will map the smaller disk geometry onto the bigger, and be left with the smaller disks dimensions and limitations on a physically larger disk.
Support Fatherhood - Stop Family Law
Michael Roeder
Frequent Advisor

Re: Error in lvextend (HP-UX 11.11)?

Michael,

check my previous attachment:
PE Size (Mbytes) 4
PV Name /dev/dsk/c0t2d0
Total PE 1023

i.e. 4,3 GB

Name /dev/dsk/c0t12d0
Total PE 1023
PV Name /dev/dsk/c0t11d0
Total PE 2170
Free PE 1147
PV Name /dev/dsk/c0t1d0
Total PE 2170
Free PE 2170

As you can see, c0t2d0 and c0t12d0 are both 4,3 GB. c0t11d0 is 9 GB (1023 PE already mirrored) and c0t1d0 is free (9 GB), unmirrored, that was just the try. ;-)
Used PV 3
Patrick Wallek
Honored Contributor
Solution

Re: Error in lvextend (HP-UX 11.11)?

The lvextend likely had nothing to do with the disk being in the /etc/lvmtab file. YOu *had* to have vgextend'ed the disk into the VG before you did an lvextend to attempt to create another mirror. The act of doing the vgextend puts the disk into the /etc/lvmtab file.

If you tried to do an lvextend to a disk that was not part of a VG you would get an error.