1833991 Members
3906 Online
110063 Solutions
New Discussion

Re: maxswapchunks

 
SOLVED
Go to solution
Adrian Basescu
Occasional Advisor

maxswapchunks

Hello,
I need to add more swap space to one of my HP-UX 11 systems and it does not take the second swap.
I have increased maxswapchunks to 9000 and I have one 4GB swap and I need to add a second 4GB swap.
But the system still complains that maxswapchunks is still too low.
Thanks
21 REPLIES 21
A. Clay Stephenson
Acclaimed Contributor

Re: maxswapchunks

Something is strange. If I assume you have not changed swchunk (and you shouldn't) then maxswapchunks=9000 should allow 18GB of swap. I suspect that you have changed the parameter with kmtume or SAM but have not yet built a kernel.
If it ain't broke, I can fix that.
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

I have rebuild the kernel twice, from sam, and rebooted twice.

kmtune -q maxswapchunks

reports 9000, as it should.

kmtune -q swchunk

reports the default 2048
Pete Randall
Outstanding Contributor

Re: maxswapchunks

Adrian,

How big was the parameter before? Did you double it?

"
maxswapchunks xswchunk xDEV_BSIZE

For example, using default values for swchunk (2048) and maxswapchunks
(256), and assuming DEV_BSIZE is 1024 bytes, the total configurable swap
space equals 537 Mbytes. "



Pete

Pete
Massimo Bianchi
Honored Contributor

Re: maxswapchunks

Hi,
set maxswapchunk to 16834 ,
that is the maximum supported.


HTH,
Massimo

Paul Sperry
Honored Contributor

Re: maxswapchunks

maxswapchunks sets the maximum amount of swap space that can be configured, system-wide.

Acceptable Values:
Minimum
1
Maximum
16384
Default
256
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

Hello,
I know all that, initially I only doubled it, but as it did not make a difference, I have doubled it again.
9000 should be enough up to 18GB of swap space.
But it does not work.
Paul Sperry
Honored Contributor

Re: maxswapchunks

Two factors contributed to this problem:


1. The maxswapchunk kernel limit was set too low and needed to be
increased.


The kernel tunable maxswapchunks is used to determine the amount of
swap space that is configurable on the system. Use this formula to
determine the maximum amount of configurable swap space:


Max Swap Space = maxswapchunks * 1024 * swchunk (typically 2048)


If maxswapchunks is 256 (default) then 512Mb of swap space can be
configured.


256 * 1024 * 2048 = 536870912


536870912 / 1024 = 524288 Kb


524288 / 1024 = 512 Mb


Maximum Configurable Swap Space: 512 Mb


Here is a second example of computing the maximum configurable swap
space. In this example maxswapchunks is set to 2005.


2005 * 1024 * 2048 = 4204789760 bytes


4204789760 / 1024 = 4106240 Kbytes


4106240 / 1024 = 4010 Mbytes


4010 / 1024 = 3.916 Gbytes


Maximum Configurable Swap Space: 3.9 Gb


Use the sysdef(1M) command to find out what is configured on the
system. For example:


# sysdef
...
maxswapchunks 512 - 1-16384 -
maxtsiz 16384 - 0-655360 Pages -
maxtsiz_64bit 262144 - 256-1048576 Pages -
maxuprc 75 - 3- -
...
swapmem_on 1 - - -
swchunk 2048 - 2048-16384 kBytes -
...



2. Output from swapinfo(1M) indicated that the device still thought it
had a filesystem on that disk even though it was configured as device
swap in the fstab file.


# swapinfo -tam


Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME


dev 768 51 717 7% 0 - 1 /dev/vg00/lvol2
dev 900 51 849 6% 0 - 1 /dev/vg00/newswap
dev 2080 51 2029 2% 1966080 - 1 /dev/vg00/swapdev2
^
|
|--> normally zero


From the swapinfo(1M) man page:


START/LIMIT For device paging areas, START is the block address on the
mass storage device of the start of the paging area. The
---> value is normally 0 for devices dedicated to paging, or
the end of the file system for devices containing both a
file system and paging space.


For file system paging areas, LIMIT is the maximum number
of 1-Kbyte blocks that will be used for paging, the same
as the limit value given to swapon.


Also, the following message occurred in /etc/rc.log:


/usr/sbin/swapon: Device /dev/vg00/swapdev2 contains a file system.
The system will page in the space after the end of the file system.
Add "end" to the options field in /etc/fstab to turn off this warning.


Perform the following steps to correct this problem:


a. Since this is a device swap, it cannot be unmounted.
Remove the entry from fstab, and reboot the system.


b. Once the system is up, use dd(1) to copy a large file
to that lvol, for example:


# dd if=/stand/vmunix of=/dev/vg00/swapdev2


c. Configure the swap, for example:


# swapon -f /dev/vg00/swapdev2


d. Check swapinfo as above. If everything looks ok then
add the entry back into fstab.


Adrian Basescu
Occasional Advisor

Re: maxswapchunks

Probably you have not read the messages above.

This is the error message:

# swapon /dev/vg01/swap1

swapon: The kernel tunable parameter "maxswapchunks" needs to be increased to ad
dpaging on device /dev/vg01/swap1.
James R. Ferguson
Acclaimed Contributor

Re: maxswapchunks

Hi Adrian:

Perhaps there is (was) a filesystem present. This has been known to yield this error. Try:

# swapon -f /dev/vg01/swap1

Regards!

...JRF...
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

There was NO filesystem and the error makes no reference to any filesystem.
This is a brand new configured disk.
There was someone on this forum with a similar problem, same subject, but the links to the solution (from someone at HP) do not work anymore.
Pete Randall
Outstanding Contributor

Re: maxswapchunks

Could you post the URL of that problem? Maybe we can glean a little more info from that thread.


Pete

Pete
Adrian Basescu
Occasional Advisor
James R. Ferguson
Acclaimed Contributor

Re: maxswapchunks

Hi (again):

Try this, before your 'swapon' command:

# dd if=/dev/zero of=/dev/vg01/swap1 bs=256k count=10

If you are running 11.0 and don't have 'dev/zero', create it thusly first:

# mknod /dev/zero c 3 0x000004

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: maxswapchunks

The last two posts from the author:

First)

