3

I have one Raspberry Pi (3 Model B) with mostly working software. I will need 6 Pi's (same model) to behave similarly.

So I thought that it would be a grat idea to just clone 6 SD cards from working one and hope that all 6 Pi's will work fine.

However I expect that something can go wrong.

I know that use of Docker or something should be a better solution. But I don't have any experience with Docker and don't have any sufficient time to make this possible.

Questions:

1) So is cloning if SD card a good solution?

2) If not - what can be a better solution?

UPDATE

So, today I made it: I've cloned 5 8Gb cards from 1 master with Win32 Disk Imager software.

All Pi's worked fine for me. I wasn't able to check if everything was OK. But it looks completely fine. Each SD card took about 7 minutes to write the image, which is not very long but for production can be a pain.

UPDATE 2: important!

Today I made another 8 SD's for same Raspberri pi 3 model b. I didn't expect any problems. However, all 8 pi's didn't even flashes with LAN led's ☹️

I had to flash fresh Buster OS and repeat all setup. After that everything was fine.

So important peace of experience: cloning SD's can give a bad result

Roman Matveev
  • 405
  • 3
  • 14
  • Please don't answer your question in the question. Instead make an answer. You can just cut and paste it into the answer. After two days please accept your answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again after months. – Ingo Dec 06 '19 at 20:24
  • @ingo, that was not enough to be an answer. Today I had a lot of headache. I will do an update about this – Roman Matveev Dec 07 '19 at 19:49

3 Answers3

3

Given that you are time-constrained, I'd suggest that using the "SD card copier" function in "Accessories" is the path of least resistance.

In the future, you probably want to plan to build a "master image" and use some other tool to duplicate the image. I have had pretty good success with building my images on 8GB cards, then flashing them to bigger cards. To do that, you must set up the master to auto-resize on first boot, as follows:

Edit /boot/cmdline.txt and append "init=/usr/lib/raspi-config/init_resize.sh" to the first (and only) line. Here's a command to do that; you can use copy-paste to paste it right into the Terminal command line:

sudo sed -i '1{s@$@ init=/usr/lib/raspi-config/init_resize.sh@}' /boot/cmdline.txt

Create the "/etc/init.d/resize2fs_once" file. There are three commands below; the first one is a single, long line. Copy-paste them into Terminal one at a time.

sudo wget -O /etc/init.d/resize2fs_once https://raw.githubusercontent.com/RPi-Distro/pi-gen/master/stage2/01-sys-tweaks/files/resize2fs_once

sudo chmod +x /etc/init.d/resize2fs_once

sudo systemctl enable resize2fs_once

Shut down your Pi and remove the microSD card. Be careful not to boot the master card after you've set up auto-resize, or you'll have to do it again.

Now you can use a tool like HDDRawCopy to make an image file, compress it with something like 7Zip and make images as needed using something like balenaEtcher. You could also use something like ImageUSB to make multiple copies at once using a USB hub and multiple SD card adapters.

I've written more detail about the process here: https://ccse.kennesaw.edu/outreach/raspberrypi/duplicate_sd-pc.php

Bob Brown
  • 1,015
  • 7
  • 12
  • Could you be more specific with `"SD card copier" function in "Accessories"`? I didn't get wat is it: a software, a button in the RPi desktop, a peace of a hardware... – Roman Matveev Dec 03 '19 at 18:53
  • @RomanMatveev It's software that's part of Raspbian. Click the Raspberry... it's in the upper left corner if you have the standard desktop, then click accessories in the sub-menu, then SD card copier. – Bob Brown Dec 03 '19 at 22:47
  • I don't have a desktop. I will try to find cli for this – Roman Matveev Dec 04 '19 at 05:08
1

Cloning an image is quite acceptable. Indeed I use this to make images for my various Pi (although I use other techniques to keep them in sync).

The Answer discusses the merits of 4 different approaches.

The SD card copier is one of these, but not a method I would use to make 6 copies.

The technique I use is to make an image which can then be used to create SD Cards, similar to the initial installation.

Whatever method you use it is desirable to give each image a unique hostname, and it is a good idea to use unique PARTUUID.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • Saying "unique hostname fot each image" you mean 6 hostnames (in my case)? Each of these 6 Pis will work in the separate network. Moreover, if they would be in the same network, they will have different IPs. Isn't it? – Roman Matveev Dec 04 '19 at 05:14
  • 1
    @RomanMatveev If the Pi are in different networks and never communicate with each other you can leave the hostname as raspberrypi. It is still desirable to give each Pi a unique hostname. – Milliways Dec 04 '19 at 05:55
1

A little late to the gate, but anyway. I have had real good success in creating a backup image for my Pi using USB Image Tool 1.70, and then using balenaEtcher to burn the image to another SD Card. The reason I dont use the USB Image Tool to write the image is because in Win10 anyway, that wont work with the software. I cant run WinImage on Win10, so this way works well for me. 1.8 is here, I havent tried it yet: https://www.techspot.com/downloads/6355-usb-image-tool.html

Nothoro
  • 11
  • 2