Swap partition Add

Source: Internet
Author: User

First you need to use the command: DD to create a swapfile, and then you need to use the Mkswap command to create a Linux swap partition in the device or file
A) log in with the root user
b) Create a 2G Swap file using the following command (1024x768 * 2048MB = 2097152 block size):
# dd If=/dev/zero of=/data11/swapfile1 bs=1024 count=2097152
c) Create a Linux swap area:
# Mkswap/data11/swapfile1
d) Activate/swapfile1 swap space immediately:
# Swapon/data11/swapfile1
e) If you want to automatically activate and enable/swapfile1 after the Linux system restarts, you will need to edit the file:/etc/fstab, as follows:
# Vi/etc/fstab
Add the following line of commands:
/data11/swapfile1 swap swap defaults 0 0
After the following steps have been completed, the next time the Linux system restarts, the swap file will be automatically enabled
g) How does I verify swap is activated or not?
Simply Use free command:
$ free-m
If you want to turn off virtual memory or want to expand, first disable
Swapoff/data11/swapfile1

Swap partition Add

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.