Should I just pull the plug? Or is it best if I exit LXDE and any other running processes first?
|
You definitely don't want to just pull the plug this can cause problems with the SD Card and filesystem. From the command line or a terminal window you can enter the following to do a clean shutdown:
or from the LXDE GUI click the shutdown button (red power button) in the menu bar at the bottom right corner of the screen. then click shutdown. Once it says "system halted" you can remove the power cord if needed |
||||
|
|
|
It's best to always shutdown correctly if you can. Constantly unplugging the device without shutting down gracefully may have undesireable effects on the SD card (a temperamental object already). For reference, to shut down from the terminal you can use:
or
These commands send |
|||||||||||||
|
|
Other considerations aside, the power, and other, connectors will be designed for a limited number of insert/disconnect cycles. Often this is a surprisingly low number. Statistically connectors are a very likely source of equipment failure. With a view to the overall longevity of your Pi, you might want to moderate the number of connector insert/disconnects it experiences. One way of helping to do this would be to use the mains supply socket's on/off switch. |
|||||||||||||||
|
|
Raspberry Pi Shutdown Switch – Safely Turning off the Pi http://www.3cc.org/blog/2013/01/raspberry-pi-shutdown-switch-safely-turning-off-the-pi/ I followed the project above but set pin 17 to be internally pulled up. Then connect the wires like the above project but leave out any resistors and add the following python script in /etc/rc.local
shutdown_button.py :
|
||||
|
|
|
You don't really need a power switch for your raspberry. I use a usb hub for power supply that has on/off switches. So, whenever i want to turn off RPi, i just turn the usb switch off. |
|||||
|
|
There is also a GPIO board called the Pi Supply that has an on switch, power management and hard off for lock ups. Also useful if your plug is behind the TV and hard to get to. You still need to shut down normally but it then powers off the Raspberry Pi. Info Here If your concerned about wearing the power micro usb port out in normal usage you can get a male to female usb adapter and plug your power supply in to that. |
|||
|
|
|
This is not very hard. Go into the command prompt, type "Sudo halt", Enter your password if needed once there is nothing on the screen, pull the plug. Info from the rpi website |
|||
|
|
|
People who are just pulling power out from under their Pi's should really stop doing that. I've had two full Rasbian installs start kernel panicking because of corrupt file systems from improper shutdowns (eg. pulling the power). I had to re-image the card in both cases and re-do all the work I put in to configure it. |
|||||
|
sudo halt -pwill do it. – Thorbjørn Ravn Andersen Aug 1 '12 at 22:07