Linux Beginner-swap Partition Chapter

Source: Internet
Author: User

Linux Beginner-swap partition Chapter

Swap is a virtual memory that is partitioned in a hard disk, temporarily used as memory when the memory is full but urgently needed, and less efficient than memory. This article will make a brief introduction to the establishment of swap partition in Linux system.

The nature of the swap partition is also a partition, so before the swap partition to make a normal partition, as shown, after the partition is completed do not save exit, enter "T" to change the partition function ID, select the partition to be modified, enter the ID number to change the partition function identification, The partition identification number for DOS partition logging is 82, while GPT is 14. Save exit when finished.

Enter the command "Pratprobe" to re-add the disk information. After the disk format is completed, the disk Format command for the swap partition is "MKSWAP/DEV/VDB2" and the disk is formatted as swap. Enter "Swapon-a/dev/vdb2" to add this swap partition to the swap program. "Swapon-s" to see the swap add information.

If you need to automatically add swap on boot, you need to edit "/etc/fstab" and enter "/DEV/VDB2 swap defaults 0 0".

If you need to delete this swap partition, you need to enter "Swapon-s" to view swap information, as shown in, enter "Swapoff disk Partition" to stop its swap program, and then delete the disk partition.

Swap does not need to be partitioned or can be implemented by file. As shown, first, intercept a 1G file. Then format it as swap, enter "Swapon-a filename" to add swap, and enter "Swapon-s" to view it.

When adding swap, the parameter "-P" can be added to add the swap priority machine, if you need to mount the boot, and the same partition, you need to edit the "/etc/fstab" file, "pri=x" for the priority machine set to X.

File swap does not need to delete the same steps as the partition, and finally delete the file.

Linux Beginner-swap Partition Chapter

Related Article

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.