{"id":2081,"date":"2018-07-25T16:10:29","date_gmt":"2018-07-25T16:10:29","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2081"},"modified":"2018-07-25T16:18:10","modified_gmt":"2018-07-25T16:18:10","slug":"ubuntu-unifi-server-running-out-of-space-on-run","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/ubuntu-unifi-server-running-out-of-space-on-run\/","title":{"rendered":"Ubuntu UniFi server running out of space on \/run"},"content":{"rendered":"<p>Had an issue that \/run was randomly running out of space which in turn would interfere with the unifi-video service causing it to run, but not record.<\/p>\n<p>\/run looks like a tmpfs or ramdisk that Ubuntu sets up.\u00a0 So you can do a &#8220;temporary&#8221; fix by remounting the tmpfs with a larger size.\u00a0 Example below.\u00a0 If \/run is a 2GB directory, you can remount changing the size from 2GB to 2.5GB.<\/p>\n<pre>sudo mount -t tmpsfs tmpfs \/run -o remount,size=2500M<\/pre>\n<p>Note that it is a temporary fix and goes away after a reboot.<\/p>\n<p>The issue ended up being that the WiFi UniFi controller was setup to auto backup everything once a week.\u00a0 So as it was backing stuff up, it would eat up the available space in the tmpfs, think there may be an issue with the size of the UniFi data and maybe not being able to fit it all in RAM?<\/p>\n<p>Running the following command<\/p>\n<pre>df -h --max=1 \/var | sort<\/pre>\n<p>shows the following<\/p>\n<pre>1.1M \/run\/udev\r\n2.5G \/run\/\r\n2.5G \/run\/unifi\u00a0\u00a0 &lt;-- UniFi controller\r\n4.0K \/run\/initramfs\r\n8.0K \/run\/network\r\n12K \/run\/user\r\n288K \/run\/samba\r\n404K \/run\/systemd<\/pre>\n<p>Looking inside the unifi directory shows the following folders.\u00a0 Looks like the they are temp files.<\/p>\n<pre>200M \/run\/unifi\/ExpTmp351719567129045774\r\n696M \/run\/unifi\/ExpTmp3406220793759111216\r\n1.6G \/run\/unifi\/ExpTmp3368400690321364109\r\n0 \/run\/unifi\/work\r\n2.5G \/run\/unifi<\/pre>\n<p>Running an ls inside the folder shows<\/p>\n<pre>-rw-r----- 1 unifi unifi 13971807 Jul 2 02:30 db.gz\r\n-rw-r----- 1 unifi unifi 1665223462 Jul 2 02:56 db_stat.gz<\/pre>\n<p>Looking inside the UniFi controller it is set to auto backup on Monday at 2:30AM<a href=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-2082\" src=\"http:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448-1024x508.png\" alt=\"\" width=\"584\" height=\"290\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448-1024x508.png 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448-300x149.png 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448-768x381.png 768w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448-500x248.png 500w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2018\/07\/Screenshot_20180725_105448.png 1246w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>Looks like &#8220;\/run\/unifi&#8221; is used as a temporary folder to create the backups and when it is completed converts it to a .unf file and moves it to &#8220;\/usr\/lib\/unifi\/data\/backup\/autobackup\/&#8221;\u00a0 So the left over temp files were never completed or something caused them to stop working.\u00a0 Maybe the backup was big enough to take up all the tmpfs space and cause the backup to fail.<\/p>\n<p>Resolution.\u00a0 To fix the problem I turned the data retention down to a week and deleted the temp files in \/var\/unifi.\u00a0 Had to sudo su to root.\u00a0 sudo wasn&#8217;t cutting it for some reason.<\/p>\n<pre>sudo su\r\nrm -rf \/var\/unifi\/Exp*\r\nexit<\/pre>\n<p>Should be all good now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had an issue that \/run was randomly running out of space which in turn would interfere with the unifi-video service causing it to run, but not record. \/run looks like a tmpfs or ramdisk that Ubuntu sets up.\u00a0 So you &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/ubuntu-unifi-server-running-out-of-space-on-run\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,370],"tags":[7,131,132,49,188,265,114],"class_list":["post-2081","post","type-post","status-publish","format-standard","hentry","category-ubiquiti","category-unifi-video","tag-linux-2","tag-ubiquiti-2","tag-ubnt","tag-ubuntu-2","tag-unifi","tag-unifi-video","tag-wifi"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2081"}],"version-history":[{"count":5,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2081\/revisions"}],"predecessor-version":[{"id":2087,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2081\/revisions\/2087"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}