Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

System Administration Guide: Devices and File Systems
Previous Next

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 19, Mounting and Unmounting File Systems (Tasks).

  5. Verify that the swap file is no longer available.
    # swap -l
Example 21-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
Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire