User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Mass SD Card Replicator

Sun Mar 25, 2012 10:17 pm

So the IT Teacher has just run his class with 30 raspi"s each with a standard build 4gb linux image on it. He"s got another class in 1 hours time and he"s got to reset all 30 SD cards back to the standard image because he has no guarantee that little Jonny or little Jane hasn"t corrupted/broke the image on any of his SD cards.

So how exactly do people see him achieving this?
In an ideal world he needs a combination of a multislot SD card reader/writer and some superquick re-imaging software.
Anyone got a solution?
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

john_wage
Posts: 156
Joined: Thu Mar 22, 2012 6:20 am
Contact: Website

Re: Mass SD Card Replicator

Sun Mar 25, 2012 10:35 pm

Each student pays for their own SD card that they are responsible for to bring to class

(which will be pretty cheap because of bulk orders & special offers that the school can set up with retailers)

And if one card gets corrupt the student gets to fix it (with teachers aid) - crash & learn.

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: Mass SD Card Replicator

Mon Mar 26, 2012 2:09 am

SN said:


So the IT Teacher has just run his class with 30 raspi"s each with a standard build 4gb linux image on it. He"s got another class in 1 hours time and he"s got to reset all 30 SD cards back to the standard image because he has no guarantee that little Jonny or little Jane hasn"t corrupted/broke the image on any of his SD cards.

So how exactly do people see him achieving this?
In an ideal world he needs a combination of a multislot SD card reader/writer and some superquick re-imaging software.
Anyone got a solution?



It is a good question.  The solution may be as John has stated to issue each one a SD card.  Here is the reason why I wouldn't re-image the card after each class... Write/Re-Write cycles.  It would cause these cards to pre-maturely fail.  I suppose one could write an application for looking for edited files and only fix broken stuff, but that is a lot of work.

Here is an alternative solution.  Put some type of boot-loader on each of the cards that would load the files from the eithernet jack.  Set the server to load from a network drive for each student when their Pi boots up.  Then have that server make copies of a known good image to those (in your case) 30 individual spaces upon first visit.  Then if the student hoses their image you just delete it and the next time they log in the server drops a new image in.

User avatar
riffraff
Posts: 307
Joined: Tue Sep 27, 2011 3:17 am
Location: Newnan, Georgia, US

Re: Mass SD Card Replicator

Mon Mar 26, 2012 4:36 am

@Jessie
"A" models for students don"t have Ethernet.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Mass SD Card Replicator

Mon Mar 26, 2012 5:45 am

The eeePC had a neat feature. If you pressed a certain key combination on start-up it would return to factory settings, including wiping out all your changes to the (sold-state) disk.

To do that it used a (standard Linux) copy-on write filesystem. The original filesystem was located on one partition and could only be written to with some fiddling. Most of the time writes went to a second partition. Then when the file was read back, the system would look on the second partition first, and only if the file was not there would it look on the first.

So to remove all the changes that had been made to the disk, all that was required was to format the second partition.

Don't worry about writing the SD card too much; with a write limit of 100,000 operations, you could format the entire SD 8 times a day for 63 years. The difficulties only come if something is writing many times per second.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Mass SD Card Replicator

Mon Mar 26, 2012 6:07 am

rurwin said:


<good stuff about copy on write>

The difficulties only come if something is writing many times per second.


*coff* syslog & /tmp *coff* - not that this hasn't been discussed before, and I would expect any sane distro that's expecting to run off an SD card to implement a rather different logging strategy to one that expects spinning hardware.

