cancel
Showing results for 
Search instead for 
Did you mean: 

Problem lvextend (swap)

SOLVED
Go to solution
Eli Daniel
Super Advisor

Problem lvextend (swap)

Hi,
i have the problem apply command lvextend in the memory swap.

SAPL910:/> lvextend -L 32768 /dev/vg00/lvol2
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol2" could not be extended.
Failure possibly caused by contiguous allocation policy.
Failure possibly caused by strict allocation policy
9 REPLIES
Patrick Wallek
Honored Contributor

Re: Problem lvextend (swap)

You cannot just extend your primary swap (vg00/lvol2). It is configured to be contiguous, so just extending it does not work.

If you need more swap space, you should just create another LV and activate it as swap.
James R. Ferguson
Acclaimed Contributor

Re: Problem lvextend (swap)

Hi:

The absence of contiguous physical extents following the current end of 'lvol2' gives you the failure for contiguous allocation.

As Patrick noted, simply create one or more secondary swap devices. There are a multitude of threads in this forum describing this process.

As a matter of interest, this thread discussed how you *might* extend 'lvol2' *if* you were h*ll-bent on doing it:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1025780

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: Problem lvextend (swap)

The LV used for swap must be contiguous, so you cannot extend it like other LVOLs.
First option would be to create another swap area, second option is to backup/restore with ignite and adjust the LVOL size during restore.

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!   
Eli Daniel
Super Advisor

Re: Problem lvextend (swap)

Hi patrick
how to assing the new LV to swap memory?

Patrick Wallek
Honored Contributor

Re: Problem lvextend (swap)

Use the 'swapon' command. 'man swapon' for details.

You will also need to add the new swap LV to your /etc/fstab so it will be used automatically when the server reboots.

If your swap LV is /dev/vg00/lvol11 then the line in /etc/fstab would be:

/dev/vg00/lvol11 ... swap pri=0 0 0

To activate it with the 'swapon' command:

swapon -p 0 /dev/vg00/lvol11

James R. Ferguson
Acclaimed Contributor

Re: Problem lvextend (swap)

Hi:

I trust that you created the logical volume along the lines of:

# lvcreate -C y -r n -L 32768 -n lvolN /dev/vgXX

...and then issued:

# swapon -p /dev/vgXX/lvolN

...and remembered to update your '/etc/fstab' with an entry like:

/dev/vgXX/lvolN ... swap pri=0 0 0

...so that after the next reboot you have your secondary swap activated.

Regards!

...JRF...
Eli Daniel
Super Advisor

Re: Problem lvextend (swap)

Hi,
created the new LV and run command

lvcreate -C y -r n -L 25600 -n lvol20 /dev/vg00

swapon -p /dev/vg00/lvol20

In the fstab:
/dev/vg00/lvol20 swap pri=0 0 0

but reboot the server not show new LV

SAPL910_RX6600:/> swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
reserve - 388548 -388548
memory 15927572 1939376 13988196 12%


Patrick Wallek
Honored Contributor
Solution

Re: Problem lvextend (swap)

Go back and look at my and JRFs example for the /etc/fstab line. It appears that you omitted the '...' after the LV name. That needs to be there.

If you look in /etc/rc.log you will probably see an error for that LV.
Eli Daniel
Super Advisor

Re: Problem lvextend (swap)

Thanks Patrick, problem solved