Home Assistant: moving a Pi 4 from SD card to SSD
The SD card lasted 26 months, which is honestly more than I expected with the recorder writing every few seconds. The signs were the usual: the database got malformed twice, and the history graphs had holes.
Order of operations
- Full backup from the Home Assistant UI, downloaded to a laptop. Then a second copy, because the first one was the one I would need.
- Update the Pi bootloader EEPROM so it prefers USB. On a 2020 board this took one
rpi-eeprom-updateand a reboot. - Flash the same HAOS image to the SSD, boot without the card, restore the backup. Twenty minutes, most of it the restore.
Two adapters did not work: both were the cheap ones without UAS. The one that works is the kind with a JMicron chip and a proper power supply. If the Pi shows undervoltage warnings, that is the adapter, not the SSD.
Afterwards I set the recorder to keep 10 days instead of the default and excluded a few chatty sensors. The database went from 3 GB to 400 MB and the graphs load instantly. Should have done that on day one.