{"id":363,"date":"2010-06-25T11:26:47","date_gmt":"2010-06-25T18:26:47","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=363"},"modified":"2010-06-25T11:26:47","modified_gmt":"2010-06-25T18:26:47","slug":"how-to-add-more-swap-space-in-linux","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=363","title":{"rendered":"How to add more swap space in linux."},"content":{"rendered":"<p>I used this procedure to add swap space to a server, where I not more available partitions, but had space on a previously formated partition.<\/p>\n<p># mkdir \/var\/swap<\/p>\n<p>Create container files:<br \/>\n# dd if=\/dev\/zero of=\/var\/swap\/swapfile1 bs=1024 count=65536<br \/>\n# dd if=\/dev\/zero of=\/var\/swap\/swapfile2 bs=1024 count=65536<br \/>\n# dd if=\/dev\/zero of=\/var\/swap\/swapfile3 bs=1024 count=65536<br \/>\n# dd if=\/dev\/zero of=\/var\/swap\/swapfile4 bs=1024 count=65536<\/p>\n<p>Format as swap:<br \/>\n# mkswap \/var\/swap\/swapfile1<br \/>\n# mkswap \/var\/swap\/swapfile2<br \/>\n# mkswap \/var\/swap\/swapfile3<br \/>\n# mkswap \/var\/swap\/swapfile4<\/p>\n<p>Add them to startup:<br \/>\n# vi \/etc\/fstab<br \/>\n&#8230;<br \/>\n\/var\/swap\/swapfile1\tswap\t\t\tswap\tdefaults\t0 0<br \/>\n\/var\/swap\/swapfile2\tswap\t\t\tswap\tdefaults\t0 0<br \/>\n\/var\/swap\/swapfile3\tswap\t\t\tswap\tdefaults\t0 0<br \/>\n\/var\/swap\/swapfile4\tswap\t\t\tswap\tdefaults\t0 0<br \/>\n&#8230;<\/p>\n<p>Enable them:<br \/>\n# swapon -a<br \/>\nCheck them:<br \/>\n# swapon -sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used this procedure to add swap space to a server, where I not more available partitions, but had space on a previously formated partition. # mkdir \/var\/swap Create container files: # dd if=\/dev\/zero of=\/var\/swap\/swapfile1 bs=1024 count=65536 # dd if=\/dev\/zero of=\/var\/swap\/swapfile2 bs=1024 count=65536 # dd if=\/dev\/zero of=\/var\/swap\/swapfile3 bs=1024 count=65536 # dd if=\/dev\/zero of=\/var\/swap\/swapfile4 bs=1024 count=65536 [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[48,91],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-linux","tag-swap"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}