20

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?

23

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

Where 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:

How can I resize my / (root) partition?

  • 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! – Ben Jan 14 '16 at 17:30
  • @Ben The image is stored on disk at the path you provide via the of parameter. – Jivings Jan 14 '16 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? – Ben Jan 15 '16 at 2:11
  • 2
    @Ben you can't do this on the Raspberry Pi. You must use a separate machine. – Jivings Jan 15 '16 at 9:51
  • @Ben Could you not use a USB to SD adapter to hold the target card? – Bob Brown Apr 13 '18 at 16:40
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.