🛑Safe Shutdown Procedure for Raspberry Pi (Avoid SD Card Corruption)
Shutting down a Raspberry Pi by simply unplugging the power can easily corrupt the SD card.
To prevent data loss and keep your system healthy, always follow the proper shutdown steps below.
🔌1. Run the Shutdown Command
First, safely stop all running processes and unmount the filesystem.
sudo shutdown -h now
Alternatively:
sudo poweroff
Once executed, the Raspberry Pi will begin shutting down immediately.
đź’ˇ 2. Wait for the Green LED (ACT) to Stop Blinking
The green LED (ACT) indicates SD card activity.
- Blinking → The SD card is still being accessed
- Off or solid → No more write activity (safe state)
⚠️Important:
Do not unplug the power while the green LED is blinking.
This is the most critical step to avoid SD card corruption.
🔌3. Unplug the Power Cable
After:
- The green LED has stopped blinking
- The Raspberry Pi has fully halted
- You can safely disconnect the power cable.
✔️ Shutdown complete.
âť“ Q&A
Q: The red LED is still on — is it safe to unplug?
âś… Yes, it is safe.
Key Points
đź”´Red LED (PWR)
- Stays on as long as power is connected
- Does not indicate SD card activity
- Does not need to turn off before unplugging
- Turns off only when power is physically removed
🟢Green LED (ACT)
Indicates SD card access (this is the important one)
| State | Meaning |
|---|---|
| Blinking | SD card is being written to |
| Off/Solid | Safe to remove power |
✔️ If you have:
- Run
sudo shutdown -hnow - Confirmed the green LED has stopped blinking
- Observed that the Pi is no longer responding
→ It is completely safe to unplug, even if the red LED is still on.
📝 Summary
- Use sudo shutdown -h now or sudo poweroff
- Wait until the green LED (ACT) stops blinking
- Only unplug power after the system has fully halted
âś… Following this procedure helps prevent SD card corruption and keeps your Raspberry Pi running reliably.