Add swap space to Linux ____linux

Source: Internet
Author: User
Original posted Address: http://blog.csdn.net/%ef%bd%84%ef%bd%8c%ef%bd%98%ef%bd%95/archive/2007/06/13/1650097.aspx

Add swap space to Linux

In the installation of Linux, do not know how much swap space allocation is better, so will randomly assign a, in real use, such as installation oracle10g will require a lot of swap space, found that swap space is not enough, that should be how to increase the size of swap space.

The following operations are done under root, first by establishing a partition, using the DD command such as DD if =/Dev/zero of =/home/swap bs = 1024 count = 512000

This creates a partition file such as/home/swap. The size of the file is 512,000 blocks, typically 1 blocks to 1 K, so the space here is 512M. Then turn this partition into a swap partition. /Sbin/mkswap/home/swap

And then use this swap partition. Make it a valid state. /Sbin/swapon/home/swap

Now look at the memory and swap size with the FREE-M command, and you'll see an increase in 512M of space. However, when the computer restarts, the discovery of swap is still the same size, the new swap does not start automatically, but also manually start. Then we need to modify the/etc/fstab file, add the following line/Home/swap swap defaults 0 0 and you'll find that your machine starts automatically. The swap space is also enlarged later.

trackback:http://tb.blog.csdn.net/trackback.aspx?postid=1650097

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.