HOW TO INCREASE THE SWAP PARTITION SIZE
***************************************************
Normally we keep size of SWAP double to the RAM, but what if you have installed additional RAM and require more swap space. Lets see how we can increase the SWAP space without restarting the system assuming that there is some free space in the hard disk.
Open linux terminal and log in with root.
1) fdisk -l ( this will tell about the partitions in the Hard disk)
Assuming there are partitions upto sda7
2) fdisk /dev/sda
Press m for all the help options at this point.
3) Press n for the new partition.
it will ask for first cylinder – press enter (no need to give anything there)
it will ask for last cylinder TYPE : +1G ( it means that additionaly SWAP space will be of 1GB)
4) (1-8) press 8 (its for the new sda8)
5) Press l and then 82 ( 82 is hex number for SWAP)
6) Press p (to print the details)
7)press w (to write the configuration in the partition table)
but the work is not finished yet because still Linux system is using old partition table…. so we need to force it to read the new partition table and the command is
8) partprobe (used to read new partition table)
9) mkswap /dev/sda8 (this will make the swap space to be used)
Note: if we restart Linux then the new swap partition will get lost so we need to make it permanent by making an entry in /etc/fstab
10) vi /etc/fstab (press i to go in insert mode)
In the last line make this entry
/dev/sda8 swap swap defaults 0 0
save the file with :wq
11) mount -a
12) swapon -a
13) swapon -s (to see the status)
That's all you have to do to add some more swap space to your LINUX for better functionality.
No comments:
Post a Comment