Unplugging the power from a Raspberry Pi?

Discussion of all things Raspberry Pi / Raspberry Pi 2 related

Moderators: MattKingUSA, khz

Post Reply
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Unplugging the power from a Raspberry Pi?

Post by raboof »

For an on-stage/on-the-road device, you want to be able to unplug the power from the device whenever you feel like it. That is of course different from how you usually treat a linux computer.

Does anyone have experience with that? Do you choose a filesystem technology that is especially resilient? Or perhaps try to mount the filesystem in read-only mode entirely?
ash
Posts: 1
Joined: Sat Jun 13, 2015 6:41 pm

Re: Unplugging the power from a Raspberry Pi?

Post by ash »

Disconnecting the power at any random moment isn't healthy for your pi.
It only takes a few seconds to shut down anyway.
Also, it's no big deal to run the pi from batteries.
Hope this helps!

If you are interested -

Power switch:

https://www.raspberrypi.org/forums/view ... 40&t=48757

or

https://www.pi-supply.com/product/pi-su ... er-switch/

Reset switch:

http://lifehacker.com/5994036/add-a-res ... spberry-pi

Battery pack:

https://www.raspberrypi.org/forums/view ... 40&t=57868
colonel_panic
Established Member
Posts: 35
Joined: Tue Dec 26, 2017 6:16 am
Been thanked: 1 time

Re: Unplugging the power from a Raspberry Pi?

Post by colonel_panic »

Years and years ago, I tried to start a company selling computers develop a computer for use on board boats without access to the mains. They were very energy efficient for the time, passively cooled and based on the AMD Geode (basically a Pentium 2 class computer, running at 500Mhz).

One of the things I did to try and reduce power consumption was replace the PATA hard disk with a Compact Flash card, which you ran through an adapter. One of the selling points of these was the fact that they wouldn't be damaged in the same way as conventional PATA hard disks if the power supply was interrupted in the way you are thinking. In fact, the manufacturers specifically sold the adaptors for testing new systems; they booted an OS with them, left it running for a while, and didn't bother shutting it down. CF cards were a disposable price compared to hard disks at the time.

My understanding is there is potential for damage to a mechanical hard disk if you cut the power suddenly, but this is not so much a problem with flash memory. However, if you shut your computer down with applications running that have unsaved changes, you are likely to lose those changes, so it's better to shut the operating system down.

I think causing meaningful damage is unlikely, though ash's solutions are much more elegant.
User avatar
kbongosmusic
Established Member
Posts: 109
Joined: Sun Mar 06, 2016 9:14 pm
Location: Minneapolis

Re: Unplugging the power from a Raspberry Pi?

Post by kbongosmusic »

I've developed a few systems that could withstand power outage any time with linux. Flash obviously better than spinning hard-drive. Although the flash providers will warn you that you can get in a corrupt state with random shutdown, it rarely happens. Whereas spinning hard-drives I've had serious problems with in that regard. I arranged main working file system as read-only, and then separate rw disk/partition for select applications. I did x86, debian with custom setup, then voyage linux - which is essentially debian tweaked for embedded x86. This was a while ago, ext2 worked good. I would think rasberry pi would offer something similar, as this looks like the nice new embedded linux platform. Gotta love linux because you can build an appliance like this. All of the wi-fi routers are a working example. Screw windows/mac/android with their I own you mentality. Freedom rocks. Wish I had more time to play with stuff like this. Rock on. Let freedom reign.
stringrazor
Posts: 1
Joined: Thu Mar 15, 2018 8:16 pm

Re: Unplugging the power from a Raspberry Pi?

Post by stringrazor »

My R-Pi has been part of my stage gear for a year. Using mididings, you can easily build a script that take can use any MIDI message to trigger a shutdown. I've just been activating "wifi tethering" on my phone for a connection and using VNC to shutdown after rehearsals and gigs. I recently started playing with the GPIO and maybe a switch would be easier, but it has to be idiot-proof. I sooner risk crashing it after use than accidentally turning it off during a gig.
User avatar
flappix
Established Member
Posts: 50
Joined: Thu Jan 19, 2017 10:39 pm
Location: Germany
Been thanked: 16 times

Re: Unplugging the power from a Raspberry Pi?

Post by flappix »

I set up my Pi with a read-only rootfs. Normally, I shut it down the regular way but sometimes the power cable slide off or I'm too lazy and just quit the power connection. Until now I have no issues with it.
Post Reply