Ubuntu10.10 cancel Switching Device

Source: Internet
Author: User
I added a block of memory to my ThinkpadE40, which is 4 GB now. The use of swap devices for such configuration is a waste of hard disks. In order to reduce hard disk wear, it is decided to cancel the switch device. In Windows 7, virtual memory cancellation can be set through the advanced settings in the system. Here we mainly talk about how to cancel the swap device under Ubuntu10.10. The swap device includes swap partition and swap file. The load of swap partition is through/etc/fstab

I added a block of memory to my Thinkpad E40, which is 4 GB now. The use of swap devices for such configuration is a waste of hard disks. In order to reduce hard disk wear, it is decided to cancel the switch device. In Windows 7, virtual memory cancellation can be set through the advanced settings in the system. Here we mainly talk about how to cancel switching devices in Ubuntu 10.10.

The swap device includes swap partition and swap file. The swap partition is loaded through the swap partition in/etc/fstab. Therefore, you can execute the following script:
Sudo gedit/etc/fstab &
Comment out the swap partition.

If there are still swap files, you can use swapoff-a to cancel all swap devices of the system, so you can execute the following script:
Sudo gedit/etc/init. d/rc. local &
Add/sbin/swapoff-a at the beginning of the file

If you need to adjust the Linux memory usage policy, you can set the vm. swappiness value. The value ranges from 0 to 100. 0 indicates the maximum memory usage, and then the swap device. indicates that the swap device is active. Therefore, you can execute the following script:
Sudo gedit/etc/sysctl. conf &
Add vm. swappiness = 0 at the end of the file.

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.