Swapfile instead of a swap partition

First create the file to use for swap. I use /swapfile.

sudo dd if=/dev/zero of=/swapfile bs=1M count=2000

The above command would create a 2 GB file, feel free to adjust the size to fit your need.

Now set the correct permissions on the swapfile.

sudo chown root:root /swapfile
sudo chmod 600 /swapfile

Now setup that file to be used for swap.

sudo mkswap /swapfile

Enable the swapfile.

sudo swapon /swapfile

To have the swapfile automatically loaded on boot, add this to /etc/fstab.

/swapfile none swap sw 0 0

Now if you run free -m you can check that it lists the correct amount of swap.

Comments

Post comment

Lose up to 23 pounds of pure body fat in just 3 weeks!, how did i do that?

The 3 Week Diet is an extreme rapid weight loss program that can help you lose up to 23 pounds of pure body fat in just 3 weeks! Get your customized diet plan from our official website and find out which foods you should be eating if you want to burn your belly fat away fast! Created by acclaimed personal trainer and nutritionist Brian Flatt, The 3 Week Diet is 100% guaranteed to deliver results!

look great? dont waste your time! lets do this, join with us and bet back your beautiful body at here:

http://34.gs/hls5

Thx