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