Linux4.4 manually adding swap space

Source: Internet
Author: User

# #增加交换分区需要先模拟出虚拟磁盘 # from the Linux kernel build 0 device zero, write to the Newdisk file, specify the file block size 1M, 100 blocks [[email protected] ~]# DD If=/dev/zero of=/tmp /newdisk bs=1m count=100 recorded the 100+0 read record of the 100+0 write 104857600 bytes (MB) copied, 1.41021 seconds, 74.4 mb/s [[email protected] ~]# Du-sh/tmp/newdisk100m/tmp/newdisk[[email protected] ~]# mkswap!$ #格式化mkswap/tmp/newdisk Setting swap space version 1 , size = 102396 KiB no label, uuid=42417e22-8a9d-4d7c-af89-332eb74dbf81[[email protected] ~]# free-m total U SED free shared buffers cachedmem:987 321 665 6 0 173-/ + buffers/cache:147 839swap:2047 0 2047[[email protected] ~]# swapon/tmp/newd ISK #加载到现在的swapswapon:/tmp/newdisk: Unsafe Permissions 0644, 0600 is recommended.           [[email protected] ~]# free-m total used free shared buffers Cachedmem:    987 321 665 6 0 173-/+ Buffers/cache:    147 839swap:2147 0 2147[[email protected] ~]# chmod 0600/tmp/newdisk# Delete swap partition [[Emai     L protected] ~]# swapoff/tmp/newdisk[[email protected] ~]#!ffree-m Total used free        Shared buffers cachedmem:987 321 665 6 0 173-/+ Buffers/cache: 147 839swap:2047 0 2047[[email protected] ~]# rm-f/tmp/newdisk

  

Linux4.4 manually adding swap space

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.