I started out with a 2GB SD card, but I'm finding this a bit cosy, so I've bought a 16GB card to replace it. With a single Pi, can I transfer all my work between the cards, or do I need to start from scratch?
You should be able to copy the image, using the same application you flashed it with (or the
dd command in Linux):
dd if=/dev/sdx of=/path/to/image
sdx represents the SD card.
This can then be flashed onto the new SD card just like the original one:
dd if=/path/to/image of=/dev/sdx
For more information, see this question:
How do I backup my Raspberry Pi?
And you can see how to increase the size of the image here:
Does this require you to have access to the two cards simultaneously (eg to have a second card reader attached)? If not, I assume the image is stored in RAM until it's written to the new card. So, what happens if the original image is larger than the amount of RAM you have available? Thanks!– BenJan 14, 2016 at 17:30
@Ben The image is stored on disk at the path you provide via the
ofparameter.– JivingsJan 14, 2016 at 17:33
Thanks for the response but I'm still missing something here. Does this mean that I need to have both SD cards (i.e. two disks) connected to the pi simultaneously?– BenJan 15, 2016 at 2:11
2@Ben you can't do this on the Raspberry Pi. You must use a separate machine.– JivingsJan 15, 2016 at 9:51
@Ben Could you not use a USB to SD adapter to hold the target card? Apr 13, 2018 at 16:40
There is an app pre-installed with raspbian that can copy the whole sdcard into a new sdcard through USB. The name of the app is sd card copier. It can be found in accessories.