SES by degreeadvantage.com

Saturday, March 8, 2008

Increasing the Size of Swap Partition

There are possibilities that any time we can increase the size of RAM, at that time we need to increase the size of swap partition as per the increased size of the RAM.

There are two method of doing so

a. creating partition

b. Creating file

  1. Creating Partition:

i. We have to create one partition of size say 200MB and change its type to 82 (swap type) . save and exit and then run the command “partprobe”

ii. Format the partition say /dev/hda9

#mkswap /dev/hda9

iii. Make the swap partition active

#swapon /dev/hda9

iv. to check the entry of swap partition

# cat /proc/swaps

If we want to make the permanent entry in fstab then

#vi /etc/fstab

/dev/hda9 swap swap defaults 0 0

  1. Creating file

i. first make an empty file

#touch /swp

ii. Now we customize the size of the swap

# dd if=/dev/zero of=/swp bs=1M count=200

iii. Format the newly created swap file

#mkswap /swp

iv. Active the swap file

#swapon /swp

To check the entry of swap file

#cat /proc/swaps

If we want that automatically this swap file activate , we need to make the entry in /etc/ec.local

# vi /etc/rc.local

Make the following entry

Swapon /swp

Save and exit

No comments:

 
Free Search Engine Submission thanks to: Create a Website