JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

About This Book

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

12.  SPARC: Setting Up Disks (Tasks)

13.  x86: Setting Up Disks (Tasks)

14.  Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating and Mounting File Systems (Tasks)

18.  Using The CacheFS File System (Tasks)

19.  Configuring Additional Swap Space (Tasks)

About Swap Space

Swap Space and Virtual Memory

Swap Space and the TMPFS File System

Swap Space as a Dump Device

Swap Space and Dynamic Reconfiguration

Configuring Swap Space in a SAN Environment

How Do I Know If I Need More Swap Space?

Swap-Related Error Messages

TMPFS-Related Error Messages

How Swap Space Is Allocated

Swap Areas and the /etc/vfstab File

Planning for Swap Space

Allocating Swap Space for UFS-Based Systems

Allocating Swap Space for ZFS-Based Systems

Monitoring Swap Resources

Adding More Swap Space

Creating a Swap File in a UFS Root Environment

mkfile Command

How to Create a Swap File and Make It Available in UFS Root Environment

Adding or Changing Swap Space in an Oracle Solaris ZFS Root Environment

How to Add Swap Space in an Oracle Solaris ZFS Root Environment

Removing a Swap File From Use

How to Remove Unneeded Swap Space in UFS Root Environment

How to Remove a Swap Volume in a ZFS Root Environment

20.  Checking UFS File System Consistency (Tasks)

21.  UFS File System (Reference)

22.  Backing Up and Restoring UFS File Systems (Overview)

23.  Backing Up UFS Files and File Systems (Tasks)

24.  Using UFS Snapshots (Tasks)

25.  Restoring UFS Files and File Systems (Tasks)

26.  UFS Backup and Restore Commands (Reference)

27.  Copying Files and File Systems (Tasks)

28.  Managing Tape Drives (Tasks)

Index

Removing a Swap File From Use

If you have unneeded swap space, you can remove it.

How to Remove Unneeded Swap Space in UFS Root Environment

  1. Become superuser.
  2. Remove the swap space in a UFS root environment.
    # /usr/sbin/swap -d /path/filename

    The swap file name is removed so that it is no longer available for swapping. The file itself is not deleted.

  3. Edit the /etc/vfstab file and delete the entry for the swap file.
  4. Recover the disk space so that you can use it for something else.
    # rm /path/filename

    If the swap space is a file, remove it. Or, if the swap space is on a separate slice and you are sure you will not need it again, make a new file system and mount the file system.

    For information on mounting a file system, see Mounting and Unmounting Oracle Solaris File Systems.

  5. Verify that the swap file is no longer available.
    # swap -l

Example 19-2 Removing Unneeded Swap Space

The following examples shows how to delete the /files/swapfile swap file.

# swap -d /files/swapfile
# (Remove the swap entry from the /etc/vfstab file)
# rm /files/swapfile
# swap -l
swapfile             dev  swaplo  blocks   free
/dev/dsk/c0t0d0s1   136,1      16 1638608 1600528

How to Remove a Swap Volume in a ZFS Root Environment

Most systems require some amount of swap space configured. If your system's swap space requirements change, then you might need to remove a swap volume before you can increase or decrease space allocated for swap. On a busy system, it might be easier to create a second swap volume if you need to increase swap space rather than trying to remove a swap volume that is busy just to increase its size.

  1. Become superuser.
  2. If the swap volume is in use, then you might not be able to delete it. Check to see if the swap area is in use.
    # swap -l
    swapfile             dev    swaplo   blocks     free
    /dev/zvol/dsk/rpool/swap 102,2        16 16646128 16646128

    In the above output, blocks == free, so the swap device is not actually being used.

  3. If the swap area is not is use, remove the swap area.
    # swap -d /dev/zvol/dsk/rpool/swap
  4. Edit the /etc/vfstab file and delete the entry for the swap volume.
  5. Verify that the swap volume is no longer available.
    # swap -l