I have a working SD card which I want to back up to an
.img file and be able to quickly replicate.
dd to copy my image to my sd card:
dd if=raspbian.img of=/dev/sdc bs=4M
Which executes successfully. When I inspect the contents of the sd card afterwards everything seems ok, boot partition contains all necessary files etc..
When I try to boot I get the rainbow screen after which it starts the boot process, I assume, and it gets stuck at
sh: can't access tty; job control turned off
Nothing seems to be wrong with the original card, it works every time, so I spent about 5 hours trying to figure out what the issue was, reading through countless posts on here containing the same error which were all unrelated. I finally figured it out, I'm posting this in case I can save someone else's time in future.