Page 1 of 1

Events - remote management and reimage

Posted: Sun Aug 31, 2014 2:54 pm
by pyrasanth
Hi,

I am fairly new to the Raspberry Pi but can see the huge potential. I have read about others running events to get kids into coding etc so I have teamed up with a charity to run some.

As I have been reading around I have started to realise the need to manage these things in terms of resetting them to a default image for each new group that comes in.

What I would like to do is create my own custom image and have it come up on the NOOBS install screen. That I think I can do...what I am having trouble with at the moment is resetting them to a clean state. I would like to do this for a batch of 10-20 remotely (by this I mean a Pi in the same room.)

I have considered a couple of options. One would be having a backup on the image that can then be restored - I had a look at dump and dd. The other was having a look at how to make the Pi reboot and then reinstall the custom image.

I am looking for a little guidance and help. Would either of these methods work? Is there a better one? I am aware I could walk around the room and do it manually :) It just seems there should be a better way.

Thanks in advance!

Re: Events - remote management and reimage

Posted: Wed Sep 03, 2014 2:39 am
by AndrewS
I guess you might be able to 'abuse' the silentinstall feature of NOOBS to do this?

Silent-install gets triggered when the card doesn't have a /dev/mmcblk0p5 partition (see here and here), so in theory you might be able to have a script that automatically
  1. SSHes in to a running Pi
  2. unmounts the boot partition (i.e. mmcblk0p5)
  3. uses a parted command to delete partition 5
  4. instructs the Pi to reboot
When the Pi reboots, it should then spot that /dev/mmcblk0p5 is missing and so auto-install the OS on the card again (assuming you've performed the other silentinstall setup steps).

I haven't tested this, so you'll have to do a bit of experimentation yourself. Would be interesting to hear if it works though :)

Re: Events - remote management and reimage

Posted: Wed Sep 03, 2014 6:28 am
by ghans
Another idea is to setup an LTSP server and using Pis
as clients , which would enable you to buy very small SD
cards and minimise the risk of corruption.

http://www.raspberrypi.org/forums/viewt ... 48&t=76862

ghans

Re: Events - remote management and reimage

Posted: Mon Oct 27, 2014 11:32 am
by pyrasanth
Hi, sorry I was working on some projects for an event I have just completed in Glasgow. The LTSP as I understand it would require a wired connection. Typically in the schools I am wanting to do this with we would go for wireless as its easier to deploy. So even though that is a cool option I don't think it works for me here.

I am going to have a go at the silent install option this week and will feedback on the result. I have been looking into backing up in various ways and then using that backup to restore to the original state. The constriction is it needs to be able to actioned remotely by the tutor and the backup be hosted on the local Pi.

The tutor doesn't want to walk round the room and reset 20-30 of them and we don't want any more HW than we need. Currently saving the classes work isn't priority.