{"id":288,"date":"2019-02-18T12:51:47","date_gmt":"2019-02-18T11:51:47","guid":{"rendered":"http:\/\/slackware.pt\/?p=288"},"modified":"2019-02-18T12:56:17","modified_gmt":"2019-02-18T11:56:17","slug":"ficheiro-de-swap","status":"publish","type":"post","link":"http:\/\/slackware.pt\/?p=288","title":{"rendered":"Ficheiro de swap"},"content":{"rendered":"<p>Precisei de aumentar o espa\u00e7o de swap numa m\u00e1quina com o Ubuntu. No Slackware costumo criar parti\u00e7\u00f5es de swap, mas esta m\u00e1quina Ubuntu tinha um ficheiro de swap, ao inv\u00e9s de uma parti\u00e7\u00e3o.<\/p>\n<p>Segui as instru\u00e7\u00f5es do site <a href=\"https:\/\/linuxize.com\/post\/how-to-add-swap-space-on-ubuntu-18-04\/\">Linuxize<\/a>, e criei dois ficheiros de 2G cada.<\/p>\n<pre>sudo swapon --show\r\nsudo fallocate -l 2G \/swapfile2\r\nsudo chmod 600 \/swapfile2\r\nsudo mkswap \/swapfile2\r\nsudo swapon \/swapfile2\r\nsudo vi \/etc\/fstab\r\nsudo swapon --show\r\n\r\nsudo swapon --show\r\nsudo fallocate -l 2G \/swapfile3\r\nsudo chmod 600 \/swapfile3\r\nsudo mkswap \/swapfile3\r\nsudo swapon \/swapfile3\r\nsudo vi \/etc\/fstab\r\nsudo swapon --show\r\nsudo free -h<\/pre>\n<p>O ficheiro \/etc\/fstab ficou com 3 ficheiros de swap, como indicado abaixo:<\/p>\n<pre>\/swapfile             none            swap    sw              0       0\r\n\/swapfile2            none            swap    sw              0       0\r\n\/swapfile3            none            swap    sw              0       0<\/pre>\n<p>O resultado dos comandos de consulta foi:<\/p>\n<pre>$ sudo swapon --show\r\nNAME       TYPE SIZE   USED PRIO\r\n\/swapfile  file   2G 977,5M   -2\r\n\/swapfile2 file   2G     0B   -3\r\n\/swapfile3 file   2G     0B   -4\r\n\r\n$ sudo free -h\r\n          total        used        free      shared  buff\/cache   available\r\nMem:       7,7G        1,7G        122M        195M        5,9G        5,5G\r\nSwap:      6,0G        977M        5,0G<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Precisei de aumentar o espa\u00e7o de swap numa m\u00e1quina com o Ubuntu. No Slackware costumo criar parti\u00e7\u00f5es de swap, mas esta m\u00e1quina Ubuntu tinha um ficheiro de swap, ao inv\u00e9s de uma parti\u00e7\u00e3o. Segui as instru\u00e7\u00f5es do site Linuxize, e criei dois ficheiros de 2G cada. sudo swapon &#8211;show sudo fallocate -l 2G \/swapfile2 sudo &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/slackware.pt\/?p=288\" class=\"more-link\">Continuar a ler <span class=\"screen-reader-text\">&#8220;Ficheiro de swap&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/posts\/288"}],"collection":[{"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/slackware.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":3,"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":291,"href":"http:\/\/slackware.pt\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/291"}],"wp:attachment":[{"href":"http:\/\/slackware.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/slackware.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/slackware.pt\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}