{"id":2708,"date":"2020-09-27T09:49:32","date_gmt":"2020-09-27T01:49:32","guid":{"rendered":"https:\/\/jir.idv.tw\/wordpress\/?p=2708"},"modified":"2020-10-13T20:25:51","modified_gmt":"2020-10-13T12:25:51","slug":"linux%e5%ae%89%e8%a3%9d%e5%bf%bd%e7%84%b6%e8%b7%b3failed-var-log-xxxx-no-space-left-on-device","status":"publish","type":"post","link":"https:\/\/jir.idv.tw\/wordpress\/?p=2708","title":{"rendered":"[LINUX]\u5b89\u88dd\u5ffd\u7136\u8df3failed: \/var\/log\/xxxx No space left on device"},"content":{"rendered":"<p>\u7d00\u9304\u4e00\u4e0b\u9047\u5230\u7684\u554f\u984c\u548c\u89e3\u6c7a\u65b9\u5f0f\u3002<\/p>\n<p>\u9019\u5e7e\u5929\u4e00\u76f4\u5728Banana Pi M1\u53cd\u8986\u91cd\u704cArmbian\u7684Linux\u7cfb\u7d71\u3002<br \/>\n\u525b\u525b\u70ba\u4e86\u66f4\u65b0\u5957\u4ef6\uff0c\u5ffd\u7136\u6bcf\u500b\u5957\u4ef6\u9023\u7e8c\u8df3\u51fawriting access log entry failed: \/var\/log\/xxxx\/yyyy.log No space left on device\u7684\u8a0a\u606f\u8b66\u5831\u3002<br \/>\n\u60f3\u8aaa\u660e\u660elog\u6a94\u5beb\u5230\u8a18\u61b6\u5361\u7684\u7a7a\u9593\uff0c\u600e\u53ef\u80fd\u6703\u6709\u9019\u7a2e\u8b66\u5831\uff0c\u91cd\u704c\u671f\u9593\u7528\u597d\u5e7e\u6b21\u4e5f\u6c92\u6709\u985e\u4f3c\u7684\u554f\u984c\u904e\u54e9\u3002<\/p>\n<p>\u6240\u4ee5\u7528df -h\u6307\u4ee4\u67e5\u4e86\u4e00\u4e0b\uff0c\u5c45\u7136\u6709\u8c93\u81a9&#8230;<br \/>\n<code>Filesystem      Size  Used Avail Use% Mounted on<br \/>\nudev            427M     0  427M   0% \/dev<br \/>\ntmpfs           100M  768K   99M   1% \/run<br \/>\n\/dev\/mmcblk0p1   29G  3.3G   25G  12% \/<br \/>\ntmpfs           496M     0  496M   0% \/dev\/shm<br \/>\ntmpfs           5.0M     0  5.0M   0% \/run\/lock<br \/>\ntmpfs           4.0M     0  4.0M   0% \/sys\/fs\/cgroup<br \/>\ntmpfs           496M  4.0K  496M   1% \/tmp<br \/>\n\/dev\/zram0      50M   50M  0M  100% \/var\/log<br \/>\ntmpfs           100M   24K  100M   1% \/run\/user\/0<\/code><\/p>\n<p>\u9019\u500b\/dev\/zram0\u662f\u4ec0\u9ebc\u88dd\u7f6e\uff0c\u600e\u9ebc\u4e0d\u662f\u500b\u5206\u5272\u5340&#8230;?!<br \/>\n<!--more-->\u53bb\u67e5\/etc\/fstab\u4e5f\u6c92\u6709\u5b9a\u7fa9\u9019\u500b\u4f4d\u7f6e\u7684\u8a2d\u5b9a\u3002<br \/>\n\u7528GOOGLE\u5927\u795e\u7814\u7a76\u5230\u4e00\u7bc7\u5206\u4eab\u6587\uff0c<a href=\"https:\/\/forum.armbian.com\/topic\/7184-no-space-left-on-device\/\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/forum.armbian.com\/topic\/7184-no-space-left-on-device\/<\/a>\u3002<br \/>\n\u770b\u8d77\u4f86\u597d\u50cf\u662fRAM DISK\u7684\u6771\u897f\uff0c\u5b9a\u7fa9\u7684\u5bb9\u91cf\u592a\u5c0f\u88ab\u5360\u6eff\u4e86\u3002<br \/>\n\u53ea\u662f\u70ba\u4ec0\u9ebc\u73fe\u5728\u9019\u7248\u7684\u72c0\u614b\u6709\u9019\u500b\uff0c\u4e0d\u61c2&#8230;XD<br \/>\n\u6587\u7ae0\u8aaa\u6a94\u6848\u8a2d\u5b9a\u5728\/etc\/default\/log2ram\uff0c\u4e0d\u904e\u6211\u7684\u7cfb\u7d71\u6c92\u6709\u9019\u500b\u6a94\u6848\u3002<br \/>\n\u4f46\u662f\u6709\u767c\u73fe\u4e00\u500b\u985e\u4f3c\u7684\/etc\/default\/armbian-ramlog\uff0c\u7528\u7de8\u8f2f\u8edf\u9ad4\u6253\u958b\u5f8c\uff0c\u679c\u7136\u662f\u90a3\u500bRAM DISK\u5b9a\u7fa9\u7684\u8a2d\u5b9a\u6a94\u3002<br \/>\n\u7531\u65bc\u5167\u5efa\u8a18\u61b6\u9ad4\u4e0d\u591a\uff0c\u6240\u4ee5\u5617\u8a66\u628a\u9810\u8a2d\u503c50M\u6539\u6210150M\u770b\u770b\u3002<\/p>\n<p>nano \/etc\/default\/armbian-ramlog<br \/>\n<code># configuration values for the armbian-ram-logging service<br \/>\n# enable the armbian-ram-logging service?<br \/>\nENABLED=true<br \/>\n# size of the tmpfs mount -- please keep in mind to adjust \/etc\/default\/armbian-zram-config too wh><br \/>\n##modified by JIR<br \/>\n#SIZE=50M<br \/>\nSIZE=150M<br \/>\n# use rsync instead of cp -r<br \/>\n# requires rsync installed, may provide better performance<br \/>\n# due to copying only new and changed files<br \/>\nUSE_RSYNC=true<\/code><\/p>\n<p>\u7136\u5f8c\u91cd\u958b\u6a5f\u770b\u770b\u3002<br \/>\n\u6069&#8230;\u597d\u50cf\u6b63\u5e38\u4e86\uff0c\u91cd\u704c\u8edf\u9ad4\u518d\u89c0\u5bdf\u770b\u770b\u662f\u5426\u6709\u51fa\u73fe\u4e0d\u5920\u5bb9\u91cf\u3002<br \/>\ndf -h<br \/>\n<code>Filesystem      Size  Used Avail Use% Mounted on<br \/>\nudev            427M     0  427M   0% \/dev<br \/>\ntmpfs           100M  768K   99M   1% \/run<br \/>\n\/dev\/mmcblk0p1   29G  3.3G   25G  12% \/<br \/>\ntmpfs           496M     0  496M   0% \/dev\/shm<br \/>\ntmpfs           5.0M     0  5.0M   0% \/run\/lock<br \/>\ntmpfs           4.0M     0  4.0M   0% \/sys\/fs\/cgroup<br \/>\ntmpfs           496M  4.0K  496M   1% \/tmp<br \/>\n\/dev\/zram0      146M   24M  112M  18% \/var\/log<br \/>\ntmpfs           100M   24K  100M   1% \/run\/user\/0<\/code><\/p>\n<p>\u7d50\u675f\uff0c\u4f5c\u7b46\u8a18\u7d00\u9304\u3002<\/p>\n<p>(2)<br \/>\n\u7b2c\u4e8c\u7a2e\u63a9\u8033\u76dc\u9234\u7684\u89e3\u6cd5\uff0c\u522a\u9664\u5927\u6cd5!!<br \/>\n<strong>Delete all files:<\/strong><br \/>\n<code>find \/var\/log -type f -delete<\/code><\/p>\n<p><strong>Delete all .gz and rotated file<\/strong><br \/>\n<code>find \/var\/log -type f -regex \".*\\.gz$\"<br \/>\nfind \/var\/log -type f -regex \".*\\.[0-9]$\"<\/code><\/p>\n<p>Try run command without &#8220;-delete&#8221;, to test it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d00\u9304\u4e00\u4e0b\u9047\u5230\u7684\u554f\u984c\u548c\u89e3\u6c7a\u65b9\u5f0f\u3002 \u9019\u5e7e\u5929\u4e00\u76f4\u5728Banana Pi M1\u53cd\u8986\u91cd\u704cArmbian\u7684Linux\u7cfb\u7d71\u3002 \u525b\u525b\u70ba\u4e86\u66f4\u65b0\u5957\u4ef6\uff0c\u5ffd\u7136\u6bcf\u500b\u5957\u4ef6\u9023\u7e8c\u8df3\u51fawriting access log entry failed: \/var\/log\/xxxx\/yyyy.log No space left on device\u7684\u8a0a\u606f\u8b66\u5831\u3002 \u60f3\u8aaa\u660e\u660elog\u6a94\u5beb\u5230\u8a18\u61b6\u5361\u7684\u7a7a\u9593\uff0c\u600e\u53ef\u80fd\u6703\u6709\u9019\u7a2e\u8b66\u5831\uff0c\u91cd\u704c\u671f\u9593\u7528\u597d\u5e7e\u6b21\u4e5f\u6c92\u6709\u985e\u4f3c\u7684\u554f\u984c\u904e\u54e9\u3002 \u6240\u4ee5\u7528df -h\u6307\u4ee4\u67e5\u4e86\u4e00\u4e0b\uff0c\u5c45\u7136\u6709\u8c93\u81a9&#8230; Filesystem Size Used Avail Use% Mounted on udev 427M 0 427M 0% \/dev tmpfs 100M 768K 99M 1% \/run \/dev\/mmcblk0p1 29G 3.3G 25G 12% \/ tmpfs 496M 0 496M 0% \/dev\/shm tmpfs 5.0M 0 5.0M 0% \/run\/lock tmpfs 4.0M 0 4.0M 0% \/sys\/fs\/cgroup tmpfs 496M 4.0K 496M 1% \/tmp \/dev\/zram [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-2708","post","type-post","status-publish","format-standard","hentry","category-4"],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2708"}],"version-history":[{"count":3,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2708\/revisions"}],"predecessor-version":[{"id":2720,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2708\/revisions\/2720"}],"wp:attachment":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}