System O & M skills (3) -- temporarily add swap partitions using dd commands

Source: Internet
Author: User

Sometimes the memory is insufficient. You can use the method provided in this article to temporarily add swap partitions.

# Create swap partition -- get the file [root @ serv01 linux-2.6.38] # dd If =/dev/Zero of =/swap. img bs = 1 m COUNT = 10241024 + 0 records in1024 + 0 records out1073741824 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 kibno 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 cachedmem: 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
My mailbox: wgbno27@163.com Sina Weibo: @ wentasy27 public platform: justoracle (No.: justoracle) database technology exchange group: 336882565 (when adding group verification from csdn XXX) Oracle Exchange discussion group: https://groups.google.com/d/forum/justoracleBy Larry Wen
 
@ Wentasy blog is for your reference only. Welcome to visit. I hope to criticize and correct any mistakes. If you need to repost the original blog post, please indicate the source. Thank you for the [csdn blog]

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.