How Do I Edit a Swap File in Ubuntu?
Contents

How do I edit a swap file?

Open ‘Advanced System Settings’ and navigate to the ‘Advanced’ tab. Click the ‘Settings’ button under the ‘Performance’ section to open another window. Click on the new window’s ‘Advanced’ tab, and click ‘Change’ under the ‘Virtual Memory’ section. There isn’t a way to directly adjust the size of the swap file.

How do I change swaps in Ubuntu?

To change it, do the next:

  1. Disable swap: $ sudo swapoff /dev/sda3.
  2. Recreate swap: $ sudo mkswap /dev/sda3 mkswap: /dev/sda3: warning: wiping old swap signature. …
  3. Enable swap: $ sudo swapon /dev/sda3.
  4. Check its size: $ free -m total used free shared buff/cache available Mem: 15948 13008 301 670 2638 2006 Swap: 10288 0 10288.
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest