Search This Blog

Wednesday, October 5, 2011

HOWTO add swap space on linux system

Step:
1. login to root user
su root

2. create swap file for desired size
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288

NOTE: bs = size in bytes and count = ( bs * desired space)
if you want to increase 1g then count will calculate in following way
1024 * 1024 = 1048576

3. setup linux swap area
# mkswap /swapfile1

4. Activiate swapfile space
# swapon /swapfile1

5. check "free-m" command on # prompt
$ free -g



1 comment: