Create/Edit Swap Partition
Set-up Steps
Check the free space
free -m
Create a partition
dd if=/dev/zero of=$SWAPFILE_DIRECTORY bs=$COUNT count=$SPACE
Formation
mkswap $SWAPFILE_DIRECTORY chmod -R 600 $SWAPFILE_DIRECTORY
Turn it on
swapon $SWAPFILE_DIRECTORY
Enable it permanently
Open /etc/fstab in the editor.
vim /etc/fstab
Add the line to it
$SWAPFILE_DIRECTORY swap swap defaults 0 0
Last updated
Was this helpful?