Add swap partition under centos

Source: Internet
Author: User
Add swap partitions under centos. this method is not limited to centos, linux is applicable to the following commands. you must operate the Java code ddif/dev/zeroof/home/swapbs1024count512000www.2cto.com under the root account to create a partition file such as/home/swap...
Add swap partitions under centos. this method is not limited to centos, linux is applicable to the following commands. you must operate the Java code dd if =/dev/zero of =/home/swap bs = 1024 count = 512000 www.2cto.com under the root account to create/home/ swap is a partition file. The file size is 512000 blocks. generally, 1 block is 1 K, so the space is 512 MB. Then convert the partition into a swap partition. Java code/sbin/mkswap/home/swap then use this swap partition. Make it valid. Java code/sbin/swapon/home/swap now use the free-m command to check the memory and swap partition size, and it is found that the space is increased by MB. However, after the computer is restarted, it is found that swap is still so large, the new swap is not automatically started, and manual start is required. Then we need to modify the/etc/fstab file and add the following line www.2cto.com/home/swap defaults 0 0. then you will find that swap space increases after your machine starts automatically. Although this is a basic command, every query is quite troublesome, so mark
Author mushme
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.