{"id":14755,"date":"2023-09-02T16:38:37","date_gmt":"2023-09-02T07:38:37","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=14755"},"modified":"2023-09-02T16:48:59","modified_gmt":"2023-09-02T07:48:59","slug":"linux%e3%81%a7%e3%83%9a%e3%83%bc%e3%82%b8%e3%83%b3%e3%82%b0%e9%a0%98%e5%9f%9f%ef%bc%88swap%ef%bc%89%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/14755","title":{"rendered":"Linux\u3067\u30da\u30fc\u30b8\u30f3\u30b0\u9818\u57df\uff08Swap\uff09\u3092\u8ffd\u52a0\u3059\u308b\uff01"},"content":{"rendered":"<p>Linux\u3067\u30da\u30fc\u30b8\u30f3\u30b0\u9818\u57df\uff08Swap\uff09\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u7528\u306e\u9818\u57df\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u7528\u306e\u9818\u57df\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# dd if=\/dev\/zero of=\/var\/swpext01 bs=1M count=1024\r\n1024+0 records in\r\n1024+0 records out\r\n1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.8854 s, 570 MB\/s\r\n<\/pre>\n<h2>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# mkswap \/var\/swpext01\r\nmkswap: \/var\/swpext01: insecure permissions 0644, fix with: chmod 0600 \/var\/swpext01\r\nSetting up swapspace version 1, size = 1024 MiB (1073737728 bytes)\r\nno label, UUID=c2dd0cd4-7bbd-4d4e-84a5-3cfcbe5c199b\r\n<\/pre>\n<h2>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# swapon -s\r\nFilename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\r\n\/dev\/dm-1                               partition\t3821564\t\t205400\t\t-2\r\n<\/pre>\n<h2>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u3092\u8ffd\u52a0\u3059\u308b\uff01<\/h2>\n<p>\u4f5c\u6210\u3057\u305f\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# swapon \/var\/swpext01\r\nswapon: \/var\/swpext01: insecure permissions 0644, 0600 suggested.\r\n<\/pre>\n<p>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# swapon -s\r\nFilename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\r\n\/dev\/dm-1                               partition\t3821564\t\t202328\t\t-2\r\n\/var\/swpext01                           file\t\t1048572\t\t0\t\t-3\r\n<\/pre>\n<p>\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u3067\u3082\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# free\r\n               total        used        free      shared  buff\/cache   available\r\nMem:        16352832    10411152     1278256      120632     4663424     5488988\r\nSwap:        4870136      202328     4667808\r\n\r\n<\/pre>\n<h2>\u518d\u8d77\u52d5\u5f8c\u3082\u4f7f\u7528\u53ef\u80fd\u306b\u3059\u308b\uff01<\/h2>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\necho &quot;\/var\/swpext01        swap                   swap    defaults        0       0&quot; &gt;&gt; \/etc\/fstab\r\n<\/pre>\n<p>\/etc\/fstab\u306b\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# cat \/etc\/fstab\r\n...\r\n# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;\r\n\/dev\/mapper\/vgubuntu-root \/               ext4    errors=remount-ro 0       1\r\n# \/boot\/efi was on \/dev\/sda1 during installation\r\nUUID=B971-513D  \/boot\/efi       vfat    umask=0077      0       1\r\n\/dev\/mapper\/vgubuntu-swap_1 none            swap    sw              0       0\r\n\/var\/swpext01        swap                   swap    defaults        0       0\r\n<\/pre>\n<p>\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nreboot\r\n<\/pre>\n<p>\u8ffd\u52a0\u3057\u305f\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u9818\u57df\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# swapon -s\r\nFilename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\r\n\/var\/swpext01                           file\t\t1048572\t\t0\t\t-2\r\n\/dev\/dm-1                               partition\t3821564\t\t0\t\t-3\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u30da\u30fc\u30b8\u30f3\u30b0\u30b9\u30da\u30fc\u30b9\u304c\u4e0d\u8db3\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u3001\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/14749\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30e1\u30e2\u30ea\u9818\u57df\u306e\u7ba1\u7406\u3092\u884c\u3046\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30e1\u30e2\u30ea\u9818\u57df\u306e\u7ba1\u7406\u3092\u884c\u3046\uff01<\/div><div class=\"substr\">Linux\u3067\u30e1\u30e2\u30ea\u9818\u57df\u306e\u7ba1\u7406\u3092\u884c\u3046\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u3067\u30da\u30fc\u30b8\u30f3\u30b0\u9818\u57df\uff08Swap\uff09\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1011],"tags":[282,1008,654],"class_list":["post-14755","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-memory","tag-linux","tag-1008","tag-654"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=14755"}],"version-history":[{"count":12,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14755\/revisions"}],"predecessor-version":[{"id":14767,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/14755\/revisions\/14767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5527"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=14755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=14755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=14755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}