1

I realized that the shutdown process for my RPi sometimes takes a while (like up to 1-2 minutes) before the green ACT LED finally blinks 10 times and the RPi can be unpluged safely. However I am looking for a faster method to shutdown the RPi. I found that there is command "sudo halt -f", which apparently halts the system immediately.

My question is, how safe is it to use the -f option with sudo halt? Can it lead to a corrupted SD card?

1
  • 2
    TLDR; no, you won't corrupt the SD card ... man halt describes the -f argument quite well, it also points you to look at the --force argument to systemctl - and man systemctl documentation explains the argument very well too - Commented Mar 14, 2021 at 20:51

2 Answers 2

1

Frankly, I do not understand why you have asked this question. If you will take even a glance at man halt, and read the description of the -f option, you will see:

-f, --force
Force immediate halt, power-off, or reboot. When specified once, this results in an immediate but clean shutdown by the system manager. When specified twice, this results in an immediate shutdown without contacting the system manager. See the description of --force in systemctl(1) for more details.

Note in particular the phrase results in an immediate but clean shutdown.

AFAICT, clean = no SD card corruption.

Have I missed something?

0
1

I have Pi that take a bit over 90 seconds to shut down although it seems longer.

If I do this on the Pi with a monitor the cause is obvious as it is waiting for a process to halt.

There is little chance of corruption if you pull power (provided the processor is not busy) and using forced halt should be safe - it just bypasses the wait, but still flushes the RAM to SD Card.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.