Use the dd command to temporarily add swap partitions

Source: Internet
Author: User
Using the dd command to temporarily add swap partitions sometimes causes insufficient memory. you can use the method provided in this article to temporarily add swap partitions. [Plain] # create swap partition & mdash; get the file [root@serv01linux-2.6.38] # ddif/dev/zeroof/swap... using the dd command to temporarily add swap partitions sometimes causes insufficient memory. you can use the method provided in this article to temporarily add swap partitions. [Plain] # create swap partition -- get the file [root @ serv01 linux-2.6.38] # dd if =/dev/zero of =/swap. img bs = 1 M count = 1024 1024 + 0 records in 1024 + 0 records out 1073741824 bytes (1.1 GB) copied, 2.68989 s, 399 MB/s [root @ serv01 linux-2.6.38] # ls swap. img # Make swap partition [root @ serv01 linux-2.6.38] # mkswap/swap. img mkswap: swap. img: warning: don't erase bootbits sectors on whole disk. use-f to force. setting up swapspace version 1, size = 1048572 KiB no label, UUID = 70945855-7bab-4c08-a880-77d089dd06cc # enable swap partition to take effect [root @ serv01 linux-2.6.38] # swapon/swap. img # you can use the free command to check whether the increase is successful [root @ serv01 linux-2.6.38] # free total used free shared buffers cached Mem: 384996 378700 6296 33232 249252-/+ buffers/cache: 96216 288780 Swap: 2097136 0 2097136 # Close, then delete [root @ serv01 linux-2.6.38] # swapoff/swap. img [root @ serv01 linux-2.6.38] # rm-rf/swap. img
Related Article

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.