1834789 Members
2579 Online
110070 Solutions
New Discussion

Swap Help

 
SOLVED
Go to solution
Steven Chen_1
Super Advisor

Swap Help

Hello,

I have a new server with 4G swap on /vg00/lvol2. Two internal disks are going to be mirrored. I'd like to make the swap space upto 6G, but sam gives me error like these:

------------------------------
The command used to extend logical volumes, /sbin/lvextend, has
failed. The stderr output from the command is shown below. The
logical volume has not been extended.


lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol2" could not be extended.
Failure possibly caused by contiguous allocation policy.
---------------------------

As noted, there is no advantage to add 2nd swap on the same disk. But how to add up the size of the primary swap?

Help will be greatly appreciated.

Steven
Steve
5 REPLIES 5
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Swap Help

Unfortunetly you can not increase primary swap. You can create a secondary swap if you have physical disk space is available. It seems that you don't have free extentes to increase your logical volume.

Check with vgdisplay -v /dev/vg00 and see if there are any free pe's available. Or best way is if you have spare disk try to create secondary swap on that disk.

Goodluck,
-USA..
Good Luck..
Olivier ROBERT
Frequent Advisor

Re: Swap Help

Hi Steven,

You could not extend your swap space probably because of the contiguous allocation policy enforced on /dev/vg00/lvol2. This policy forbids the logical volume to be "fragmented" on the disk. lvol2 is probably "surrounded" by other logical volumes.
One (discouraged) solution would be to remove the contiguous allocation policy on the logical volume. The command is "lvchange -C n /dev/vg00/lvol2", but it's a bad idea, since it would have very bad performance issues.
Another solution is to create one additional 6GB swap volume on the same disk (with a contiguous allocation policy), designate it as the primary swap, and then remove the previous one. That will require a reboot. And don't forget to change the dump device to your new swap space (crashconf -r /dev/vg00/new_lvol) as you will probably remove your former swap volume, which is probably configured as the kernel crash dump device.
Regards,

Olivier
S.K. Chan
Honored Contributor

Re: Swap Help

Others have explained what the errors mean. My recommendation is leave the 4GB primary swap alone. Proceed with vg00 mirroring process. When you're done, add 2ndary swap, do not use vg00, use other VG (eg: vg01), (2GB then since you wanted 2GB), the "nice" thing is if you can, setup your 2ndary swap to be the same size as primary swap (same priority) so that swap interleave is enabled. BTW why do you need so much swap .. just keep in mind the memory swap ratio rule does not apply anymore nowadays.
Thomas M. Williams_1
Frequent Advisor

Re: Swap Help

I hope this helps. The text may a little sketchy b/c I pasted it.

#!/bin/ksh

# Defaults

PS3="Please select desired printer: "
fulllist="`cd /etc/lp/interface;ls`"

all_printers ()
{
# This is where your current syntax goes.
# Ex: hpnpadmin ${fulllist} If you can send all devices into the command ?

}

single_printer ()
{
select prtname in ALL Quit ${fulllist}
do
[ "${prtname}" = "Quit" ] && exit 0

if test -n "${prtname}"
then
if test "${prtname}" = "ALL"
then
prtlist="${fulllist}"
else
prtlist="${prtname}"
fi

break
fi
done

# Put the syntax for running the hpnpadmin
# Ex: hpnpadmin ${prtlist}
}

# Main

if test ${#} -ne 0
then
while getopts :s option
do
case ${option} in
s) select_on="Y" ;;
?) echo "Usage: ${0} [<-s>] (-s turns select option on)."
exit 4 ;;
esac
done
fi

[ "${select_on}" = 'N' ] && all_printers || select_printer

exit 0

I Think the Clock is Slow ...
Olivier ROBERT
Frequent Advisor

Re: Swap Help

Hi Thomas,

That's a funny answer to our SWAP problem... :o)