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
Become superuser.
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.
Edit the /etc/vfstab file and delete the entry for the swap file.
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.
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.
Become superuser.
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.
If the swap area is not is use, remove the swap area.
# swap -d /dev/zvol/dsk/rpool/swap
Edit the /etc/vfstab file and delete the entry for the swap volume.
Verify that the swap volume is no longer available.
# swap -l
If you have unneeded swap space, you can remove it.
How to Remove Unneeded Swap Space in UFS Root Environment
Become superuser.
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.
Edit the /etc/vfstab file and delete the entry for the swap file.
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.
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.
Become superuser.
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.
If the swap area is not is use, remove the swap area.
# swap -d /dev/zvol/dsk/rpool/swap
Edit the /etc/vfstab file and delete the entry for the swap volume.
Verify that the swap volume is no longer available.
# swap -l
No comments:
Post a Comment
Note: only a member of this blog may post a comment.