{"id":680,"date":"2018-05-28T06:29:48","date_gmt":"2018-05-28T06:29:48","guid":{"rendered":"https:\/\/visworlditsolution.wordpress.com\/?p=680"},"modified":"2018-05-28T06:29:48","modified_gmt":"2018-05-28T06:29:48","slug":"how-to-increase-swap-memory-after-installation-linux","status":"publish","type":"post","link":"https:\/\/linux.thingsomething.com\/index.php\/2018\/05\/28\/how-to-increase-swap-memory-after-installation-linux\/","title":{"rendered":"how to increase swap memory after installation Linux"},"content":{"rendered":"<p>Hello guys today in this article we are going to learn how to increase swap memory in linux after installation. As well we know swap memory is play very important roll in linux\u00a0 operating system Actually swap memory is use some space of heard disk space as a ram , but\u00a0 its a very important think that how space we create for swap memory. All Linux Administrator and engineers always recommend we need configure swap area just double to physical memory. For example we have 4 GB physical memory then we need to configure 8 GB swap area or partition during Linux installation.\u00a0 so let we now we are focus on our article heading. for example let&#8217;s assume we have 8 GB Linux Server or Desktop operating system we realized that our system need to increase physical memory so here we increase 8 GB Physical memory so here everything is normal our system is work perfectly and good but according to Linux expert rules we have to need just dual swap are to physical memory. so in this case we have two option 1st we will create extra swap partition or if we don&#8217;t have heard disk space we can also use file as a swap space its a very simple process so without wasting time we are learn how its possible.<\/p>\n<p><span style=\"color:#ff0000;\">(notice- in this tutorial all commands fire by root account you can also fire through other user you just use<\/span> <span style=\"color:#008000;\"><strong>sudo<\/strong><\/span>\u00a0 <span style=\"color:#ff0000;\">)<\/span><\/p>\n<p><span style=\"color:#008000;\"><strong>1 we will create directory where we hold swap file (its not necessary you can hold anywhere in your system )\u00a0<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong><code>mkdir -v \/var\/cache\/swap<\/code><\/strong><\/span><\/pre>\n<p><span style=\"color:#008000;\"><strong>2 then we will go in this directory through this commands<\/strong><\/span><\/p>\n<pre><strong><code>cd \/var\/cache\/swap<\/code><\/strong><\/pre>\n<p><span style=\"color:#008000;\"><strong>3 next here we will create any Empty file according to our Requirement using dd Command here my requirement is 8 GB swap area so look below Commands<\/strong><\/span><\/p>\n<pre><strong><code>dd if=\/dev\/zero of=swapfile bs=1K count=8M<\/code><\/strong><\/pre>\n<p><strong><span style=\"color:#008000;\">4 then next we provide 600 permission\u00a0<\/span><\/strong><\/p>\n<pre><strong><code>chmod 600 swapfile<\/code><\/strong><\/pre>\n<p><strong><span style=\"color:#008000;\">5 next we will\u00a0Convert newly created file into a swap space file.<\/span><\/strong><\/p>\n<pre><strong><code>mkswap swapfile<\/code><\/strong><\/pre>\n<p><span style=\"color:#008000;\"><strong>6 then here we enable swap file and look this is work ?<\/strong><\/span><\/p>\n<pre><code><strong>sudo swapon swapfile<\/strong>\n<\/code><\/pre>\n<pre><strong><code>top -bn1 | grep -i swap<\/code><\/strong><code><\/code><\/pre>\n<p><span style=\"color:#008000;\"><strong>7 then we next we will stop swap file and entry in main swap file\u00a0<\/strong><\/span><\/p>\n<p><strong><code>swapoff swapfile\u00a0<\/code><\/strong><\/p>\n<p>8\u00a0 <span style=\"color:#008000;\"><strong>then we add entry this file is \/etc\/fstab\u00a0<\/strong><\/span><\/p>\n<pre><span style=\"color:#008000;\"><strong><code>echo \"\/var\/cache\/swap\/swapfile none swap sw 0 0\" | tee -a \/etc\/fstab<\/code><\/strong><\/span><\/pre>\n<p><span style=\"color:#008000;\"><strong>9 then we on swapfile using blow Commands\u00a0<\/strong><\/span><\/p>\n<pre><code> swapon -va<\/code><\/pre>\n<p>if you have any problem in this tutorial please comments here i will solve your problem<\/p>\n<p>thank you<\/p>\n<p>Writer- Vishnu Sharma (Linux and Network system Administrator)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello guys today in this article we are going to learn how to increase swap memory in linux after installation. As well we know swap &hellip; <span class=\"ml-btn\"><a href=\"https:\/\/linux.thingsomething.com\/index.php\/2018\/05\/28\/how-to-increase-swap-memory-after-installation-linux\/\" class=\"more-link\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[22,10],"tags":[34,130,131,132,133,164,241],"class_list":["post-680","post","type-post","status-publish","format-standard","hentry","category-basic-linux","category-linux-desktop-support","tag-about-swap-memory","tag-how-to-increase-swap-memory-after-install-linux","tag-how-to-increase-swap-memory-in-linux","tag-how-to-increase-swap-memory-in-linux-ubuntu-16-4-4","tag-how-to-increase-swap-memory-in-ubuntu","tag-how-to-user-file-as-a-swap-memory","tag-what-is-swap-memory"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/680"}],"collection":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/comments?post=680"}],"version-history":[{"count":0,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/680\/revisions"}],"wp:attachment":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/media?parent=680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/categories?post=680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/tags?post=680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}