{"id":7201,"date":"2026-03-14T12:00:00","date_gmt":"2026-03-14T12:00:00","guid":{"rendered":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/?p=7201"},"modified":"2026-03-15T08:57:04","modified_gmt":"2026-03-15T08:57:04","slug":"home-assistant-hosting-raspberry-pi-4-sd-card-failure","status":"publish","type":"post","link":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/?p=7201","title":{"rendered":"Home Assistant Hosting; Raspberry Pi 4; SD Card Failure"},"content":{"rendered":"\n<p>When I first started to properly explore Home Assistant with a view to moving to that, from openHAB, as the Home Automation &#8216;hub&#8217;, I wasn&#8217;t certain things would work out so I decided to host it on a Raspberry Pi 4 that I could re-purpose if required. I was aware the lifetime of the Pi&#8217;s Micro SD card storage would be limited, having had issues with SD cards wearing out when hosting databases previously, but I left that as a problem for my future self.<\/p>\n\n\n\n<p>About 15 months later it looks like the SD card has worn out. While Home Assistant&#8217;s control functionality is still working, Backups are failing and History data and graphs are missing. There are errors in Settings &gt; System &gt; Log like: <code>Unrecoverable sqlite3 database corruption detected: (sqlite3.DatabaseError) database disk image is malformed<\/code><\/p>\n\n\n\n<p>Now I&#8217;m settled on using Home Assistant, one option would be to host it on a more robust platform. (For example, I used to run openHAB in a Docker Container on an HP MicroServer.) For now though, I&#8217;m going to keep it on the Raspberry Pi 4 &#8211; albeit with a couple of improvements to the storage set-up:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>I&#8217;m going to use a <a href=\"https:\/\/www.sandisk.com\/en-gb\/products\/memory-cards\/microsd-cards\/sandisk-high-endurance-uhs-i-microsd\" target=\"_blank\" rel=\"noreferrer noopener\">SanDisk &#8220;High Endurance&#8221; Micro SD card<\/a> in the hope that will last longer<\/li>\n\n\n\n<li>I&#8217;m going to <a href=\"https:\/\/www.home-assistant.io\/common-tasks\/os\/#using-external-data-disk\" target=\"_blank\" rel=\"noreferrer noopener\">use an External Data Disk<\/a> &#8211; a separate USB 3.0 Flash Drive &#8211; to move the write-heavy transactions onto that other drive, which <em>should<\/em> cope a bit better (and possibly perform better too)\n<ul class=\"wp-block-list\">\n<li>A proper USB-connected SSD would be ideal but would need more power which <em>could<\/em> be an issue for the PoE-powered Pi 4 &#8211; and I&#8217;d prefer to keep using PoE so the power comes via the UPS<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>I downloaded the last successful automated backup. I did try Restoring to that but it didn&#8217;t work, tending to confirm the theory of the SD card being the issue.<\/p>\n\n\n\n<p>Installing HAOS on the new SD card then booting with that and importing the good backup when first prompted with the option to do that worked fine.<\/p>\n\n\n\n<p>We&#8217;ll see how long the new SD-card-and-USB-storage combination lasts this time. I do like the principle of running Home Assistant on a standalone machine &#8211; and I like the built-in &#8220;App&#8221; feature that comes with that &#8211; so as long as it lasts for a few years I&#8217;ll probably stick with the standalone configuration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I first started to properly explore Home Assistant with a view to moving to that, from openHAB, as the Home Automation &#8216;hub&#8217;, I wasn&#8217;t certain things would work out so I decided to host it on a Raspberry Pi &hellip; <a href=\"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/?p=7201\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[113,14],"tags":[],"class_list":["post-7201","post","type-post","status-publish","format-standard","hentry","category-home-assistant","category-home-automation"],"_links":{"self":[{"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7201"}],"version-history":[{"count":3,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7201\/revisions"}],"predecessor-version":[{"id":7206,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7201\/revisions\/7206"}],"wp:attachment":[{"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marshflattsfarm.org.uk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}