Swap file creation

Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):

dd if=/dev/zero of=/swapfile bs=1024 count=524288

Set up a Linux swap area:

mkswap /swapfile

Activate /swapfile1 swap space immediately:

swapon /swapfile

To activate /swapfile after Linux system reboot, add entry to /etc/fstab file.

vim /etc/fstab

Append the following line:

/swapfile swap swap defaults 0 0

One thought on “Swap file creation

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.