I try to clone my RPi SD cad to another one under Linux. Of course I created img file using dd command. SD card consist two partitions. First - bootable FAT formatted (small one) and second EXT4 formatted, approx. 4,5 GB size. I use 8 GB SD card and whole Raspian installation occupies less than 5 GB. The rest of card is empty.

I have 4 SD cards labelled as 8 GB from different vendors (Sandisk, Toshiba, Samsung and Kingston). But 8 GB from one vendor is not equal 8 GB from another. There are small differences in card size. I can restore 8 GB image file (using dd of course) to 16 GB card and it works properly. But it is practically impossible to restore 8GB card image from one vendor to 8 GB card from another because of small size differences.

My question is. Can I limit image file to - lets say - 7 GB and restore it to any vendor 8GB card? Or any other solution?

  • This question, or variants have been asked hundreds of times. There are many solutions on this site, but the EASIEST option is to use SD Card Copier on Raspbian, which will copy to any size card. (It may be a bit slower than dd, but faster than the more complex manual process of shrinking image). – Milliways Oct 23 '17 at 6:13
  • Yep. But my RPi works with graphic turn off, HDMI turn off and with all unnecessary apps removed. It is because it is use as industry measuring unit and controller. Because of that I want to clone SD on my Linux PC. So is any way to install SD Card Copier for Raspbian on Intel based machine running Fedora x86 and KDE? – mackowiakp Oct 24 '17 at 7:28
  • You could try adapting github.com/raspberrypi/piclone although one of the conventional approaches may be better. It isn't that hard to construct an image in Linux. – Milliways Oct 24 '17 at 7:45

Your Answer

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

Browse other questions tagged or ask your own question.