I have an install of home assistant that I would like to duplicate as it took me a while to build. Try as I might, I cannot do this, despite successfully doing it countless other times with other installs of Raspbian. I am using the dd command in the terminal on a mac computer. Are there any obvious reasons why this would not work that perhaps I am not considering? Or maybe there is an easier way to do this by migrating homeassistant over to a fresh Rasbian install…
I got fed up and started rebuilding everything from scratch, then promptly stopped because I realized that it is actually quite a bit of work.
If you have a windows PC you can try a free program called Macrium Reflect and that should allow you to create an IMG backup of the entire card which you can store for safe keeping and also image other cards.
I’ve had a similar issue in the past and not being able to backup my card and copy onto another card was not going to be acceptable. This, after all, my my disaster recovery plan, either from a failing SD card or just messing up my own setup.
Just like you, I used dd many other times prior to without any issues. This is what I found:
For some reason, with this install, I cannot use any other options that a plain dd command with only if= and of=. I used to have bs= as an option and just removing that option allowed me to backup.
If your new card is different (even from the same manufacturer and size) the restore will fail.I tried to copy to a new SD card that was identical to the first one, but read somewhere that some cards are a few bytes smaller and will not accept the full image. Your next best thing is to either resize the current partition or copy to a larger SD card.
Lastly if you are on a MAC, someone on this board directed me to an application called ApplePi Baker. That’s been working very well for backup and restores. I know that some of us would rather use the command line, but this app shows you the progress and gives you an estimate of the time remaining.
I used Etcher and the same brand / size SD card and it’s up and running!
edit to clarify: I already had the backup I made using the dd in terminal on my computer, I used etcher to create another disk image. The original is in a remote and temporarily unaccessible location, so I was glad this worked!