2

I have a 8 GB SD card (card 1) installed with embedded Linux for PowerPC, libraries and some applications. I want to prepare another 8 GB SD card (card 2) exactly like card 1. What is the easiest way to do this?

I tried copying all the files from card 1 to a Linux laptop and then from the laptop to card 2, but I am getting some permission denied errors in spite to doing this as root. Is my approach correct? Please suggest any other techniques.

Jay
  • 311
  • 1
  • 3
  • 20

1 Answers1

9

What about dd? You can use it to do a 1:1 copy of your SD card to a new one:

dd if=/dev/<your_old_sd_card> of=/dev/<your_new_sd_card>

Or to copy it to a file:

dd if=/dev/<your_sd_card> of=/a_file.img
Vinz
  • 2,150
  • 14
  • 16
  • I have a single SD card slot. What should I use to transfer the img to the sd card 2? – Jay Feb 12 '14 at 13:09
  • 2
    Use a greater block size (e.g. bs=1M) to speed up the transfer. You can use dd if=/dev/<your_sd_card> of=/path/to/file to copy the sd card to an imagefile and then after plugging in your new SD card: dd if=/path/to/file of=/dev/<your_sd_card> to copy the image to the SD card – jofel Feb 12 '14 at 14:20
  • The 1M blocksize should be enough, as long as you don't use the default blocksize (when not specifying the bs option). Anything bigger than 1M does not make a significant difference. http://unix.stackexchange.com/questions/9432/is-there-a-way-to-determine-the-optimal-value-for-the-bs-parameter-to-dd – captcha Mar 08 '15 at 23:59
  • @Vinz How can you estimate how much still command will take time on your SD card? I want to evaluate how much it would take with 500GB discs, ..., 5 TB discs in cloning. – Léo Léopold Hertz 준영 May 11 '16 at 08:52