JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems
search filter icon
search icon

Document Information

Preface

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: Adding a Disk (Tasks)

13.  x86: Adding a Disk (Tasks)

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

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)

18.  Mounting and Unmounting File Systems (Tasks)

19.  Using The CacheFS File System (Tasks)

20.  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

21.  Checking UFS File System Consistency (Tasks)

22.  UFS File System (Reference)

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

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

25.  Using UFS Snapshots (Tasks)

26.  Restoring UFS Files and File Systems (Tasks)

27.  UFS Backup and Restore Commands (Reference)

28.  Copying UFS Files and File Systems (Tasks)

29.  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

  1. Become superuser.
  2. Remove the swap space.
    # /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 Chapter 18, Mounting and Unmounting File Systems (Tasks).

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

Example 20-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