Shutting down a Raspberry Pi by simply unplugging the power can corrupt the SD card.
To avoid this, always follow the proper shutdown procedure.
π 1. Run the shutdown command
This stops all processes safely and unmounts the filesystem.
sudo shutdown -h now
You can also use:
sudo poweroff
Once executed, the Pi will begin shutting down immediately.
π‘ 2. Wait for the green LED (ACT) to stop blinking
The green LED indicates SD card activity.
- Blinking β SD card is being accessed
- Off or solid β No more writes happening
Do not unplug the power while the green LED is blinking.
This is the key step that prevents SD card corruption.
π 3. Unplug the power cable
After the green LED stops blinking and the Pi has fully halted,
you can safely disconnect the power cable.
Shutdown complete.
Q&A
Q: The red light is still on, is it okay to unplug?
Yes β itβs safe to unplug even if the red light is still on.
Hereβs the key rule:
β Red light (PWR)
Always stays on as long as power is connected
It does not indicate SD card activity
It does not need to turn off before unplugging
It only turns off when you physically remove power
β Green light (ACT)
This is the important one. It must stop blinking before you unplug.
- Blinking = SD card is being written to
- Off/solid = safe to remove power
So if you ran sudo shutdown -h now
- The green LED has stopped blinking
- The Pi is no longer responding
Then it is completely safe to unplug, even though the red LED is still on.
π Summary
- Use sudo shutdown -h now or sudo poweroff
- Wait for the green LED to stop blinking
- Unplug the power only after the Pi has fully halted
Following this procedure ensures your Raspberry Pi stays healthy and your SD card remains safe.