Linux Increases swap Space

Source: Internet
Author: User

Introduction:
Sometimes we encounter problems when installing the OS when the swap partition is too small, causing some big software to fail to install. We can increase the space of the swap partition under Linux.

The following actions are performed under the root user:

0, record the original swap partition size, with FREE-M view

1, first set up a partition, using the DD command such as

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

Description: This creates a/home/swap partition file. The size of the file is 512,000 blocks, normally 1 blocks are 1 K, so the space here is 512M.

2. Then turn this partition into a swap partition.

/sbin/mkswap/home/swap

3. Then use this swap partition. Make it a valid state.

/sbin/swapon/home/swap

4, modify the/etc/fstab file, change the new swap partition to auto start, add the following line
Vi/etc/fstab

/home/swap swap swap defaults 0 0

5. Use free-m to see if swap is increasing

Linux Increases swap Space

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.