Consultor Eletrônico



Kbase 16220: Swap space on Digital UNIX or OSF/1
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Swap space on Digital UNIX or OSF/1


Digital UNIX does not support swapping to a regular file, as is true
on some flavors of UNIX.

How to determine what is in use:

1> Look at /etc/fstab to see where the system is configured to swap
to.

Sample output:

/dev/rz0a / ufs rw 1 1
/proc /proc procfs rw 0 0
/dev/rz0g /usr ufs rw 1 2
/dev/rz3c /usr1 ufs rw 1 2
/dev/rz1c /usr2 ufs rw 1 2
/dev/rz0b swap1 ufs sw 0 2
/dev/rz2c /usr3 ufs rw 1 2
/dev/rz12e swap2 ufs sw 0 2
/dev/rz13e swap3 ufs sw 0 2
stripedisk1#bigusr /big advfs rq,userquota,groupquota

This output shows that we are swapping to the b partition on /dev/rz0,
and the e partitions on /dev/rz12 and /dev/rz13.

To see how big these are, do a disklabel of each raw device's a
partition:

disklabel /dev/rrz0a
# /dev/rrz0a:
# /dev/rrz0a:
type: SCSI
disk: rz28
label:
flags:
bytes/sector: 512
[...]

8 partitions:
# size offset fstype [fsize bsize cpg]
a: 131072 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 82*)
b: 327647 131072 unused 1024 8192 # (Cyl. 82*- 289*)
c: 4110480 0 unused 1024 8192 # (Cyl. 0 - 2594)
d: 327647 131072 unused 1024 8192 # (Cyl. 82*- 289*)
e: 327647 131072 unused 1024 8192 # (Cyl. 82*- 289*)
f: 327647 131072 unused 1024 8192 # (Cyl. 82*- 289*)
g: 3651761 458719 4.2BSD 1024 8192 16 # (Cyl. 289*- 2594*)
h: 327647 131072 unused 1024 8192 # (Cyl. 82*- 289*)

The b partition is 327647 sectors (i.e., blocks), or about 150 MB.


2> Determine what swapping method the system is using. If the file
/sbin/swapdefault exists, the swapper is in "immediate mode". This
means that a page of swap space is reserved for every modifiable page
created in a process' virtual address space. If the swap space is not
there, the page does not get created. Deferred swap space, on the
other hand, is more like the way VMS does it. Swap space is only
allocated to a process when it needs to be paged or swapped out.

how to determine which is in use. From the swapon(8) man page:

To determine which swap space allocation mode is being used, check for
the existence of a soft link named /sbin/swapdefault, which points to
the primary swap partition. If the /sbin/swapdefault file exists, the
system uses the immediate mode for swap space allocation. To enable
the deferred mode, rename or delete this soft link.

If the /sbin/swapdefault file does not exist and you want to use the
immediate mode of swap space allocation, become superuser and create
the file by using the following command syntax:

ln -s /dev/rzxy /sbin/swapdefault

The x variable specifies the device number for the device that holds
the primary swap partition, and the y variable specifies the swap
partition.


9-Oct-96

Progress Software Technical Support Note # 16220