Solution to insufficient swap space on rhel5

Source: Internet
Author: User
1. solve the problem by partitioning. 2. solve the problem by using the file method. if the hard disk partition is insufficient, you can consider using the file method. the specific method is to create a file with a certain capacity, then run the mkswap and swapon commands to mount the file and add it to the swap. the specific operations are as follows: cd/ddif /...

 

1. solve the problem by partitioning
2. solutions using files

If the hard disk partition is insufficient, you can use the file method. the specific method is
Create a file of a certain capacity, and then use the mkswap and swapon commands to mount the file and add
Swap:
Cd/
Dd if =/dev/zero of =/swapfile bs = 1 M count = 1024 # Create a 1g File
Mkswap swapfile # set the file type to swap
Swapon swapfile # use swap for mounting. it is only attached to the memory. if you want to start the system, modify/etc/fstab.

Free # view the swap space changes. The swap increases by 1 GB.
Swapon-s # View which partitions and files are used by swap, and the priority can be viewed. a larger number indicates the priority.
Higher
 
Modify the/etc/fstab file and insert the following content:
/Swapfile swap defaults 0 0
Restart the system and use free to view the verification.

This article is from the freedom Blog

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.