How to increase the swap capacity of Linux system

Source: Internet
Author: User

When installing the Linux system, the initial set of swap space is not enough to be used in the actual use, need to increase the swap space;

All the following operations require root user privileges;


To increase the swap capacity step:

1. Create a partition using the DD command

DD If=/dev/zero Of=/home/swap bs=1024 count=10240000

A partition file is created/home/swap. File size is 10.24 million block,bs for 1 blocks of size 1k, here to create 10G size swap;


# Ll/home/swap

-rw-r--r--1 root root 10485760000 April 15:29/home/swap


2, the creation of the file into a swap partition,-f parameter enforcement;

/sbin/mkswap-f/home/swap


3. Make the Swap partition valid

/sbin/swapon/home/swap


FREE-M View swap space has increased 10G space, this setting machine restart after the failure, want to be permanent, need to join the Fstab file;


4, Vim/etc/fstab Add a row, save exit, restart also effective; Remember that you cannot delete the/home/swap file, the newly added swap space will not exist after deletion;

/home/swap swap swap defaults 0 0




This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1916092

How to increase the swap capacity of Linux system

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.