Managing SWAP Partitions – RHEL 6.x – CentOS 6.x

Managing SWAP PartitionsIf the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.

Swap space is a portion of a hard disk drive (HDD) that is used for virtual memory. It can be whole disk partition or just a file inside an existing partition or a combination of swap partitions and swap files.

We will see how to manage SWAP Partitions on RHEL 6.x or CentOS 6.x

Steps:
1. Show current SWAP allocation
free -m
swapon -s

2. Create additional SWAP space from new partition

Reboot is required at this step

3. Make swap
mkswap /dev/sdb2

UUID=8bced662-e967-4861-9bac-6df8957b3eb5

4. Update /etc/fstab
UUID=8bced662-e967-4861-9bac-6df8957b3eb5 swap swap defaults 0 0

5. Re-reads /etc/fstab for swap
swapon -a

6. Show swap usage summary by device
swapon -s
free -m

Hope you found it informative and useful. Any questions or comments are welcomed.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.