I have a headless raspberry pi running Home Assistant and a bunch of other docker containers. It has been running on a 64GB SD for some time and runs fine, but very occasionally runs out of space due to accumulated downloads or similar.
I bought a new 256 GB EVO card, and am trying to clone the old one to the new.
On a linux laptop with SD reader, I did
sudo dd if=/dev/sda bs=1M of=pi-image.img
then switch the SD card in the reader to the new one and did
sudo dd if=pi-image.img bs=1M of=/dev/sda
When I insert the new card into the pi and power it on, I get a mass of messages, the final one of which is:
not syncing : no working init found. Try passing init option to kernel. see Linux documentation for guidance
I checked the cmdline.txt
file, and blkid for the root partition and they matched
I then tried e2fsck
on the new SD card, and there was a mass of errors on the rootfs that I tried fixing, but after re-inserting in the pi still the same errors.
I then tried:
e2fsck
on the original SD, no errors- formatted the new SD to a single, full size ext4 partition and ran
e2fsck
- no errors
So given there are no errors in the first part of the process, how can I clone the original 64GB SD to the new 256GB SD without resulting in errors?