There are good reasons to want to create new cards, however; I can quite easily imagine a situation where a teacher would want to use different card images on a per-lesson (or similar) basis.  This could be worked around using a similar copy-on-write strategy, but with multiple "overlay" filesystems on the card, one per lesson plan, and a script to mount the relevant filesystem for the lesson.  With some care, it would be possible to keep the output of each lesson separate on the writable portion of the card (to avoid losing the student's work).  With an SD card issued to each student, this would mean mass duplication work would only be necessary *only* at the start of each school year / term.

Implementing something like this would be a very worthwhile project.

A more worrying issue is the "losability" of SD cards - they aren't very big.  I forsee more work in regularly backing up students work to a more permanent medium than in producing the cards themselves.

Simon

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Mass SD Card Replicator

Mon Mar 26, 2012 6:12 am

Why not just get a Multiple SD card replicator? A device that will take a master SD card and copy it to N other cards.  These devices exist and can be bought quite easily. A school that needs to do this a lot could easily justify getting this.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Mass SD Card Replicator

Mon Mar 26, 2012 6:36 am

Chris Rowland said:


Why not just get a Multiple SD card replicator? A device that will take a master SD card and copy it to N other cards.  These devices exist and can be bought quite easily. A school that needs to do this a lot could easily justify getting this.


A standalone duplicator for 30+ cards runs to around 200 RasPis ($5K or so).

welshblob
Posts: 134
Joined: Sat Jan 21, 2012 9:31 am

Re: Mass SD Card Replicator

Mon Mar 26, 2012 6:38 am

riFFraFF said:


@Jessie
"A" models for students don"t have Ethernet.


Buy model B's then? A PXE boot system does appear to be the best approach here although you still require an SD card. There is also a risk that the network maybe down and nobody can boot. So maybe a belt and braces approach is needed whereby there is a gold image stored on the SD cards themselves which allow, at boot, for it to be refreshed or for a new one to be dl over the network.

I still say that to keep your options open you need the b model.

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Mass SD Card Replicator

Mon Mar 26, 2012 6:56 am

But these 30+ replicators I've seen on ebay (at 3 and 4 thousand pounds too) seem to run at 600Mb/minute - so a 4Gb card refresh take less than 8 minutes.

It is an interesting subject this one, and not straightforwards it would seem…

I don't know whether this is possible with Linux but can you have some kind of 'journalled or differenced file system' if those are the right word – so only the delta (from a known good starting point) is written to the SD card and then resetting is done by simply deleting that delta – and including a microboot option in GRUB which allows the delta to be deleted and thus take you back to the known good starting point – I'm thinking something similar to the Microsoft Virtual PC's "differencing" virtual hard disks where its possible to run multiple images (at the same time) against a single VHD image, each VM having their own delta.

On the subject of loseability (which I agree with and also include stealability for schools) some solutions come to mind...

- some kind of elongated SD card with a hole in the top end into which a keychain and BIG keyring could be attached

- each SD card is numbered (with big indelible marker pen) and assigned to a child

- there is a need for a another type of proprietary lockable case (other than for the raspi itself) containing 30 SD card sized plastic slots in it - like the coin tray/slots you see in cars - in to which a set of SD cards can be inserted and safely stored

which leads me pack to raspi cases - there may even be a market for one which can take a laptop style lock down strap, again to prevent lightfingeredness
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Mass SD Card Replicator

Mon Mar 26, 2012 8:26 am

I'm no expert in this area but LVM may be the answer to the 'restore to a known state' problem

see http://tldp.org/HOWTO/LVM-HOWT.....intro.html

The key paragraph from that page I saw was this:-

In LVM2, snapshots are read/write by default. Read/write snapshots work like read-only snapshots, with the additional feature that if data is written to the snapshot, that block is marked in the exception table as used, and never gets copied from the original volume. This opens up many new possibilities that were not possible with LVM1's read-only snapshots. One example is to snapshot a volume, mount the snapshot, and try an experimental program that change files on that volume. If you don't like what it did, you can unmount the snapshot, remove it, and mount the original filesystem in its place.

just replace the words "experimental program" with "classroom work"

anyone care to comment?  do we have LVM2 on any of the raspi distro builds?
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

plugwash
Forum Moderator
Forum Moderator
Posts: 3658
Joined: Wed Dec 28, 2011 11:45 pm

Re: Mass SD Card Replicator

Mon Mar 26, 2012 1:06 pm

I dunno if the standard images (both kernel and userland, you need both for LVM to work) include LVM but if not it should be pretty trivial to add it.

You'd also have to figure out how you were going to handle the boot choices (maybe use kexec with a linux based menu?) since the Pi doesn't have a conventional bootloader.

tech_monkey
Posts: 130
Joined: Fri Mar 09, 2012 6:12 pm

Re: Mass SD Card Replicator

Tue Mar 27, 2012 9:07 am

or why not make it the first project for the students. How to clone 30 SD cards in the shortest possible time.
http://www.casatech.eu

hippy
Posts: 8227
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Mass SD Card Replicator

Tue Mar 27, 2012 11:12 am

riFFraFF said:


"A" models for students don"t have Ethernet.


I've got a cable that lets two USB host PC's connect as a TCP/IP network over USB which works for Windows and there may be something equivalent for Linux. Using two R-Pi's with crossover GPIO UART connections it should be able to create a network, SLIP, PPP or even a proprietary serial protocol just used for card copying.

For ease of use in restoring a trashed OS I think the approach of having a separate 'read only partition' on SD card to restore from would be best. That saves needing a second PC to restore an R-Pi and protects from the potential dangers of 'dd' misuse and digging oneself into an ever deeper hole.

Being unbrickable is a strong and fundamental USP, and making it trivial to unbrick would definitely be an opportunity that shouldn't be missed. The further from trivial it is the more it is likely to hinder unbridled enthusiasm to experiment.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Mass SD Card Replicator

Tue Mar 27, 2012 12:04 pm

What about having the SD cards boot from the network? Then all of the students' work can be saved with a single back-up. A fairly trivial server application would serve the correct image for the current lesson and also take a roll-call of RaspPis. So if someone at the back of the room is booted off his Quake 3 SD, the teacher will know.

So we would need a single SD card that contained just enough to allow the network boot to start... or maybe the /boot and /bin directories are on the SD card and the /usr and /home directories are on the network. That's a standard Linux use-case.

And since we only need a single SD card, it can be inside the case, behind tamper-proof screws.

Prometheus
Posts: 308
Joined: Tue Dec 13, 2011 11:09 pm

Re: Mass SD Card Replicator

Tue Mar 27, 2012 2:30 pm

rurwin said:

And since we only need a single SD card, it can be inside the case, behind tamper-proof screws.

Not *too* serious, here, but: If they have internet access in some location or other, you just know that some smart-alec will be hitting the various low-cost tatmongering websites in order to find the relevant screwdriver to get past those.

User avatar
mihalop
Posts: 28
Joined: Thu Sep 03, 2015 7:04 am
Contact: Website

Re: Mass SD Card Replicator

Tue Jan 26, 2016 10:55 pm

I know this is an old post, but i thought I'd share it here.

We have built a project using RPis, where we need to restore the whole SD card image from a USB drive upon boot, just like a "firmware" on a traditional embedded device. We did it on Raspbian by providing an initramfs image with a (rather complex) script that scans all available USB drives for the "firmware" file and writes the contained image file on the SD, essentially replacing itself.

This could be easily extended to fetch the image file from the network and write it on boot.

Would someone be interested in that? If indeed one would, I can share a blog post as soon as it is ready.
Yodeck - Digital Signage on the Raspberry Pi
Free Raspberry Pi 3 Player for all screens on Annual Plan

ghans
Posts: 7883
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Mass SD Card Replicator

Wed Jan 27, 2016 8:09 am

• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Other projects”