Add Swap on Linux

From: FelipeCruz

To add swap partition use command

# mkswap /dev/hdb2
# swapon /dev/hdb2
# vi /etc/fstab
# /dev/hdb2   swap   swap   defaults   0 0

With assuming you already create /dev/hdb2 partition before using fdisk and chose swap filesystem.

To add a swap file:

# dd if=/dev/zero of=/swapfile bs=1024 count=65536
# mkswap /swapfile
# swapon /swapfile
# vi /etc/fstab
#  /swapfile   swap   swap    defaults        0 0

Check swap status:

# cat /proc/swaps
# free
SocialTwist Tell-a-Friend

Related posts:

  1. Check the first time you install Linux OS If you forgot when you deploying (installing) a server (or...

Related posts brought to you by Yet Another Related Posts Plugin.

Leave a Reply

CommentLuv Enabled


Warning: fsockopen() [function.fsockopen]: unable to connect to twitter.com:80 (Connection timed out) in /home/am3nnet/public_html/wp-includes/class-snoopy.php on line 1142