Can you show me how you did it step by step?
You can find all the steps over there. Simply adding db_url: 'sqlite:///:memory:'
to recorder section in the configuration file will move the database to RAM.
Thanks a lot, but how to save the database in a secure place? It will be lost after every reboot if you use the RAM to save it. DO you use some script or stuff to do this?
I have absolutely no use for long-term data logging. At default settings the database wipes all 10 days old data anyway, and I have lowered it even further to 7 days.
If you need to collect long-term data from the sensors, you can always backup the data to external drive or cloud:
Memory db with cloud backup for analytics - Share your Projects! - Home Assistant Community (home-assistant.io)
Can you share your settings about recorder so i can understand better what you mean? My english is not so goodā¦
Guys can you please do this in another thread?
You are hijacking this one and it is already bloated.
Thanks.
When this discussion started here I replaced my SD for a SSD. After years of running without failures on a single SD card I wanted to get rid of the risk of a malfunctioning SD card. Everything went well till last week, couldnāt access HA anymore. First thought that my SDD died, had no spare SSD but at least with a SD card I could check that the PI was fine. Next day with a new SSD I wasnāt able to flash HA on itā¦ found out that the StarTech 2.5ā³ SATA to USB 3.0 Adapter didnāt work anymore. So if you ever run into troubles donāt forget to check your cable. Anyone else who had issues with this cable?
A good back up strategy must be to have a standby adaptor cable and SSD with a recent installation of HA. But is there a better way to allow a complete standby system which can be switched to online mode if the primary system fails to boot? Maybe with a stand alone (not integrated in to HA) power socket that can be turned on from the manufactures app in the event of the main system failing?
Question about the USB 3 signal interference - does this impact devices on the RP4 only, or does it also impact nearby devices?
I have my Hue hub in the same location, and I want to make sure the RP4 SSD addition doesnāt impact its signal.
It can impact any other radio receiver that is too close to the ports and uses the affected frequency range. This is definitely true for any ZigBee bridge like Philips Hue.
Thanks (and thanks for this guide too)! My understanding is that the interferences comes from both ends of the USB cable, so it would still cause interference if I move my SSD further away with a longer USB cable. Does it make sense to use the USB 2 ports for the SSD instead to avoid the interference?
I wouldnāt do that. Running an SSD connected through USB 2 will heavily reduce the max performance of the SSD.
Instead position your Hue bridge further away from the Pi and itās disk. RF signals lose power with distance squared: Doubling the distance will reduce the interference by a factor of 4.
First of all: Thank you very much for your work, @Jpsy !
For the files. I have had problems with booting from SSD. Got different warnings and error messages while the RPi was booting for ages. Tried this and that of what I have read here. Switchting from USB3 to USB2 port while connecting the SSD to the RPi has finally solved my issue. I definitely recommend to connect the RPi via HDMI to a screen/monitor. Yes, the SSD would perform even faster with USB3, but the speed increase by switching from SD card to SSD is already fast enough to me.
Hardware
- RPi 4b, 4GB
- SSD: Silicon Power SSD 128GB: https://smile.amazon.de/gp/product/B07KR25Q72/
- Case: Inateck SSD 2.5" SATA: https://smile.amazon.de/gp/product/B00IJNDBM4/
Home Assistant
- OS: 7.6
- Core: 2022.4.5
What controller does the inateck use? The issues that people ( a some group) were having with SSD lock ups were fixed December and released in January. This issues dealt with lockups.
Not booting almost always was a hardware issue with controller or SSD being incompatible with the RPI. I would search the RPI forums to see if your hardware is compatible. There are several good articles showing tested hardware.
This was super helpful, thank you.
One thing (that may be too unrelated to mention, but I didnāt realise at first) is that the headless option for setup (over SSH) now requires another file, userconf.txt with the username and encoded password for you to sign-in with. This can be generated by the Raspberry Pi Imager when flashing the SD card.
This was announced on 2022-04-07, and has details in the Raspberry Pi News update.
I didnāt realise before flashing, so just copy-pasted the default user/password from a pi-hole forum post by jgpi250:
pi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1
into a āuserconf.txtā file, alongside my āsshā file in the boot partition, and it worked like a charm.
Thank you so much for this great Guide! Especially keeping it up to date is really helpful! Switched to SSD-Boot with my RPi4 flawlessly. Took about 2hrs, and by now (3 Days) running with zero Issues!
What is your experience with SSD and Powercuts? I have my Pi running behind a UPS. Which is great, but draws about 110 KWh per Year. An Insurance im happy to pay, but if its more or less not necessary (any more), id love to skip it.
I donāt know how HassOS/HA on SSD behave with unexpected powerlosses. DB corrupt? Pretty possible. But would it reliable come up again, ready for restoring a Backup?
Iāve had no issues with mine after power cuts - RPI4 4GB + 250GB SSD.
Is TRIM a really big Thing, or can it rather be consider as ānice to haveā? In Case not, is there (as of July 2022) a Way to Check / Enable Trim on Home Assistant OS 8.2?
which brand of SSD it is?
I have issues with ADATA 250GB
@Jpsy thanks for the guide, Iām working my way through it, but got stuck on something.
I have an Argon One M.2 case for my RPi and the SSD. That seems to work fine (I can see the SSD from within RPi OS when itās loading from SD Card).
Unfortunately, it seems the M.2 expansion board cannot function as a SSD - USB for my macbook, which means I canāt image it using Balena for example. Can I image it directly from the Raspi OS? Any other tips (other than getting an extra SSD-USB) adapter?
Thanks!