unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



swapon(8)							    swapon(8)



NAME

  swapon - Specifies additional	disk partitions	for paging and swapping

SYNOPSIS

  /sbin/swapon [-a  | -s] [-v]

  /sbin/swapon [-v] special-device

OPTIONS

  -a  Installs all paging partitions specified in the /etc/sysconfigtab	file.

  -s  Displays swap space utilization.	For each swap partition, this option
      displays the total amount	of allocated swap space, the amount of swap
      space that is being used,	and the	amount of free swap space.

  -v  Generates	verbose	output.

OPERANDS

  special-device
      Specifies	the device special file	name.

DESCRIPTION

  The swapon command is	used to	specify	additional disk	partitions for paging
  and swapping.	A paging partition is a	block special device. (	Tru64 UNIX
  does not currently support paging and	swapping to a regular file.  All pag-
  ing and swapping areas must be block special devices.) The swapon command
  uses a priority default of 4 for block special devices. Calls	to swapon
  normally occur in the	system multiuser state initialization.

  When you make	more swap space	available with the swapon command, the addi-
  tional swap space is available until the system is rebooted.	To make	addi-
  tional swap space permanent, you must	specify	the swap device	entry in the
  /etc/sysconfigtab file.

  The swapon command options can override the partition	specifications in the
  /etc/sysconfigtab file. You must have	the mount command authorization	to
  run this command.  System administrators and operators (users	with the
  sysadmin and operator	command	authorizations,	respectively) usually hold
  this command authorization.

  You can use Logical Storage Manager (LSM) volumes for	additional swap
  space.  For high system availability,	you can	mirror the LSM volumes.	The
  Logical Storage Manager manual describes how to use the swapon command to
  configure an LSM mirrored volume as additional swap space.

  There	are two	strategies for swap space allocation: immediate	mode and
  deferred or over-commitment mode.  The two strategies	differ in the point
  in time at which swap	space is allocated.  If	immediate mode is used,	swap
  space	is allocated when modifiable virtual address space is created.	If
  deferred mode	is used, swap space is not allocated until the system needs
  to write a modified virtual page to swap space.  Immediate mode is the
  default swap space allocation	strategy.


  Immediate mode is more conservative than deferred mode because each modifi-
  able virtual page is assigned	a page of swap space when it is	created.  If
  you use the immediate	mode of	swap space allocation, you must	allocate a
  swap space that is at	least as large as the total amount of modifiable vir-
  tual address space that will be created on your system.  Immediate mode
  requires significantly more swap space than deferred mode because it
  guarantees that there	will be	enough swap space if every modifiable virtual
  page is modified.

  If you use the deferred mode of swap space allocation, you must estimate
  the total amount of virtual address space that will be both created and
  modified, and	compare	that total amount with the size	of your	system's phy-
  sical	memory.	 If this total amount is greater than the size of physical
  memory, the swap space must be large enough to hold the modified virtual
  pages	that do	not fit	into your physical memory. If your system's workload
  is complex and you are unable	to estimate the	appropriate amount of swap
  space	by using this mode, you	should first use the default amount of swap
  space	and adjust the swap space as needed.

  To determine which swap space	allocation mode	is being used, check the set-
  ting of the vm-swap-eager parameter in /etc/sysconfigtab.  If	it is either
  not specified	or set to 1, the system	uses immediate swap mode.  If it is
  set to 0 (zero), the system uses deferred mode.

NOTES

  There	is no way to stop paging and swapping on a partition.  It is there-
  fore not possible to use swap	devices	that can be dismounted during system
  operation.

  Swap space is	also used during a system crash	dump.  In planning your	swap
  space	allocation you should also consider your crash dump requirements.
  See the System Administration	for information	on crash dumps.

ERRORS

    +  special-device or an overlapping	partition is open. Quitting...

       Explanation:

       This message indicates that you tried to	add a partition	as a swap
       device that is actively in use by UFS, AdvFS, swap, or LSM.

       User Action:

       Specify a different swap	device.

    +  special-device is marked	in use for fstype in the disklabel.  If	you
       continue	with the operation you can possibly destroy existing data.
       CONTINUE? [y/n]

       Explanation:

       This message indicates that you tried to	use a partition	as a swap
       device that is not currently in active use but is marked	for use	in
       the disk	label's	partition map.	For example, the partition may be
       part of an LSM volume or	an AdvFS domain.

       User Action:

       Specify a different swap	device or override the warning.

       If you know that	the partition you specified to swapon does not con-
       tain any	data, you can choose to	override the warning. In this case,
       the fstype in the disk label will be modified to	swap.

       Note that you can use the disklabel -s command to set the fstype	in
       the disk	label to unused	for partitions that do not contain any valid
       data. See disklabel(8) for more information.

    +  Partition(s) which overlap special-device are marked in use If you
       continue	with the operation you can possibly destroy existing data.
       CONTINUE? [y/n]

       Explanation:

       This message indicates that the partition you specified is not marked
       for use,	but other, overlapping partitions on the disk are marked for
       use.

       User Action:

       Specify a different swap	device or override the warning.

       If you override this warning, the fstype	in the disk's label will be
       modified.  The partition	you specified to swapon	will be	marked as in
       use as a	swap device and	all overlapping	partitions will	be marked
       UNUSED.

EXAMPLES

   1.  The following example shows a swap device entry in an
       /etc/sysconfigtab file:


	    vm:
		swapdevice=/dev/disk/dsk0b,/dev/disk/dsk1b

   2.  The following example adds the /dev/disk/dsk0b block device file	as
       swap space:
	    # swapon /dev/disk/dsk0b

   3.  The following example tries to add a partition that is marked for use
       as a swap device:
	    # /usr/sbin/swapon /dev/disk/dsk11g

	    /dev/disk/dsk11g disk is marked in use for LSMpubl in the
	    disklabel.
	    If you continue with the operation you can possibly	destroy
	    existing data.
	    CONTINUE? [y/n]

       Partition g of disk dsk11 is part of a disk marked for use by LSM. If
       LSM is not actively using this partition	and the	partition does not
       contain any data, you may want to override this warning,	by answering
       y.  In this case, partition g will be marked as swap in the disk
       label.

   4.  The following example tries to add a partition as a swap	device whose
       overlapping partitions are marked for use:
	    # /usr/sbin/swapon /dev/disk/dsk11c

	    Partition(s) which overlap /dev/disk/dsk11c	are marked in use.
	    If you continue with the operation you can possibly	destroy
	    existing data.
	    CONTINUE? [y/n]

       If you answer yes, partition c on disk dsk11 will be marked swap	in
       the disk	label and all partitions that overlap c	will be	marked
       UNUSED.

   5.  The following example tries to add a partition that is currently	in
       use as a	swap device:
	    # /usr/sbin/swapon /dev/disk/dsk11g

	    /dev/disk/dsk11g or	an overlapping partition is open.
	    Quitting...

   6.  The following example tries to add a partition that does	not have a
       disk label as a swap device:
	    # /usr/sbin/swapon /dev/disk/dsk11c

	    The	disklabel for /dev/disk/dsk11c does not	exist or is
	    corrupted.
	    Quitting...

       See disklabel(8)	for information	on installing a	disk label on a	disk.

FILES

  /sbin/swapon
      Specifies	the command path.

  /etc/sysconfigtab
      Specifies	information about file systems and swap	devices.

SEE ALSO

  Commands: savecore(8)

  Functions: swapon(2)

  System Administration