1836617 Members
2304 Online
110102 Solutions
New Discussion

Re: lvextend error

 
SOLVED
Go to solution
Hans Hendriks_1
Frequent Advisor

lvextend error

Hello people,

I hope that someone can help me or have a great suggestion. I have one vg that has 5 disks. 4 diks of 14gb and one disk of 7gb. Now I want to increase the size of a lvol on this vg and I get the message: lvextend: Not enough free physical extents available

When I looked at the free physical extends of the diks I see the following:vgdisplay -v /dev/fnvg | egrep "PV Name|Free PE"
Free PE 6726
PV Name /dev/dsk/c9t0d0
PV Name /dev/dsk/c19t8d0 Alternate Link
Free PE 1660
PV Name /dev/dsk/c9t8d0
PV Name /dev/dsk/c19t0d0 Alternate Link
Free PE 1688
PV Name /dev/dsk/c9t8d2
PV Name /dev/dsk/c19t0d2 Alternate Link
Free PE 0
PV Name /dev/dsk/c12t0d0
PV Name /dev/dsk/c22t8d0 Alternate Link
Free PE 1684
PV Name /dev/dsk/c12t8d0
PV Name /dev/dsk/c22t0d0 Alternate Link
Free PE 1694

On these disk there is extend base stripping.
So I think that the problem is that on the disk of 7gb there is no free PE left so you cannot enlarge the lv.

But is their an easy way to make it work so I can extend the logical volume ?

Thenks al lot. Greetings Bart
18 REPLIES 18
Vincent Farrugia
Honored Contributor

Re: lvextend error

Hello,

Is the logical volume set to contiguous mode? If so, then it needs the physical extents to be one after the other, and therefore cannot complete the extend, since most probably there is another logical volume on the way.

HTH,
Vince
Tape Drives RULE!!!
John Palmer
Honored Contributor

Re: lvextend error

Hi,

If the lvol is extent striped and not 'properly' striped then you could stop the full disk from being considered by LVM by simply removing it from /etc/lvmpvg - just vi /etc/lvmpvg.

Regards,
John
Hans Hendriks_1
Frequent Advisor

Re: lvextend error

I do not have a file /etc/lvmpvg. I have checked all my 6 machines but this file we do not have.
Stefan Farrelly
Honored Contributor

Re: lvextend error

If you use extent based striping over say 5 disks then you need 5 disks with free space on in order to extend your lvol. One of your disks doesnt have any free PE - you need 5 disks with free PE in order to lvextend.

If you cant free up any PE on the disk with none free then all you can do is create a new lvol on the 4 disks which do have free PE.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Clemens van Everdingen
Honored Contributor

Re: lvextend error

Hi,

I think it has to do with the striping.
Probably the best way to solve this is to backup the data in that volume group and create it all over with the right sizes and put the backed up data back from tape.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
John Palmer
Honored Contributor

Re: lvextend error

Could you please post the output of the command lvdisplay -v where is the name of the LV that you are trying to extend. A full vgdisplay -v would also be useful.

Regards,
John
George Petrides_1
Honored Contributor

Re: lvextend error

As you can see from the vgdisplay output, disk /dev/dsk/c12t0d0 does not have any free PEs. Therefore you cannot extend the volume based on your striping policy. The only way I can think of, is adding a 14GB disk and use the pvmove command to relocate the logical volume from /dev/dsk/c12t0d0 to another disk and then expand or just add the other disk in the group and expand.
George
Dietmar Konermann
Honored Contributor

Re: lvextend error

Since you are using the distributed allocation policy I assume that the the lvol is PVG-strict.

In this case there needs to be an /etc/lvmpvg file specifying at least one PVG (or more if the lvol is mirrored). Maybe your /etc/lvmpvg is missing or does not contain enouth PVGs with enough disks? See man lvmpvg(4).

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Dietmar Konermann
Honored Contributor
Solution

Re: lvextend error

BTW, the extent base allocation policy does NOT reqire "clean stripes". lvextend does simply take extents from a PVG using a round robin algo. If one PV is full then the remaining PVs are used.

If your lvol is not mirrored then you may try to extend using a lvmpvg that contains all disks in a single PVG.

VG /dev/fnvg
PVG PVG0
/dev/dsk/c9t0d0
/dev/dsk/c9t8d0
/dev/dsk/c9t8d2
/dev/dsk/c12t0d0
/dev/dsk/c12t8d0

Regards...
Dietmar.




"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Hans Hendriks_1
Frequent Advisor

Re: lvextend error

 
John Palmer
Honored Contributor

Re: lvextend error

Create /etc/lvmpvg as per Dietmar's post above containing the disks that you want the new extents to occupy then retry your lvextend.

It may be version/patch related but on my test system with /etc/lvmpvg removed, I get the error:
lvextend: Error detected when reading from file "/etc/lvmpvg".
rather than
lvextend: Not enough free physical extents available

Regards,
John
Hans Hendriks_1
Frequent Advisor

Re: lvextend error

Yes it is true that I got the error: lvextend: Error detected when reading from file "/etc/lvmpvg".

But I thought that was not the problem so I made that file with the rights it needed and then I got the message no free extends.
John Palmer
Honored Contributor

Re: lvextend error

lvextend requires the disk names to be in /etc/lvmpvg in order to extend a PVG-strict volume.

/etc/lvmpvg must have existed when the volume was initially created, possibly on another server if the disks are shared.

Having an empty /etc/lvmpvg stops the 'error reading' from message but as there are are no disk entries, you get the 'not enough extents' error.

Regards,
John
SM_3
Super Advisor

Re: lvextend error

John what do you mean by disk names needing to be in order in /etc/lvmpvg?
John Palmer
Honored Contributor

Re: lvextend error

I didn't say that the disk names needed to be in order in /etc/lvmpvg, even though lvextend does allocate extents in the order specified.

I said (or thought I did) that they had to be in the file - it looked as though Hans had simply created an empty lvmpvg.

Regards,
John
Hans Hendriks_1
Frequent Advisor

Re: lvextend error

You are true. I have made a empty file. But if I look all of my HP (6 pieces) machines I can not find on one of the systems the /etc/lvmpvg file. And when I make an new filesystem on the same volume and after that I extend it I nog get the message it works properly.
John Palmer
Honored Contributor

Re: lvextend error

But this particular filesystem has been created asd PVG-strict i.e. -D y -s g (see man lvextend)

This means that /etc/lvmpvg must have existed when the LV was originally created and must exist for you to lvextend it. You just need to edit it as per Dietmar's post...

VG /dev/fnvg
PVG PVG0
/dev/dsk/c9t0d0
/dev/dsk/c9t8d0
/dev/dsk/c9t8d2
/dev/dsk/c12t0d0
/dev/dsk/c12t8d0

Regards,
John
Hans Hendriks_1
Frequent Advisor

Re: lvextend error

Thanks a lot the latest suggestion works. This forem is great. Thanks again Bart.