1847488 Members
3755 Online
110265 Solutions
New Discussion

Re: lvextend issues

 
SOLVED
Go to solution
wellsy1976
Occasional Advisor

lvextend issues

Hi

I'm trying to increase a logical volume with lvextend but i'm getting the error

# lvextend -L 5632 /dev/vgrns/lvu02ora
lvextend: Not enough free physical extents available.
Logical volume "/dev/vgrns/lvu02ora" could not be extended.

I have three PV mirrored onto another three. The disk that this LV sits on is full but I have plenty of room on the other two. I have tried doing an lvchange -C n on the LV to set the contiguous space allocation but still no luck.

Any ideas

Thanks
15 REPLIES 15
Patrick Wallek
Honored Contributor

Re: lvextend issues

The output of 'vgdisplay -v /dev/vgrns' and 'lvdisplay /dev/vgrns/lvu02ora' would be helpful in troubleshooting your issue.
wellsy1976
Occasional Advisor

Re: lvextend issues

# vgdisplay -v /dev/vgrns |more
--- Volume groups ---
VG Name /dev/vgrns
VG Write Access read/write
VG Status available, exclusive
Max LV 255
Cur LV 12
Open LV 12
Max PV 16
Cur PV 6
Act PV 6
Max PE per PV 24000
VGDA 12
PE Size (Mbytes) 4
Total PE 19406
Alloc PE 17430
Free PE 1976
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgrns/lvu01ora
LV Status available/syncd
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Used PV 2

LV Name /dev/vgrns/lvbkup02
LV Status available/syncd
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Used PV 2

LV Name /dev/vgrns/lvoralogs
LV Status available/syncd
LV Size (Mbytes) 100
Current LE 25
Allocated PE 50
Used PV 2

LV Name /dev/vgrns/lvorabase
LV Status available/syncd
LV Size (Mbytes) 4160
Current LE 1040
Allocated PE 2080
Used PV 2

LV Name /dev/vgrns/lvarch
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
Used PV 4

LV Name /dev/vgrns/lvbkup03
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
Used PV 2

LV Name /dev/vgrns/lvu02ora
LV Status available/syncd
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Used PV 2

LV Name /dev/vgrns/lvbkup01
LV Status available/syncd
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Used PV 2

LV Name /dev/vgrns/lvdbexp
LV Status available/syncd
LV Size (Mbytes) 3500
Current LE 875
Allocated PE 1750
Used PV 2

LV Name /dev/vgrns/lvsgopt
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 1000
Used PV 3

LV Name /dev/vgrns/lvu03ora
LV Status available/syncd
LV Size (Mbytes) 1000
Current LE 250
Allocated PE 500
Used PV 2

LV Name /dev/vgrns/lvoralogs3
LV Status available/syncd
LV Size (Mbytes) 100
Current LE 25
Allocated PE 50
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c4t1d0
PV Status available
Total PE 4340
Free PE 0
Autoswitch On

PV Name /dev/dsk/c4t3d0
PV Status available
Total PE 1023
Free PE 748
Autoswitch On

PV Name /dev/dsk/c4t5d0
PV Status available
Total PE 4340
Free PE 240
Autoswitch On

PV Name /dev/dsk/c6t1d0
PV Status available
Total PE 4340
Free PE 0
Autoswitch On

PV Name /dev/dsk/c6t3d0
PV Status available
Total PE 1023
Free PE 748
Autoswitch On

PV Name /dev/dsk/c6t5d0
PV Status available
Total PE 4340
Free PE 240
Autoswitch On

# lvdisplay /dev/vgrns/lvu02ora
--- Logical volumes ---
LV Name /dev/vgrns/lvu02ora
VG Name /dev/vgrns
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation PVG-strict
IO Timeout (Seconds) default


thanks!!
Torsten.
Acclaimed Contributor

Re: lvextend issues

You want to increase to a size of (-L) 5632 - this needs 1408 PE's.

But your LV is mirrored - so you need 2816 PE's, but you have **only** 1976 PE's free!

That's why you get

Not enough free physical extents available

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
wellsy1976
Occasional Advisor

Re: lvextend issues

Looks like my maths are wrong?!

I want to increase a 5GB file system to by 500MB. I thought there was 1976 4MB extents free.

1976 * 4
7904
Patrick Wallek
Honored Contributor

Re: lvextend issues

You should have plenty of room. You are increasing the LV by 632 MB or 158 extents. Because of mirrors you will 158 x 2 = 316 extents. You should have plenty free.

Your lvdisplay output shows that your allocation policy for the LV is PVG-strict. What PVGs do you have set up for this VG?

The contents of /etc/lvmpvg would be helpful here.
Torsten.
Acclaimed Contributor

Re: lvextend issues

I always struggle with upper- and lower-case L that's why I read the man page - for lvcreate! That's why my calculation was a bit wrong, sorry.

