Problem
I need to increase the swap size, what are the swap limits?
Solution
The swap size at ISL time was limited to 2GB until UnixWare 7.1.4.
If you want to add more swap, you will need to edit
/etc/swaptaband add up to 256 entries in this file.
A line in the file is defined as:
Device_name start_offset sizeDevice_name can be either a block device or standard file.
The Device_name must be specified by a full pathname.
size (in 512-bytes blocks) can be up to 2GB maximum.
If the Device_name is a block device, you can use a "-" meaning that
the entire size of the Device_name will be used. Note that in this
case the size of the block device cannot exceed 2GB.If you have specified a standard file as a swap file, you will need to create an empty file with at least the size of blocks specified in /etc/swaptab (If size was "-", make sure that the file will be created with less than 2GB size).
Use the following commands (as superuser) to create the empty file:
ulimit unlimited
dd if=/dev/null of=<<File_name>> bs=1024k oseek=<<size in MB>
swap -cThe modification made on /etc/swaptab will only be used after the
reboot of the system. If you want to you the new added swap, use the
following command:swap -a <<File_name>> [ [swaplow] swaplen]WORKED EXAMPLE:I wish to create a file to add a maximum 1GB of swap to my server:
1. Establish how much swap is in use first:a) Run "swap -l" or Skunkware "top" to determine the amount of free swap there currently is, eg.
From "swap -l":path dev swaplo blocks free
/dev/swap 7679,2 0 2104512 2104512This is in 512 blocks (ie. 2104512*0.512 / 1024) ie. 1052Mb approx.
From top:Memory: 512M phys, 512M used, 1028M swapFreeb) To add, say, a file to potentially provide a 1GB of swap:
# dfspace/ : Disk space: 4160.12 MB of 6408.74 MB available (64.91%)# mkdir /localUse dd to create a null packed file to be used for swap:
# dd if=/dev/null of=/local/swap bs=1024 oseek=1000000
0+0 records in
0+0 records outNOTE: For OpenServer6, use /u95/bin/dd to create a null packed file:
# /u95/bin/dd if=/dev/null of=/local/swap bs=1024 oseek=1000000
0+0 records in
0+0 records out# l /local/swap
-rw------- 1 root sys 1024000000 Jan 25 17:03 /local/swap# dfspace/ : Disk space: 4160.12 MB of 6408.74 MB available (64.91%)ie. the file will not consume disk space unless swap is used.
c) Add the swap:# swap -c
# swap -a /local/swap
# swap -lpath dev swaplo blocks free
/dev/swap 7679,2 0 2104512 2104512
/local/swap 7679,1 0 2000000 2000000From top:Memory: 512M phys, 512M used, 2004M swapFreed) To make it permanent for after a reboot:
Change /etc/swaptab from:#swapname offset(in blocks) size(in blocks)
/dev/swap 0 -to:#swapname offset(in blocks) size(in blocks)
/dev/swap 0 -
/local/swap 0 -Then re-boot. See also
swap(1M) and swaptab(4) manpageshttp://uw714doc.xinuos.com/en/FEATS/features_714.html#713up3_4gbswap