Increase SWAP space in Linux

Method 1: Use a Hard Drive Partition for Additional Swap Space

Step #1: Login as the Root User and run following commands

# mkswap /dev/sdc1

# swapon /dev/sdc1

Method 2: Use a File for Additional Swap Space

# dd if=/dev/zero of=/root/SWAPFILENAME bs=1M count=1024 (for 1 GB) Change as per requirement

# chmod 600 /root/SWAPFILENAME

# mkswap /root/myswapfile

Enable the newly created swapfile.

# swapon /root/myswapfile

This entry was posted in Swap. Bookmark the permalink.

Leave a Reply

Your email address will not be published.