lvu02ora
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500

new number of PE is 1408 - a difference of 158 (* 2) = 316 (because it is mirrored).

The VG should have enough space, but can post ~5 more lines for

# lvdisplay /dev/vgrns/lvu02ora

How about your /etc/lvmpvg and /etc/lvmtab file?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
wellsy1976
Occasional Advisor

Re: lvextend issues

the output is

# more /etc/lvmpvg
VG /dev/vg00
PVG vg00_main
/dev/dsk/c2t2d0
PVG vg00_mirror
/dev/dsk/c1t2d0

Looks like the vgrns is isnt in the file

The file systems I'm trying to increase are Service Guard?
wellsy1976
Occasional Advisor

Re: lvextend issues

# more /etc/lvmtab
^CM-h^B/dev/vg00

/M-@S?M-^XM-tM--^B/dev/dsk/c2t2d0
/dev/dsk/c1t2d0
/dev/vgrns
^FM-xM-^?S?M-/M-7^A^F/dev/dsk/c4t1d0
/dev/dsk/c4t3d0
/dev/dsk/c4t5d0
/dev/dsk/c6t1d0
/dev/dsk/c6t3d0
/dev/dsk/c6t5d0

It looks a bit corrupted??

# lvdisplay -v /dev/vgrns/lvu02ora |more
--- Logical volumes ---
LV Name /dev/vgrns/lvu02ora
VG Name /dev/vgrns
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 5000
Current LE 1250
Allocated PE 2500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation PVG-strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c4t5d0 1250 1250
/dev/dsk/c6t5d0 1250 1250

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c4t5d0 00000 current /dev/dsk/c6t5d0 00000 current
00001 /dev/dsk/c4t5d0 00001 current /dev/dsk/c6t5d0 00001 current
00002 /dev/dsk/c4t5d0 00002 current /dev/dsk/c6t5d0 00002 current
00003 /dev/dsk/c4t5d0 00003 current /dev/dsk/c6t5d0 00003 current
Torsten.
Acclaimed Contributor

Re: lvextend issues

/etc/lvmtab is not corrupted - it is binary!

Use

# strings /etc/lvmtab

....

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
wellsy1976
Occasional Advisor

Re: lvextend issues

sorry

# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c2t2d0
/dev/dsk/c1t2d0
/dev/vgrns
/dev/dsk/c4t1d0
/dev/dsk/c4t3d0
/dev/dsk/c4t5d0
/dev/dsk/c6t1d0
/dev/dsk/c6t3d0
/dev/dsk/c6t5d0
Torsten.
Acclaimed Contributor

Re: lvextend issues

The allocation policy is PVG strict, so you should adjust the /etc/lvmpvg file to reflect also this VG.


like this:

# more /etc/lvmpvg
VG /dev/vg00
PVG vg00_main
/dev/dsk/c2t2d0
PVG vg00_mirror
/dev/dsk/c1t2d0
VG /dev/vgrns
PVG vgrns_main
/dev/dsk/c4t1d0
/dev/dsk/c4t3d0
/dev/dsk/c4t5d0
PVG vgrns_mirror
/dev/dsk/c6t1d0
/dev/dsk/c6t3d0
/dev/dsk/c6t5d0

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Patrick Wallek
Honored Contributor

Re: lvextend issues

Or you could just turn off the PVG-strict allocation policy for this VG.

# lvchange -s y /dev/vgrns/lvu02ora

This will change the allocation policy to strict, which means mirrors of an LV cannot be on the same PV. See the lvchange man page for more info.

Once you have done that, try your lvextend again. I think it should work.

If you want to control where your extents are allocated from, specify the disk device files on your lvextend command line.
wellsy1976
Occasional Advisor

Re: lvextend issues

I updated the lvmpvg file and tried the lvextend and it worked

Thanks For all your help!!
Torsten.
Acclaimed Contributor
Solution

Re: lvextend issues

IMHO it is the better way to work with the lvmpvg file.

BTW - Welcome to the forums!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: lvextend issues

Thanks for all the points but now it is enough ;-)

Just to add this.
If you do the command you did
# lvextend -L 5632 /dev/vgrns/lvu02ora

without PVG-strict and with only strict allocation policy, maybe your LV will extend to 2 disk on the same bus (for example c6t3d0 mirrored to c6t5d0), - that's it and this is not what you want to do.
Without any strict policy and without a specified target LVM could even mirror the LVOL to the **same** disk!

Without PVG-strict you need to say

# lvextend -L 5632 /dev/vgrns/lvu02ora /dev/dsk/c4t3d0 /dev/dsk/c6t3d0

for example, so the conclusion is to use lvmpvg, because this makes all easier and safe.


>> The file systems I'm trying to increase are Service Guard


Now you need to make the other nodes aware of this change.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!