{"id":4371,"date":"2019-07-27T12:47:13","date_gmt":"2019-07-27T04:47:13","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4371"},"modified":"2019-07-27T12:47:15","modified_gmt":"2019-07-27T04:47:15","slug":"mkswap","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/mkswap","title":{"rendered":"mkswap\u547d\u4ee4 – \u5efa\u7acb\u548c\u8bbe\u7f6eSWAP\u4ea4\u6362\u5206\u533a"},"content":{"rendered":"\n

mkswap\u547d\u4ee4\u7528\u4e8e\u5728\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u8bbe\u5907\u4e0a\u5efa\u7acb\u4ea4\u6362\u5206\u533a\u3002\u5728\u5efa\u7acb\u5b8c\u4e4b\u540e\u8981\u4f7f\u7528sawpon\u547d\u4ee4\u5f00\u59cb\u4f7f\u7528\u8fd9\u4e2a\u4ea4\u6362\u533a\u3002\u6700\u540e\u4e00\u4e2a\u9009\u62e9\u6027\u53c2\u6570\u6307\u5b9a\u4e86\u4ea4\u6362\u533a\u7684\u5927\u5c0f\uff0c\u4f46\u662f\u8fd9\u4e2a\u53c2\u6570\u662f\u4e3a\u4e86\u5411\u540e\u517c\u5bb9\u8bbe\u7f6e\u7684\uff0c\u6ca1\u6709\u4f7f\u7528\u7684\u5fc5\u8981\uff0c\u4e00\u822c\u90fd\u5c06\u6574\u4e2a\u6587\u4ef6\u6216\u8005\u8bbe\u5907\u4f5c\u4e3a\u4ea4\u6362\u533a\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>mkswap [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-c<\/td>\u5efa\u7acb\u4ea4\u6362\u533a\u524d\uff0c\u5148\u68c0\u67e5\u662f\u5426\u6709\u635f\u574f\u7684\u533a\u5757 <\/td><\/tr>
-f<\/td>\u5728SPARC\u7535\u8111\u4e0a\u5efa\u7acb\u4ea4\u6362\u533a\uff0c\u8981\u52a0\u6b64\u53c2\u6570<\/td><\/tr>
-v0<\/td>\u5efa\u7acb\u65e7\u5f0f\u4ea4\u6362\u533a\uff0c\u6b64\u4e3a\u9884\u8bbe\u503c <\/td><\/tr>
-v1<\/td>\u5efa\u7acb\u65b0\u5f0f\u4ea4\u6362\u533a <\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u6dfb\u52a0\u4ea4\u6362\u5206\u533a\uff0c\u5047\u8bbe\u5b58\u5728\u5e76\u8bbe\u7f6e \/dev\/sdb3\u4e3a\u4ea4\u6362\u5206\u533a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# mkswap \/dev\/sdb2 \n[root@linuxcool ~]# swapon \/dev\/sdb2<\/pre>\n\n\n\n

\u7528dd\u521b\u5efa\u4e00\u4e2a512M\u7684\u4ea4\u6362\u6587\u4ef6\uff0c\u5c06\u6587\u4ef6\u8bbe\u7f6e\u4e3a\u4ea4\u6362\u5206\u533a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dd if=\/dev\/zero of=\/swapfile1 bs=1024 count=524288\n[root@linuxcool ~]# mkswap \/swapfile1  \n[root@linuxcool ~]# swapon \/swapfile1   <\/pre>\n","protected":false},"excerpt":{"rendered":"

mkswap\u547d\u4ee4\u7528\u4e8e\u5728\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u8bbe\u5907\u4e0a\u5efa\u7acb\u4ea4\u6362\u5206\u533a\u3002\u5728\u5efa\u7acb\u5b8c\u4e4b\u540e\u8981\u4f7f\u7528sawpon\u547d\u4ee4\u5f00\u59cb\u4f7f\u7528\u8fd9\u4e2a\u4ea4\u6362\u533a\u3002\u6700 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4371"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=4371"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4371\/revisions"}],"predecessor-version":[{"id":4430,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4371\/revisions\/4430"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}