Linux Extended Swap partition

Source: Internet
Author: User

One, view existing memory and swap

# free-m

Total used free shared buffers Cached

MEM:2026 1931 95 0 15 1789

-/+ buffers/cache:127 1899

swap:3074 2 3071


Second, create a 2G file with the DD command (2g=1024*1024*2=2097152)


#dd If=/dev/zero of=/var/swapfile bs=1024x768 count=2097152


Third, create it as a Linux swap virtual Exchange file


#mkswap/var/swapfile


3. Activate and use/var/swapfile1 to swap files


#swapon/var/swapfile


4. You can use Free-m to view swap size and use swapon-s to view swap status:


5, set the system to automatically activate the virtual Exchange file after startup.


#vi/etc/fstab

/var/swapfile swap swap defaults 0 0


This article is from the "Haina Rivers" blog, please be sure to keep this source http://yuxing34.blog.51cto.com/1426860/1621540

Linux Extended Swap partition

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.