Ticker

6/recent/ticker-posts

Ad Code

How to make Swap space in running linux machine




Make 2GB space by using below command


[root@localhost ~] dd if=/dev/zero of=/swapfile count=2048 bs=1M


 Change its permission


[root@localhost ~] chmod 600 /swapfile


 Then Make swap file using below command


[root@localhost ~] mkswap /swapfile


 

[root@localhost ~] swapon /swapfile


 then give it to the fstab entry for making it permanent


root@host:~#echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab


 

[root@localhost ~]# free -m

              total        used        free      shared  buff/cache   available

Mem:           1827        1575          79          20         172          88

Swap:          1239          65        1174


 

 


Post a Comment

0 Comments