{"id":4760,"date":"2019-08-24T00:55:46","date_gmt":"2019-08-23T16:55:46","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4760"},"modified":"2019-08-26T15:14:35","modified_gmt":"2019-08-26T07:14:35","slug":"swapon","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/swapon","title":{"rendered":"swapon\u547d\u4ee4 – \u6fc0\u6d3b\u4ea4\u6362\u7a7a\u95f4"},"content":{"rendered":"\n

swapon\u547d\u4ee4\u7528\u4e8e\u6fc0\u6d3bLinux\u7cfb\u7edf\u4e2d\u4ea4\u6362\u7a7a\u95f4\uff0cLinux\u7cfb\u7edf\u7684\u5185\u5b58\u7ba1\u7406\u5fc5\u987b\u4f7f\u7528\u4ea4\u6362\u533a\u6765\u5efa\u7acb\u865a\u62df\u5185\u5b58\u3002<\/p>\n\n\n\n

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

\u5e38\u7528\u53c2\u6570<\/strong>\uff1a<\/p>\n\n\n\n
-a <\/td>\u5c06\/etc\/fstab\u6587\u4ef6\u4e2d\u6240\u6709\u8bbe\u7f6e\u4e3aswap\u7684\u8bbe\u5907\uff0c\u542f\u52a8\u4e3a\u4ea4\u6362\u533a <\/td><\/tr>
-h <\/td>\u663e\u793a\u5e2e\u52a9<\/td><\/tr>
-p <\/td>\u5236\u5b9a\u4ea4\u6362\u533a\u7684\u4f18\u5148\u987a\u5e8f<\/td><\/tr>
-s <\/td>\u663e\u793a\u4ea4\u6362\u533a\u7684\u4f7f\u7528\u60c5\u51b5<\/td><\/tr><\/tbody><\/table>\n\n\n\n

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

\u663e\u793a\u4ea4\u6362\u533a\u7684\u7248\u672c\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# swapon -v \/dev\/hdb4<\/pre>\n\n\n\n

\u663e\u793a\u4ea4\u6362\u533a\u7684\u4f7f\u7528\u60c5\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# swapon -s<\/pre>\n\n\n\n

\u8bbe\u5b9a\u4f18\u5148\u6743\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# swapon -p 3 \/dev\/hdb4<\/pre>\n\n\n\n

\u81ea\u52a8\u542f\u52a8\u6240\u6709SWAP\u88c5\u7f6e\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# swapon -a<\/pre>\n\n\n\n

\u663e\u793aswap\u547d\u4ee4\u7684\u5e2e\u52a9\u6587\u6863\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# swapon -h<\/pre>\n","protected":false},"excerpt":{"rendered":"

swapon\u547d\u4ee4\u7528\u4e8e\u6fc0\u6d3bLinux\u7cfb\u7edf\u4e2d\u4ea4\u6362\u7a7a\u95f4\uff0cLinux\u7cfb\u7edf\u7684\u5185\u5b58\u7ba1\u7406\u5fc5\u987b\u4f7f\u7528\u4ea4\u6362\u533a\u6765\u5efa\u7acb\u865a\u62df\u5185\u5b58\u3002 \u8bed\u6cd5 […]<\/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\/4760"}],"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=4760"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4760\/revisions"}],"predecessor-version":[{"id":4854,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4760\/revisions\/4854"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}