Previously, I always kept a clone of my SD card in case of a system crash.
Now I have an NVMe SSD and want to create something similar, using dd, among other methods.
I keep failing to create an image from the Advanced Terminal, even though I can see with id that I have root privileges. PuTTY hasn’t helped either.
Removing and reinstalling the SSD every time I need a backup isn’t practical. The built-in auto-backups aren’t sufficient because I’ve made certificates and some minor changes that probably aren’t covered by these Home Assistant-oriented backups. I suspect I accumulate these kinds of small changes. In the event of a system crash, I certainly won’t be fully aware of everything that’s been done. So, I want a system copy, like a cloned SSD, where I only need to install the latest updates, without having to worry about “what else was done…?” I’ve spent two days trying to clone a 256GB SSD to a 512GB USB stick using Bash scripts (dd, gzip, etc.). One of the problems is with dd. I also suspect Docker might be bottlenecking the process.
Does anyone have a solution or any ideas? I think my approach would be helpful to many. I regularly clone my Raspberry Pi’s SD cards/SSDs every six or three months.
Oh, and my setup is a Pi 5 running the latest HA OS.
My experience tells me that a crash is inevitable; it’s just a matter of time. I want to be prepared for it, rather than spending weeks later wondering what I’ve tried.
Any help is appreciated!
Maybe this helps to show the problem as a hint (run on advanced terminal secure mode deactivated):
➜ scripts dd if=/dev/nvme0n1 of=/dev/null bs=512 count=1
dd: can’t open ‘/dev/nvme0n1’: Operation not permitted
➜ scripts sudo dd if=/dev/nvme0n1 of=/dev/null bs=512 count=1
dd: can’t open ‘/dev/nvme0n1’: Operation not permitted
➜ scripts
One more question: can I install Partclone, is it persistent and usable? HA OS is very specific when it comes to extensions!
I have an RPI5 with an 1TB NVME SSD running HAOS on a QEMU/KVM virtual machine on top of Debian (Pironman 5). I wanted to do it that way (amongst other reasons) to be able to quickly create VM snapshots but the arcvhitecture does not allow it (aargh). Anyway, I also have a 1TB external SSD. I do use Google Backup from HACS etc. but from time to time I also boot the RPI from a Raspbian MicroSD Card, plug in the external SSD, and then use the SD CARD Copier to actually copy (clone essentially) the entire internal SSD onto the external SSD. Then if things go south I can just boot up from the external SSD as well.
The problem is that the SSD is installed in a Pi 5 case, and the case is barely accessible. Cloning the SSD isn’t an issue; it’s about efficiency. In one case, the case is difficult to open without breaking it. But thanks for the advice.
Nathan, if I knew exactly what was being saved, I could perhaps check if my changes were included. Is there a detailed description that specifies directories and files what is being backed up? Can I open the backup data and check, like in a browser (using WinRAR), whether the correct data is in the backup? If so, that would be the solution. The best solution. It’s the uncertainty that makes me want to clone the SSD. I haven’t made many small changes outside of the system. They are all documented. But my experience has also taught me that a lot can go wrong in the rush. A clone would be the “one-step solution” without many potential pitfalls.
Just make sure the backup is unencrypted so you won’t have to deal with encryption keys to open a local file.
PS - I can also confirm the entire SSL folder (including certificates) is included in a full backup.
The backup is hardware agnostic. You should be testing backups to ensure they are valid anyway.
You don’t need a massive vm just ‘able to boot’ I spin a VM on Proxmox using the community script then restore to that. It takes me about an hour and a half on my backup.Itwon’t be a daily driver. Set it up with minimal specs. We just need to prove the restore then you can kill the VM.
It practices the restore path and validates your backup at the same time. You also get to learn for sure if you’re missing anything like certs. (btw there’s a community app to load custom ca certs…) and solve those issues.
My main problem is this: I installed certificates intended to run scripts on another Raspberry Pi without logging in (SSH shell remote/done by persistent certificates ). I’ve had trouble keeping them persistent in Docker after a reboot. But now it seems to work. It’s been a while since I set them up. I don’t want to have to go through all the documentation again to remember how I did it. In case of a crash, everything needs to be done systematically and quickly. The more steps involved, the more prone to errors. Based on your advice, I’ll take my chances and hope everything works out. I still have a nagging feeling. A clone is easy to manage. That would have been my preferred solution. I’ll take a look at the community tool for certificates. I’d be grateful for more specific information on where to find it, and if there are several, which one I should look at.
Otherwise, I’ll just take my chances. Thanks to everyone for the advice.
One of the reasons i run my HAOS on a proxmox server. That way i’m able to make a full backup of the entire system. Downside is i have take care of the proxmox server itself but that is being used for multiple VM’s.
A big 1+ on that. My “production” is Proxmox, but I practice restoring there as well as on an Rpi4 from flashing a new SD.
Question: it would be handy to be able to do a restore but specify a different mdns name and also have a master off switch for automations (and perhaps scripts). When you practice restores on a backup machine how to you prevent the backup from conflicting or running automatons twice, etc.
I have not gone down the HA-HA cluster route, so I’m just doing manual restores to test. I shut down my main HAOS instance when do a test restore as I don’t want two machines running the same automations.
I also run my z-wave js instance on a separate machine. Having two HA instances connecting to that doesn’t seem like a problem.
So is mine (PrironMan 5), see the photo, I notmally boot up from the SSD as well. When I am booting up from the MicroSD I make sure nothing is running on the internal SSD, plug in an external one on a USB port, both are visible, and I then use the SD Card Copier (both appear there). No need to open any case.