How to add a Swap Partition

These steps will create an additional swap partition on your system.

1. Create swap partition (This example uses IDE 2nd drive (/dev/hdb), 2nd partition). Use n command and make partition. Change ID to 82 by using t command.At a command prompt type

fdisk /dev/hdb


2. Make swap space using mkswap. At a command prompt type

mkswap -c /dev/hdb2


3. Enable swap space. At a command prompt type

swapon /dev/hdb2


Check swap space using free or top command



4. Edit /etc/fstab to enable next boot

...
/dev/hdb2 swap swap default 0 0


Also See: How to View Swap Info on Linux

Labels: , , ,