How to move Swap space

Source: Internet
Author: User

Swap space in Linux is used when physical memory RAM is full. If the system requires more memory resources and the physical memory is full, the inactive pages in the memory will be moved to the Swap space.

Although Swap space can help machines with a small amount of memory, this method should not be replaced by memory. Swap space is located on the hard drive, which is slower than entering the physical memory.

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 ).

To move the Swap space from one place to another, first follow the instructions for deleting the Swap space and then add the Swap space.

After you install Red Hat Linux, you may want to view existing partition tables, change the partition size, delete partitions, or add partitions from idle space or attached hard drive.

The parted tool allows you to execute these tasks. This chapter describes how to use the parted command to execute file system tasks. In addition, you can also use fdisk to execute most of these tasks in addition to re-partitioning ). For more information about fdisk, read the manual man or info ).

You must install the parted package to use the parted tool. To start parted, enter the command parted/dev/hdb as the root user at the shell prompt.

Here/dev/hdb is the name of the device you want to configure. You will see a (parted) prompt. Type help to view the list of available commands.

If you want to create, delete, or re-partition a partition, the device where the partition is located cannot be used, cannot be mounted, and Swap space cannot be enabled ). The simplest way to achieve this is to guide the system in the rescue mode.

If the drive does not contain any partitions in use, you can use the umount command to detach the partition and use the swapoff command to close the Swap space on the hard drive.

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.