Ubuntu12.04 SWAP settings

Source: Internet
Author: User
When I installed ubuntu12.04LTS in Ubuntu12.04, due to the disk partition problem, I did not set the SWAP partition during installation. later, when I was using it, sometimes the system was not running smoothly, it seems that SWAP partitions are still needed. Www.2cto. com1 .... when I installed Ubuntu 12.04 LTS for SWAP settings in ubuntu 12.04, I did not set SWAP partitions during the installation due to disk partitioning issues. later, sometimes the system is not running smoothly. it seems that SWAP partitions are still needed. Www.2cto.com 1. in ubuntu, configure to use the newly created Swap partition Command list: # Find the UUIDsudo blkid of the Swap partition # add the new Swap partition sudo gedit/etc/fstab in/ect/fstab # add the following content at the end, xxxx is the UUIDUUID of the Swap partition = xxxx none swap sw 0 0 www.2cto.com # activate the Swap partition. the Swap partition is/dev/sda3sudo swapon/dev/sda3 2. use file in ubuntu when swapCommand list: # Create 1 GB filesudo dd if =/dev/zero of =/mnt/1 GB. swap bs = 1 M count = 1024 # format as Swap filesudo mkswap/mnt/1 GB. swap # add the swap file to the system In general, the operation above sudo swapon/mnt/1 GB. swap only temporarily adds one swap file. if you want to add it permanently, follow these steps. # Add a new Swap partition sudo gedit/etc/fstab to/ect/fstab # add the following content at the end/mnt/1GB. swap none swap sw 0 0 3. ubuntu swap usage policy Command list: # View memory/buffer/Swap usage. Free # view the swap usage policy. Swap and memory each account for 60% # The default value is 60, that is, Swap accounts, memory accounts for 40% of cat/proc/sys/vm/swappiness # Modify the swap usage policy # valid only for this boot. the original value of sudo sysclt vm is restored after the restart. swappiness = 20 # Modify the swap usage policy. The default value is # sudo gedit/etc/sysctl. conf # add the following content at the end: ######################################## ######### Set Swap usable availability # Swap <-------> physical memory # default: 60% 40% vm. swappiness = 20 4. disable swapsudo swapoff-

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.