Skip to main content
3 of 3
code block formatting
Ghanima
  • 15.9k
  • 16
  • 63
  • 120

Turning RPi off safely and elegantly

Raspberry Pi 1 Model A running Raspbian Stretch Lite here. What's the preferred method for elegantly shutting down the pi (so that all services shut down correctly & safely, etc.)?

Looks like I have several options:

sudo shutdown -h now
sudo shutdown -P now
sudo poweroff
sudo halt -p
sudo init 0

Or I could just unplug the power and let it crash (I don't like this method).

Ideally my teardown procedure would be something like:

  1. When I'm ready to shut it down, SSH into the RPi
  2. Issue some command (see above -- any ideas?) to shut it down
  3. Wait for all the onboard lights to turn off
  4. Unplug the power (Micro USB) safely

Just wondering if there is a preferred/best practices way to go about this.

smeeb
  • 645
  • 3
  • 9
  • 22