The Gory Details
In the material that follows, code, i.e. things you will type as commands or put into files is shown in bold. These directions assume a small amount of familiarity with working in the Raspbian terminal environment.
Install a Little Software
You only have to do this once. Install Raspbian on your big microSD card and boot from it.
There are two bits of software you need that aren't a part of the standard Raspbian installation. Both software packages go on your large SD card. One is dcfldd, an extension of the dd command that performs the magic of writing multiple devices at ones. The other is PiShrink, which packages the fiddly operations of shrinking the image file and setting up the auto resize operation. Install dcfldd by typing:
sudo apt-get install dcfldd
in a terminal window.
Also in a terminal window, install PiShrink by Drewsif by typing these commands:
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
Make the Perfect SD Card
"Perfect" is a matter of application, and maybe even a matter of taste. For example, if you're going to use Scratch 2 in your classes, you can decide whether to include Scratch (1) or leave it out. Remember: Raspbian only, not NOOBS.
Make an Image of Your "Master" Card
Boot from the big microSD card. Make sure you have at least as much free space on the big card as the full size of your "master" SD card. (Erase old image files as needed.) In a terminal window, type the following:
sudo umount /dev/sd*
sudo dd bs=4096 if=/dev/sda of=myimage.img
sudo sync
Replace "myimage.img" with whatever you want to name your image file. I like to use something with a date, e.g. workshop_20180906.img. For a 16 GB card, this will take about 18 minutes on a Model 3 B+.
Shrink the Image and Set Up Auto-Resize
Use PiShrink to shrink the image and set up auto resize typing in a terminal window:
sudo pishrink.sh myimage.img
Replace "myimage.img" with whatever you called your image file. This will take only a couple of minutes. PiShrink has options for making a copy of the image file and suppressing the auto-resize function; you don't need them.
Make as Many Copies as You need!
Put the SD cards to receive the copies into USB adapters and plug the adapters into your powered USB hub. Plug the USB hub into your Raspberry Pi.
To make four copies, type:
sudo dcfldd bs=64k if=myimage.img of=/dev/sda of=/dev/sdb of=/dev/sdc of=/dev/sdd
Change if= to the name of the image you want to flash. To make more than four co
Duplicating SD cards with a Raspberry Pi
pies, add more of=/dev/sdX operands, where X is the next sequential letter.
This takes about eight minutes for one card. It may take as much as 24 minutes for 10 cards and USB 2. Relax and watch the blinking lights
More Pi Resources PC Instructions