Linux swap adjustment-Linux Enterprise Application-Linux server application information. The following is a detailed description. Original Author: ba7nq
Some servers need to expand the swap, but the original hard disk cannot adjust the size of the swap partition due to partition issues.
Create a swap file to solve the swap space (Virtual Memory) Problem of the operating system.
Create a swap file using the following method:
# Dd if =/dev/zero of =/tmp/swapfree bs = 32 k count = 8192 (count is the number of partitions, swap size = bs * count)
# Mkswap/tmp/swapfree (format the swap partition file)
# Swapon/tmp/swapfree (enable swap partition files)
# Swapon? S (display swap status)
Modify/etc/fstab so that the system uses/tmp/swapfree as swap each time it is started. The original/dev/sda3 can be taken away, or it can be kept as swap:
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