Question: How to Increase Swap Space in Linux?

Question: How to Increase Swap Space in Linux?
Contents

Create a Linux Swap File.

Swap is a space on a disk that is used when the amount of physical RAM memory is full.

When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.

Swap space can take the form of either a dedicated swap partition or a swap file.

How do you extend a swap?

How to Extend Swap Space using Swap file in Linux

  • Below are the Steps to extend Swap Space using Swap File in Linux.
  • Step:1 Create a swap file of size 1 GB using below dd Command.
  • Step:2 Secure the swap file with permissions 644.
  • Step:3 Enable the Swap Area on the file (swap_file)
  • Step:4 Add the swap file entry in the fstab file.

How do I enable swap space in Linux?

How to add swap space in linux

  1. adding swap partition. adding swap volume.
  2. Run the fdisk or parted utility to identify disks with sufficient unused (unpartitioned) disk space.
  3. Run the command mkswap against the device/partition created earlier using fdisk/parted.
  4. To check swap usage, you can use any one of the utilities below:
  5. 2. /
  6. top.
  7. vmstat.
James H. Sterling
Author

James H. Sterling

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