Simple Method for deleting Swap space

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.