2

I have a fully working system which is on one of my SD-cards(#1). I would like to copy everything to another sd card(#2). There are a few problems here:

1) I don't know which version of NOOB or jessie I have. So I don't know which I have to download in order to fully replicate the system

2) The approach I'd like to try: download and install the same version of NOOB or jessie (I think I have tried them all so far...) and remove the kernel from #2 and replace it with the good kernel from #1 so I have two fully identical systems.

How can I find out which version of jessie or NOOB I have? Can I just replace the kernel with my own one? Should I only replace kernel.img or also kernel7.img?

I am aware that those are a lot of questions all at once, but I have tried may things so far....

Thank you

EDIT:

My good sd card is divided in 2 partitions (when using linux I can see that, I can't see that when reading the SD card from my windows system ). One with the kenel image and special files while the other partition contains the linux file system. I thus tried to just naively copy everything from both partitions. However my linux system prohibits me to copy the linux file system to the second SD-card.

ohiliouh
  • 23
  • 3
  • 1
    This all sounds *very complicated*. You're just trying to [clone one SD card onto another SD card](https://computers.tutsplus.com/articles/how-to-clone-your-raspberry-pi-sd-cards-with-windows--mac-59294) here right? Am I missing something? – goobering Apr 06 '17 at 22:54
  • Why are you trying to replace kernel anyway? – Milliways Apr 07 '17 at 00:12
  • 1
    @goobering I have an SD card of 16Gb and one of 32Gb. When I try to just clone the content of the sd card of 32 Gb is creates an image of 30Gb, which is too big for the sd card of 16 Gb... I tried Win32 but it crashes every single time when trying to read my sd card – ohiliouh Apr 07 '17 at 01:05
  • @Milliways how else could I do it? – ohiliouh Apr 07 '17 at 01:05
  • @ohiliouh What is "it"? This appears to be an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378). It seems you want to copy an image to a smaller card, so this is the question you should have asked. – Milliways Apr 07 '17 at 01:40
  • A unconventional way is to make a disc image with DD and [shrink it](https://softwarebakery.com/shrinking-images-on-linux). though you will need less than 14/15GB of data on your SD card. – Wilf Apr 14 '18 at 13:07

2 Answers2

0

Try the rpi-clone program. It can handle differently sized source/target. What I do is connect a USB card reader/writer to my RPi and then run this. It takes about 15 min for a 32GB card.

MartinMarty
  • 182
  • 5
0

The simplest method is to use the Win32DiskImager program.

It will Read a card to make an .IMG file containing the entire contents of the card. Restoring is just as simple as putting in a new card and clicking the Write command.

The program is OS and partition-agnostic. It simply works with entire images of the cards.


Note that this is simplest. For more demanding copies there are a couple of options, and both require the assistance of a Linux machine.

First is using dd to make a copy, so the source and target cards do not need to be the exact same size:

Win32diskImager "Not enough space on disk Size: 62652416 sectors. Available: 62333952"

Second involves actually mounting the .IMG file produces by Win32DiskImager and manipulating the internal partitions directly.

SDsolar
  • 2,208
  • 8
  • 24
  • 42
  • Does this work when cloning to a smaller card? – Wilf Apr 14 '18 at 13:06
  • 1
    Note my answer says simplest. What you want is not so simple, but can be done. Moving it to a smaller card can be done, but not with this program. Best is to actually mount the card into a Linux system then use the `dd` command to copy the partitions. Here is a Q&A where I run through the procedure: https://raspberrypi.stackexchange.com/questions/82347/win32diskimager-not-enough-space-on-disk-size-62652416-sectors-available-623 – SDsolar Apr 14 '18 at 18:28