1. P R E SE N T E D B Y :
A.MOHAMED JAFAR DEEN
SWAP
ADMINISTRATION
2. OBJECTIVE:-
How to create and manage Linux swap space, file
based swap, partition based swap??
To create swap space if physical memory is full.
If needed increase the amount of swap space.
To create swap space even if there is not available
partition, but space is available in already existing
partitions.
3. SWAPPING:-
Swapping is the process whereby a inactive page of
memory is copied to the preconfigured space on the
hard disk, called swap space, to free up that page of
memory.
When RAM holds more than 75% memory swap will
be activated
4. SWAP TYPES:-
Swap space can be
a dedicated swap partition
a swap file
a combination of swap partitions and swap files.
5. WHY SWAPPING:
Shortage of memory
Efficient memory management needed
Process may be too big for physical memory
More active processes than physical memory can hold
Requirements of
multiprogramming
Efficient protection scheme
Simple way of sharing
7. CONFIGURING SWAP SPACE USING
DRIVE PARTITION
STEPS:-
First check the current swap usage by using the
commands “swapon –s” or “free”.
Create a new partition using fdisk. Set the partition’s
system id as “82”.
Prepare the swap partition:- “mkswap <partition name>”
Enable the swap space for use by the system:-
Temporary enable: “swapon <partition name>”
Permanently enable: “vim /etc/fstab”
To display current swap space:- “swapon –s”
To disable swaping on a partition, use “swapoff
<partition name>” command.
8.
9.
10. CONFIGURING SWAP SPACE USING SWAP
FILE (if there is no available partition )
Create a file and write bytes to it equalizing the amount
of swap space you wish to add,using dd command:-
“dd if=/dev/zero of=/ram1 bs=1024 count=200000”
Prepare swap partition:- “mkswap <swapfile name>”
Enable swap space for use by the system:-
Temporary enable: “swapon <swapfile name>”
Permanently enable: “vim /etc/fstab”
To display current swap space:- “swapon -s”
To disable swaping on a partition, use “swapoff
<swapfile name>” command
11. Conclusion
Managing swap space is an essential aspect of system
administration.
Swap management is useful if you are planning to
increase RAM in near future.
It is also useful in increasing processing speed of the
system