Total Pageviews

Translate

March 14, 2015

Increase RAM at real time by giving SWAP from HARD DISK in redhat linux 7

by Anonymous  |  in System Administration at  5:38 PM

SWAP at real time:

This is very easy to increase RAM of your system at real time when you need. Red hat Linux7 gives this opportunity to increase RAM from your hard disk/pen drive/partition of hard disk. you can also change its priority . we can say it addition RAM . If we don't  give any priority then its default last .

Requirement:

Partition of hard disk / pen drive / Any hard disk


Steps :

1) Go in the partition table and make a partition if you don't have.

fdisk -l          - to check the name of hard disk it can be /dev/sda or /dev/vda
if  it is /dev/sda then
fdisk /dev/sda    
Now you are in fdisk so your normal commands will not work .
press n for make a new partition
then leave first sector and type your partition size with + sine  for last sector.
now your partition is added .
you can see by pressing p .
press w to save the partition and come out.
If you will press q then it will close fdisk without saving the partition.
Now your common commands will work .
write command partprobe  - for update hard disk at real time.
Now your partition is ready. Example your partition is /dev/sda3

2) Make swap and ON this swap.

mkswap /dev/sda3
swapon /dev/sda3
Now you can check it by these these commands
swapon -s 
free -m

3) Make it permanent so give its entry  in /etc/fstab 

write command to open and edit and then press i to write something.
vim /etc/fstab
go to the last line and write
/dev/sda3   swap   swap   defaults   0    0
now close it with saving by press Esc then :wq 
To check  write command
mount -a

NOTE :- IF you have any partition or pen drive , then you don't need step 1 .
 Just find its name by pressing   fdisk -l and apply step 2 and 3 .
Name of pen drive can be like this /dev/sdb or /dev/sdc
Name of partition can be like this /dev/sda5  or /dev/vda5 

Like Our Facebook Page

Nitin Sharma's DEV Profile
Proudly Designed by 4hathacker.