Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

So finally I can place that bulk order for Raspberry Pis! However, configuring them is going to be a chore. What I'd like to do is:

  1. Download a stock image, and tinker with it on a single Pi
  2. Save/extract/copy that image to all the other SD cards
  3. Have the other Pi's all set up without any additional config needing to be done

My computer only has a single SD slot, so is there a way to generate a .img file from my modified 'master' card?

share|improve this question
4  
Tom check out this post raspberrypi.stackexchange.com/questions/311/… I think it answers your question. –  Steve Robillard Jul 16 '12 at 14:30
    
@SteveRobillard +1 That will answer the question perfectly. –  Jivings Jul 16 '12 at 15:22
4  
One thing to be aware of is SSH. If you set up SSH on the master you will end up with cloned SSH certificates on all of the images, which isn't necessarily what you want. OTOH, if you are going to be using the Pis headless, you probably do want SSH installed... –  darrenjw Jul 16 '12 at 17:06
    
@darrenjw That is an extremely good point. You've saved me some embarrassment and no mistake. Thank you. –  Jivings Jul 16 '12 at 19:28
add comment

6 Answers

up vote 4 down vote accepted

There are a couple of easy prep steps to do before writing a clone master to copies which will save you a lot of headaches.

  1. Configure the clone master for DHCP
  2. Delete everything in /etc/ssh/ssh_host* (these get recreated when you run SSHD)
  3. if you have an /etc/udev/rules.d/70-network* file, you'll need to modify the eth0 entry to something else (I used eth9 for my clone masters) - and remember to update the associated ifconfig file - in centos that is /etc/sysconfig/network-scripts/ifcfg-eth0 (make it 9) and in debian (raspbian) it's /etc/network/interfaces
share|improve this answer
add comment

You could use the Raspberry Pis themselves along with multixterm on your main computer to "boot strap" your SD card writing. You should be able to find multixterm in many distro's package managers.

Step 1: Buy a bunch of the USB stick SD card adapters.

Step 2: Use the standard methods to write 2 of the SD card images with your main computer.

Step 3: Put the 2 SD cards with images into 2 Raspberry Pis and get them connected to your network and powered up.

Step 4: Put 2 empty SD cards into the USB stick adapters and plug them into the 2 running Rapsberry Pis.

Step 5: Now here's where it gets interesting, from your main computer use multixterm like so from the command line multixterm -xc "ssh %n" host1 host2 where host1 and host2 are the ip addresses of the Raspberry Pis.

Step 6: Inside of multixterm's stdin window you can use dd as you normally would to write images to the SD cards but now multixterm will send that dd command to both Raspberry Pis simultaneously.

Step 7: Repeat steps 3-6 until you have all of your cards written.

The more SD cards you image the more Raspberry Pis you can use to image new SD cards. Obviously this technique won't write all of your cards in one go, but it would cut back on the amount of time it takes to complete writing all of the cards. This technique would be largely experimental so your mileage would vary, but the theory of it sounds like an interesting experiment...

share|improve this answer
    
Very interesting - but also very expensive for mass scale =) hehe love it. Is there no way to hyper thread writing images in different consoles to different USB SD adapters maybe? –  ppumkin Nov 1 '12 at 10:12
add comment

What you are looking for is a Gang Programmer device for SD cards, or SD Card Duplicator.

Yes, these systems do exist. Here is one that I found by Googling "sd card gang programmer". This specific device has a master slot, which it can copy up to 7, slave SD cards at once. Other programmers with 3 or 11 slave slots are also available.

There are also different types of programmers. Some can flash an image from your hard drive and is controlled by software installed on a PC. Other devices, like the one linked above, do not have to interface to a servers because they mirror the information off of a master chip.

It is worth mentioning that these devices are not cheap. They are typically used in a mass production environment and demand isn't excessively high. Be prepared to pay at least $1,000 for a good device with this functionality.

ProDuplicator.com appears to have quite a few more SD Card duplication options, as well.

share|improve this answer
add comment

We had a similar requirement for a project where we needed to be able to write images to 10+ Raspberry Pi SD cards on a daily basis. We looked at the various Card Duplicator's available to buy but found most of them won't successfully make a bootable SD card, as most only copy files directly and not the bootable information, they are also ridiculously expensive!

So as a solution we wrote our own simple web-based software to run on a single Raspberry Pi connected to 2 x 7-port Belkin powered USB hubs (The Pi has a limitation of 2 hubs, and a maximum of 14 USB ports).

We've now released this as Open Source software to help others who have the same requirement. Currently just the source code is available but we will also be uploading an image file based on Arch Linux ARM running Nginx + php

http://www.rockandscissor.com/projects/osid

share|improve this answer
add comment

Although How do I backup my Raspberry Pi? provides excellent instrictions on how to clone a single SD card, doing it one at a time for dozens of cards will get tedious.

Given that no-one seems to have produced a multi-card SD card reader (one that can hold multiple SD cards at once) and the fact that that you can buy a USB hub and a bunch of single SD card USB readers very cheaply, one way to speed up the process would be to make your own SD card duplicator.

You could even write a script to automatically write your chosen Raspberry Pi image onto any empty SD card slot inserted in a slot. Scripts could automatically detect that a card has been inserted and indicate when the copy completes.

As darrenjw mentioned in comments though, you will want to replace the ssh certificates in each of the cloned images the first time they are booted, so you may want to make sure that this first boot is done while connected to a private network segment before connecting it to an internet connected network.

share|improve this answer
    
You don't normally mount a card to flash an image onto it. –  Alex Chamberlain Jul 17 '12 at 12:26
    
Thanks @AlexChamberlain, I've still got a couple of weeks before my Pi is supposed to arrive (Grrr, if I'd known I was on an RS waiting list for a long lead time I would have just ordered from Farnell with a long lead time in the first place) so I haven't actually tried this yet. –  Mark Booth Jul 17 '12 at 12:34
add comment

There are usually better tool to do this, then to copy a lot of RP images.

But it depends on what you really want to do.

You should have a look at cfengine3[1], fai[2], chef[3], fabric[4] or puppet[5]. They are automatic configuration tools, which would be usefull for doing stuff in your machine when started first time (and later).

[1] http://cfengine.com/ [2] http://fai-project.org/ [3] http://www.opscode.com/chef/ [4] http://www.debian-administration.org/articles/671 [5] http://puppetlabs.com/puppet/puppet-enterprise/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.