{"id":7037,"date":"2023-01-06T16:38:06","date_gmt":"2023-01-06T16:38:06","guid":{"rendered":"https:\/\/www.kevinmaschke.com\/?p=7037"},"modified":"2023-01-06T16:38:07","modified_gmt":"2023-01-06T16:38:07","slug":"zimbra-disable-disk-space-monitoring-loop-devices","status":"publish","type":"post","link":"https:\/\/www.kevinmaschke.com\/en\/zimbra-disable-disk-space-monitoring-loop-devices\/","title":{"rendered":"Zimbra: \/snap\/core at 100% &#8211; Disable Disk Space Monitoring for Loop Devices"},"content":{"rendered":"\n<p>I recently logged into the Admin mail account of a <a href=\"https:\/\/www.kevinmaschke.com\/en\/tag\/zimbra-en\/\" data-type=\"post_tag\" data-id=\"647\">Zimbra<\/a> mail server I manage to see if there was anything noticeable to look at. It&#8217;s not an account I log in much, since it usually only holds daily reports and email notifications when services stop and start.<\/p>\n\n\n\n<p>Well, what a surprise when I suddenly see <strong>over a million emails<\/strong> in the inbox! <strong>1.000.000<\/strong>! And to my surprise, the subject of 99% of them was a variations of the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Disk \/snap\/core\/13425 at 100% on mail.domain.com:\nDisk \/snap\/certbot\/2192 at 100% on mail.domain.com:\nDisk \/snap\/canonical-livepatch\/146 at 100% on mail.domain.com:\nDisk \/snap\/core20\/1518 at 100% on mail.domain.com:<\/pre>\n\n\n\n<p>And the content of these emails was basically one line like the ones you usually find in the log files, eg:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mail zimbramon[22102]: 22102:crit: Disk warning: mail.domain.com: \/snap\/canonical-livepatch\/146 on device \/dev\/loop6 at 100%\nmail zimbramon[22102]: 22102:crit: Disk warning: mail.domain.com: \/snap\/core\/13425 on device \/dev\/loop3 at 100%<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Cause<\/h2>\n\n\n\n<p>This is caused because <strong>Zimbra monitors the existing disks<\/strong> and alerts when these are full, but <strong>these <code>\/dev\/loopX<\/code> disks have nothing to do with Zimbra<\/strong> and don\u00b4t need to be monitored. They are automatically created if you have <code><strong>snap<\/strong><\/code> installed and they all are read-only disks. You can see these disks if you run the command <code>df -h<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">root@mail:~# df -h\nFilesystem                 Size  Used Avail Use% Mounted on\nudev                       5.9G     0  5.9G   0% \/dev\ntmpfs                      1.2G  115M  1.1G  10% \/run\n\/dev\/mapper\/mail--vg-root  245G  122G  111G  53% \/\ntmpfs                      5.9G     0  5.9G   0% \/dev\/shm\ntmpfs                      5.0M     0  5.0M   0% \/run\/lock\ntmpfs                      5.9G     0  5.9G   0% \/sys\/fs\/cgroup\n\/dev\/loop0                  64M   64M     0 100% \/snap\/core20\/1738\n\/dev\/loop1                 9.0M  9.0M     0 100% \/snap\/canonical-livepatch\/164\n\/dev\/loop3                 9.0M  9.0M     0 100% \/snap\/canonical-livepatch\/146\n\/dev\/loop2                  64M   64M     0 100% \/snap\/core20\/1778\n\/dev\/loop4                  45M   45M     0 100% \/snap\/certbot\/2582\n\/dev\/loop5                 117M  117M     0 100% \/snap\/core\/14399\n\/dev\/loop6                  45M   45M     0 100% \/snap\/certbot\/2618\n\/dev\/sda1                  720M  164M  520M  24% \/boot\ntmpfs                      1.2G     0  1.2G   0% \/run\/user\/999\ntmpfs                      1.2G     0  1.2G   0% \/run\/user\/1000<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<p>Since <strong>this issue is not critical, but the emails can very quickly become very annoying<\/strong>, the best thing to do is to exclude all these loop devices from Zimbras monitoring. This can be achieved by running the following command <strong>as the Zimbra user<\/strong> (run <code>su - zimbra<\/code> as root):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">zmlocalconfig -e zmstat_df_excludes='\/dev\/loop0:\/dev\/loop1:\/dev\/loop2:\/dev\/loop3:\/dev\/loop4:\/dev\/loop5:\/dev\/loop6'<\/pre>\n\n\n\n<p>Update the command with the loop devices you see on your server. After this, <strong>restart the stat data collectors<\/strong> by running:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">zmstatctl restart<\/pre>\n\n\n\n<p>This should solve your issue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Tip<\/h2>\n\n\n\n<p>Upon restart of the server or over time you might find new\/different loop devices and the emails for these coming in again. If this happens, just run the above commands again updating the list of devices to exclude.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-small-font-size\"><strong>Zimbra Wiki:<\/strong> <a href=\"https:\/\/wiki.zimbra.com\/wiki\/Disable_Disk_Space_Monitoring_for_Loop_Devices\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.zimbra.com\/wiki\/Disable_Disk_Space_Monitoring_for_Loop_Devices<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently logged into the Admin mail account of a Zimbra mail server I manage to see if there was anything noticeable to look at. It&#8217;s not an account I log in much, since it &#8230;<\/p>\n","protected":false},"author":1,"featured_media":7040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[410,207],"tags":[639,1695,645,647],"class_list":["post-7037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-linux-en","tag-email","tag-linux-en","tag-open-source-en","tag-zimbra-en"],"acf":{"book_cover":null,"special_featured_image":null},"_links":{"self":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/7037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/comments?post=7037"}],"version-history":[{"count":0,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/7037\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media\/7040"}],"wp:attachment":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media?parent=7037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/categories?post=7037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/tags?post=7037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}