23

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?

Tom Medley
  • 4,089
  • 8
  • 31
  • 46

2 Answers2

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?

Jivings
  • 22,538
  • 11
  • 90
  • 139
  • 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 02:11
  • 2
    @Ben you can't do this on the Raspberry Pi. You must use a separate machine. – Jivings Jan 15 '16 at 09: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.

Sohan Arafat
  • 1,828
  • 1
  • 10
  • 40