|Skip Navigation Links|
|Exit Print View|
|System Administration Guide: Devices and File Systems Oracle Solaris 10 8/11 Information Library|
# /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.
# 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.
# 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
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.
# 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.
# swap -d /dev/zvol/dsk/rpool/swap
# swap -l