Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increase swap space

Status
Not open for further replies.

kouchpotato

Programmer
Nov 2, 2001
38
0
0
GB
How can I increase the size of my swap space. Also would anyone have any recommendations regarding size ratios: we are currently using 3/1 but have increased memory to 2G. We run Oracle 8.1.7

Any pointers most welcome..

thanks
 
Use swap -a swapfile (where swapfile can be a slice or a regular file - see the man page). As far as I'm aware it's recommended that swap be twice the size of conventional memory, but I seem to recall something about this now being rather an outmoded rule of thumb due to technological changes. Perhaps someone else could advise on this aspect? Cheers.
 
I would recommend not using filesystem swap. I would recommend increasing the slice you are currently using for swap or adding a second disk and defining a swap slice the exact same size. The latter will give you greater performance. Severial things need to be known beforehand. Not knowing your knlowdge level I will list a few. How much free space do you have (if forced to use filesystem), Do you have any free space with which to create another partition on the same disk, do you have a second disk or can you add a disk with which you can create swap space?
 
we have the swap partition on the root disk

/dev/dsk/c0t0d0s0 3445684 1990086 1111030 65% /

could we create another partition on this disk (considering it is the root disk)??

 
What type of system are we working on?
Give me the output from this command. Be carefull you can redefine the root drive here.

as root
#format
choose 0 c0t0d0 (this should be the first choice)

format> partition
partition> print

(it will print the partition table at this point
this is the information I need)

partition> quit
format> quit
#

also give me the output from
#mount -p
 
using Sun Solaris 2.6

output of format is:

partition> p
Current partition table (original):
Total disk cylinders available: 7506 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 7505 16.86GB (7506/0/0) 35368272
1 unassigned wu 0 0 (0/0/0) 0
2 backup wu 0 - 7505 16.86GB (7506/0/0) 35368272
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

thx for the help
 
Wow I do not see a swap partition on your root disk. It must be that swap is on another disk. Please send the output from #mount -p
#swap -s
#swap -l
 
It would help if I was on the right server!! :(

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 3393 3.50GB (3394/0/0) 7331040
1 swap wu 3394 - 3879 512.58MB (486/0/0) 1049760
2 backup wm 0 - 3879 4.00GB (3880/0/0) 8380800
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

swap - s
total: 21776k bytes allocated + 11872k reserved = 33648k used, 2208376k available

# mount -p
/dev/dsk/c0t0d0s0 - / ufs - no rw,suid,largefiles
/proc - /proc proc - no rw,suid
fd - /dev/fd fd - no rw,suid
/dev/dsk/c2t2d0s2 - /user01 ufs - no suid,rw,largefiles
/dev/dsk/c2t3d0s2 - /user02 ufs - no suid,rw,largefiles
/dev/dsk/c2t8d0s2 - /user03 ufs - no suid,rw,largefiles
/dev/dsk/c2t0d0s0 - /user04 ufs - no suid,rw,largefiles
/dev/dsk/c2t1d0s2 - /user05 ufs - no suid,rw,largefiles
/dev/dsk/c2t4d0s2 - /user06 ufs - no suid,rw,largefiles
/dev/dsk/c2t5d0s2 - /user07 ufs - no suid,rw,largefiles
/dev/dsk/c2t9d0s2 - /user08 ufs - no suid,rw,largefiles
/dev/dsk/c2t13d0s0 - /user09 ufs - no suid,rw,largefiles
/dev/dsk/c0t1d0s0 - /ur01 ufs - no suid,rw,largefiles
/dev/dsk/c2t12d0s0 - /ur02 ufs - no suid,rw,largefiles
/dev/dsk/c2t11d0s0 - /ur03 ufs - no suid,rw,largefiles
/dev/dsk/c2t10d0s0 - /ur04 ufs - no suid,rw,largefiles
/vol/dev/dsk/c0t6d0/oracle8i - /cdrom/oracle8i hsfs - no ro,nosuid

# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,1 16 1049744 1012512

cheers
 
You may be stuck using filesystem swap. on the root drive slice 2 (free hog) tells you the size of the disk. what you need to do to determine if you can add raw swap is to see if you have 512MB of free space on one of the other disks. I am assumong that you are not running any kind of RAID on these disks.
You can do this one of two ways
1) run format on each of the disks, not slices, (as described eairler) and look for free space.

2) or run "prtvtoc -f /dev/rdsk/c?t?d0s0"
devide the FREE_SIZE= by 2 and this will give you an estimate of free space on the disk for partations.

Try this script it may help

#!/bin/ksh
for i in `mount -p | grep ufs | awk '{print $1}'`
do
FREE_SPACE=$(prtvtoc -f $i | awk '{print $2}' | awk -F= '{print $2}')
let FREE_SPACE=FREE_SPACE/2
echo "$i has $FREE_SPACE available"
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top