# dd if=/dev/zero of=/swapfile bs=1M count=10002. Run the following command to modify the file permissions :
# chmod 600 /swapfile3.Run the following command to configure the file as swap space:
# mkswap /swapfile4.Run the following command to activate the swap file:
# swapon /swapfile5. To mount the swap partition automatically upon system startup, add an entry for the swap file to /etc/fstab.
# echo "/swapfile swap swap defaults 0 0" >>/etc/fstab6. Run the following command to mount the swap partition:
# mount -a