2

I am trying to make a Raspberry Pi image for my Boss that would be used in multiple pis. The Image would have a piece of custom software and configuration.

My first idea was to take an Image of an SD card and copy it over to any other SD card. However that is a problem as SD cards might have slight differences in size, even if they are the same manufacturer/model/and marketed size. And those slight differences can make the new image fail to print.

So how do I go about solving this problem?

user3346931
  • 277
  • 2
  • 6
  • 13
  • I'm sure you can have identical sizes as well. ie, 7.2 GiB image can (and should ) fit in any 7.2 GiB card. – dhruvvyas90 Oct 19 '15 at 10:46
  • We have 2 SD cards saying they have 4GBs on them, A and B. B is 50 KiloBytes larger then A. I can image A to put into B, but I can't image B into A. I want to make an image for A and B, and some sd I will have that could be x Kilobytes smaller then A. – user3346931 Oct 19 '15 at 11:11
  • In that case, there is a script to downsize img file of rpi which removes free space from img file to make it more compact preserving your actual / relevant date. Have a look at the comments on this answer : #1 and #4. http://raspberrypi.stackexchange.com/questions/32992/distributing-a-rasbian-image/32994#32994 Hope it helps. – dhruvvyas90 Oct 19 '15 at 11:16
  • Are you using Linux or Windows to copy the SD cards? If you're using Linux you should be fine if you create your "master" image from a 4 GB SD card and then simply copying that image to a larger 8 GB SD card. – HeatfanJohn Oct 19 '15 at 15:07

4 Answers4

2

Create a script that

  • creates two partitions on an SD card (FAT32 and ext4) (see HERE)
  • for each partition, copy the content from the original SD card to the new SD card
  • ???
  • profit

Pros:

  • can be used for SD cards of different size (as long as the "base" file system fits on it)
  • partitions sizes may be different on each SD card
  • different UIDs for partitions on each SD Card
  • data to be copied not (significantly) larger than when using dd

Cons:

  • unix only (?)
  • 5 commands (fdisk, mkfs.vfat, mkfs.ext4, copy 1st partition, copy 2nd partition) instead on one (dd)
user236012
  • 670
  • 5
  • 10
0

Make a image for small sized SD card and then take backup of that and write on any other SD card having same size or more size. And it is always preferred that you use SD card from same manufacturer.

0

As written a couple times before I'm a big fan of install scripts and would implement these at any deployment with less than a couple hundred Pi's.

Pros:

  • Versatile
  • Uses the original, official Raspbian image
  • Small footprint (kilobytes compared to gigabytes)
  • Easily maintainable, easily updatable, no need for creating a new image for that one small bugfix
  • Easy way of doing hardware asset control
  • Update scripts can be made using the exact same method
  • Eliminates potential problems with your SD card disk sizes, network card identification and filesystem expansion.

Cons:

  • None really.

The thing is most probably you'll need to login to the Pi at least once anyway. If your desktop can write extfs, you even can eliminate that first human login and run the setup script automatically.

I have used this method in real life to deploy hundreds of our Pi's and I'm very happy with the results.

EDP
  • 1,661
  • 1
  • 13
  • 24
0

Download win32DiskImager run it and select the sd card you want to copy select the save location by hitting the folder icon and then for the name type in theNameYouWant.img and finally hit read this will make a .img file that you can load onto any sd card that you want as long as the sd card is large enough to hold it. if you want to load the .img file onto a sd card hit the folder icon and select the .img file then select the sd card under the device tab and then hit write and it is done pop it into the raspberry pi and turn it on and you should be good to go.