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