Linux Creating Swap Partitions

Source: Internet
Author: User

#基于磁盘的
# Convert partition to swap partition #1, format swap partition [Mkswap][[email protected]/]# mkswap/dev/Sda5 Setting up Swapspace version1, size =106889Kb[[email protected]/]# FreeTotal used Freeshared buffers Cachedmem:1026816 577392 449424 0 29772 343960-/+ Buffers/cache:203660 823156Swap:2064344 0 2064344#2, activating the swap partition [Swapon][[email protected]/]# swapon/dev/SDA5 [[email protected]/]# FreeTotal used Freeshared buffers Cachedmem:1026816 577448 449368 0 29792 343960-/+ Buffers/cache:203696 823120Swap:2168724 0 2168724[[Email protected]/]##3, close swap partition [Swapoff][[email protected]~]# swapoff/dev/sda5# Set Disk vol [[email protected] auto]# E2label/dev/sda5 sky# View Vol [[email protected] auto]# E2label/dev/sda5sky# View Hard disk According to vol [[email protected] auto]# Findfs LABEL=skyfindfs:unable To resolve'Label=sky'

#基于文件的创建一个分区添加交换文件 #mkdir-p/opt/temp#DD-if=/dev/zero Of=/opt/temp/swap bs=1024x768Count=2048000then: Create Swap space #mkswap/opt/temp/swap launches the newly added 2G swap space #swapon/opt/temp/swap# Free-m view you can already see the new space. Swap-3Modify/etc/Fstab, so that the newly added 2G swap space automatically takes effect after the system restarts #Echo "/opt/temp/swap Swap swap defaults 0 0">>/etc/fstab

Reference: http://blog.csdn.net/robertkun/article/details/8522889

Http://www.syscto.com/2014/07/448.html



Linux Creating Swap Partitions

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.