I used SAM. Just ran the kmupdate and rebooting the server now. Will post if there are further errors.

Thanks.



Second)

Works now. Thanks!



Did you run kmupdate?


Pete

Pete
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

It gives an error:


>>>dd if=/dev/zero of=/dev/vg01/swap1 bs=256k count=10

I/O error
1+0 records in
0+1 records out

Adrian Basescu
Occasional Advisor

Re: maxswapchunks

I did run kmupdate, but it does not find a new kernel.

kmupdate needs to be run when you did NOT move the new kernel into place and rebooted from SAM. I did this twice.
Steven E. Protter
Exalted Contributor

Re: maxswapchunks

You probably don't need this, but I'm posting the cmplee process for putting a new kernel into production on an HP-UX box.

#

cd /stand/build
/usr/lbin/sysadm/system_prep -v -s system

/usr/sbin/mk_kernel -s /stand/build/system

/usr/sbin/kmupdate


This is a required step that will make the newly configured kernel bootable. kmupdate also saves the currently running kernel under a new name, /stand/vmunix.prev, and schedules the update of the system to use the default name /stand/vmunix for the newly configured kernel.

Restart the system.

shutdown -ry now

From the HP Doc

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/5185-6559/5185-6559_top.html&con=/hpux/onlinedocs/5185-6559/00/00/3-con.html&toc=/hpux/onlinedocs/5185-6559/00/00/3-toc.html&searchterms=make%7cnew%7ckernel%7chp-ux&queryid=20030528-115050

If at any point you get errors as it seems you have, you need to stop and fix them. Post them here if you want.

:-)

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: maxswapchunks

The error from dd is very telling. It looks like there is a problem with your lvol.

Do a vgdisplay -v /dev/vg01 and an lvdisplay -v /dev/vg01/swap1 and an ls -l /dev/vg01
and post the output.

If it ain't broke, I can fix that.
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

# vgdisplay -v /dev/vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 2
Open LV 2
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 8683
VGDA 2
PE Size (Mbytes) 4
Total PE 8681
Alloc PE 7670
Free PE 1011
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/disk1
LV Status available/syncd
LV Size (Mbytes) 30680
Current LE 7670
Allocated PE 7670
Used PV 1

LV Name /dev/vg01/swap1
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0


--- Physical volumes ---
PV Name /dev/dsk/c2t2d0
PV Status available
Total PE 8681
Free PE 1011
Autoswitch On


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



# ls -l /dev/vg01
total 0
brw-r----- 1 root sys 64 0x010001 May 28 10:27 disk1
crw-r--r-- 1 root sys 64 0x010000 May 28 10:26 group
crw-r----- 1 root sys 64 0x010001 May 28 10:27 rdisk1
crw-r----- 1 root sys 64 0x010002 May 28 10:27 rswap1
brw-r----- 1 root sys 64 0x010002 May 28 10:27 swap1
#
Adrian Basescu
Occasional Advisor

Re: maxswapchunks

Thank you, now it works.
Somehow SAM created the new swap of zero size, instead of 4GB. I have increased the size from 0 to 4GB and now the system can use it.
James R. Ferguson
Acclaimed Contributor

Re: maxswapchunks

Hi Adrian:

Well, for starts, the size of '/dev/vg01/lvol1' is *zero* extents. You're not going to allocate much of anything there!

Regards!

...JRF...