Swap space can be a dedicated Swap partition recommended method), Swap files, or a combination of the two. The total size of Swap space should be equivalent to two times of your computer's memory and one larger value of 32 MB, but it cannot exceed 2048 MB2 GB ).
Hard drive cannot be mounted in the used partition, and swap partition cannot be enabled ). The easiest way to achieve this is to guide your system in rescue mode.
If the drive does not contain any used partitions, You can detach these partitions and use the swapoff command to close all Swap spaces on the hard drive.
At the shell prompt, enter the following command as the root user to confirm that Swap space has been disabled. Here/dev/hdb2 is a Swap partition.): swapoff/dev/hdb2
Delete the project from the/etc/fstab file.
Use parted or fdisk to delete partitions. Only parted is described here. To use parted to delete a partition:
Run the command parted/dev/hdb as the root user at the shell prompt. Here/dev/hdb is the name of your device with a Swap space hard drive.
At the (parted) prompt, type print to view the existing partition and determine the secondary number of the SWAp partition you want to delete.
At the (parted) prompt, type rm MINOR. Here, MINOR is the secondary number of the partition you want to delete.
Warning the change will happen immediately. You must enter the correct secondary number.
Type quit to exit parted.
To delete the swap file:
Run the following command as the root user to disable/swapfile in the shell prompt: swapoff/swapfile
Delete the project from/etc/fstab. Delete the actual file: rm/swapfile. In this way, we have completed the delete Swap space operation.