tadcampagna
Posts: 12
Joined: Thu Feb 07, 2019 1:29 pm

Read-only SD cards for school Lab?

Tue May 14, 2019 6:56 pm

We have a lot of issues with corrupted sd cards in our high school pi lab. A suggestion was to make all the sd cards read-only and save all work to a usb thumb drive. What does setting the sd cards to read-only do? Why might this have been suggested?

The students only use the Pi's for Arduino and Python coding.

I know they can run the Arduino IDE from the usb thumb drive, or at least I think they can.

Is there a problem with this, are there any suggestions?

epoch1970
Posts: 2772
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Read-only SD cards for school Lab?

Tue May 14, 2019 7:25 pm

An improper shutdown procedure can easily lead to the SD getting corrupted. In other words, if a student yanks the power cable suddenly from the Pi, the filesystem on the SD will probably be corrupted and will need repair at reboot. Rarely the FS is so badly damaged that automatic repair at boot time is not possible. Rarely as well, the SD can die altogether and need replacing.
With a read-only filesystem, corruption cannot happen as the system is immutable and the SD is only read from, never written. There might remain a small window where the FS needs to be set read/write and destroying the SD is possible, e.g. during boot or while upgrading the system.

Which OS are you running?
Raspbian/Debian is by and large not able to run off a read-only filesystem. You can change that (mostly) but it is a bit of work and might cause issues if you upgrade.
Something like piCore is designed to run off an RO filesystem. Very different from Debian/Raspbian. Excellent hardware support.

But in your case, perhaps piNet or piServer would be the best solution? Network booting, no SD at all (or a minuscule one that can really be read-only, just for holding the firmware files). Wired network required, though.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Gbaman
Posts: 147
Joined: Mon Jan 21, 2013 2:43 pm

Re: Read-only SD cards for school Lab?

Fri May 17, 2019 3:30 pm

It does certainly sound like PiNet (or PiServer) would be the answer here. I can only speak for PiNet, but in the case of PiNet the SD card image only used for the first ~5-10 seconds of boot, after which it is marked as read only. The main OS itself is then pulled over the network.

It of course comes with plenty of other benefits like each student having their own account that they can log in from any Pi in the classroom to access their files. Their files are stored centrally, making backups etc easier as well.

More info on PiNet can be found over at http://pinet.org.uk/
Lead developer of PiNet, a free and opensource centralised user accounts and file storage system for Raspberry Pi classrooms used in over 200 schools across the world.
http://pinet.org.uk

Return to “General discussion”