November 26, 2013

Managing Swap Space in RHEL 6

Introduction

The swap space is used by the OS to handle overflow for parts of the RAM that are currently not being used.

The recommended size of the swap space is depending on how much RAM you have.

  • < 2GB RAM, use 2 * RAM
  • >= 2GB RAM, use RAM + 2GB

How to Create a New Swap Partition

After reboot we need to format the new swap partition.

Next step is to activating it.

To verify/list current swap spaces.

To make this new swap space persistent, we need to add this new swap space to /etc/fstab.

Reboot and verify that new swap space is active.

How to Remove a Swap Partition

First deactive it.

Verify it is no longer active.

IF YOU HAVE ADDED IT TO /etc/fstab, DO NOT FORGET TO REMOVE IT FROM THERE AS WELL!

No comments: