a) Login as the root user
b) Type following command to create 1G swap file (1024 * 1GB =
1048576 block size):
# dd if=/dev/zero of=/swap1 bs=1024 count=1048576
c) Set up the Linux swap:
# mkswap /swap1
d) Activate /swap1 swap space immediately:
# swapon -a /swap1
e) To check the current swaps in use type:
# swapon -s
f) To ensure /swap1 being used after Linux system reboot, add entry to
/etc/fstab file. Open this file using text editor such as vi:
# vi /etc/fstab
Append following line:
/swap1 swap swap defaults 0 0