5

I have an SD card which has the image of Raspbian jessy for raspberry pi.

I currently have only a single SD card reader on my computer, and I would like to clone this SD card to another SD card only by using this reader.

Is there possibility to achieve this

5

you could use dd and your harddrive. I will give an example:

For the backup (with your rasbian jessy sd card in the reader, but unmounted):

sudo dd if=/dev/mmcblk0 of=/home/bruni/backup.img

For the restore, after you have unmounted and replaced the sd card with a fresh one:

sudo dd bs=4M if=/home/bruni/backup.img of=/dev/mmcblk0

Of course you will first have to verify that mmcblk0 is your sd card (to do this compare the output of df -h before and after you insert the sd card) and replace bruni with your username.

I use the above for backing up my raspberry pi kodi installation.

PS: Neither copy nor rsync will lead to a bootable sd card, which is what you want.

  • I'd there a reason (besides speed) you opted to use a block size of 4mib? – mikeymop Apr 19 '16 at 18:15
  • I have tried bs=1M and bs=4M and did not see any differences other than speed. Here is a question on how to calculate optimal block size stackoverflow.com/questions/6161823/…, but as I said never had any problems with 4M and therefore did not see a reason to optimize this further. – Bruni Apr 20 '16 at 6:32
  • will this work even if the replaced sd has a different size (for example, initial SD card 8GB, and I want to clone its content to a 16GB card because I am running out of space)? – Zorglub29 Mar 13 '18 at 10:31
  • @Zorglub29 It will work, but not as you intend. You will not gain the additional space. You will have wasted the additional 8GB. – Bruni Mar 13 '18 at 12:33
  • Any way to get this to work with a larger SD card? Maybe I should open a new question? – Zorglub29 Mar 13 '18 at 15:34
2

This can be done on the Pi. Using Piclone the Raspberry Pi can back itself up to an SD.

Menu > Accessories > SD Card Copier

Select the SD the OS is running from in the top box and the backup card in the lower.

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.