3 ms·
I'm a bit confused. The article says "They’ve shared a script which forces the Raspberry Pi to run in read-only mode, so that powering it down via a plug pull w
by prophesi 9y ago
I'm a bit confused. The article says "They’ve shared a script which forces the Raspberry Pi to run in read-only mode, so that powering it down via a plug pull will not corrupt the SD card." - Is that not the same as an unexpected power down?
- mschuster91 9y agoThat's two different sources of corruption. The shared script prevents that the SD card is being written to - which means that the filesystem won't get corrupted due to half-written or inconsistently written data. The other source of corruption is the SD card's microcontroller which does not know that the SD card is being used in readonly mode and may do stuff like housekeeping, garbage collection etc. nevertheless - which might be interrupted by a power-out.
- deleted 9y ago[deleted]
- zaroth 9y agoIf you have the OS level setup for read-only access, can't you also flip a physical write-protect switch on the media at that point to defend against even that?
- joezydeco 9y agoThe write-protect switch on SD cards is not a physical break of a write line. It's merely a signal to the host saying not to write. A malicious or badly written driver can disobey it.
- mschuster91 9y agoNot only this - microSD cards don't even have a WP switch any more, and on full-size SDs the thing is more unreliable than worth the trouble...
- zaroth 9y agoI would have guessed a signal to the local microprocessor to stop any writes as well. Oh well. So would the solution be for the host, or some SD adapter, to provide a super-cap to ensure smooth shutdown of the SD unit as a whole?
- joezydeco 9y agoA supercap is indeed one way go to, but it's useless without a decent brownout detection circuit that doesn't freak out every time you lose an AC halfwave (happens more than you think).
- mschuster91 9y agoHmm. A supercap combined with a diode on 5V and a line to a GPIO from Vcc to provide enough time for the OS to shut down... like this (RPi GPIO) <-----------(resistor to 3v3)-| (RPi microUSB in) <-------------(diode <-)------+---- Vcc | Supercap (RPi GND) ----------------------------------- GND When the supercap is huge enough (or, for what its worth, use a powerbank with passthrough capability!), this should work - when the GPIO goes low, the system can initiate a safe shutdown, and especially it can signal a "shutdown" signal to the microSD.
- duskwuff 9y agoNot only that -- the part on the SD card isn't even a switch. It's a plastic nub that will (hopefully) activate a leaf switch inside the SD card socket.