aardbewoner
Posts: 2
Joined: Thu May 10, 2018 11:40 am

(Solved) How to shut down a rasp you cant connect to

Sat May 26, 2018 9:21 am

Simple How to shut down a rasp you cant connect to , as the ssh connection is refused.
Do put ssh in /boot and wpa_supplicant.conf .
That not start the wifi so added the rpi to a cable ,can ping the rpi .
So all that is left is pull the plug to power off ,and all WARN not to do that.
What else is there then ?
Last edited by aardbewoner on Wed May 30, 2018 7:08 pm, edited 1 time in total.

jbudd
Posts: 876
Joined: Mon Dec 16, 2013 10:23 am

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 1:52 pm

You have to pull the power yes.

It might corrupt the SD card.

However, since you have a Pi that you can't connect to, what do you lose if it does corrupt?

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 2:54 pm

Leave it quiet for a few minutes then pull the plug. If there is no activity any dirty blocks in the disk cache will have been written to the card and it its unlikely to interrupt a part completed write.
Should be fine most of the time.

W. H. Heydt
Posts: 10578
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 3:20 pm

I'd have to check to see what Raspbian does, but most Unix/Linux systems do a "sync" command every 30 seconds to write modified pages to "disk" (SD card in this case). So after 30 secs. of nothing running, there shouldn't be any write activity. The SD card may need to do wear leveling. If it does, that will be completed in a few seconds after the last write. Therefore, waiting for 1 minute should be enough time to quiesce everything to safely pull the power.

Plus, if it's running headless and you can't ssh into the Pi, then nothing will be running once the boot processes are complete and by the time you realize you can't access the Pi, you can pull the power.

gkaiseril
Posts: 627
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 5:41 pm

It is possible to add a shutdown button.

Adding a Shutdown Button to the Raspberry Pi B+ Element 14

There are also cases and shims that can add the shutdown button.

This assumes one can have physical access to the Pi.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 5:44 pm

W. H. Heydt wrote:
Sat May 26, 2018 3:20 pm
I'd have to check to see what Raspbian does, but most Unix/Linux systems do a "sync" command every 30 seconds to write modified pages to "disk" (SD card in this case).
Yes.
In fact I believe the default is every 5 seconds.
See the "commit" mount option to ext4.
Here is mine, I up it to 10 minutes because power cuts are rare here, and I am careful to shut the Pi down cleanly each time - and it obviously increases the performance.

PARTUUID=28873ee6-02 / ext4 defaults,noatime,commit=600 0 1

Ext4 has "extents" which are sections of contiguous blocks in the file and it uses "delayed allocation" to try to allocate as much contiguous space as possible while writing the file.
This does does not work well if the commit interval is too short.

hippy
Posts: 5587
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 6:20 pm

You could also short and hold the Reset input pad to 0V which will slam it to a halt before pulling power. That will stop any odd things happening while pulling power, as power collapses.

Note the two adjacent Reset pads can be shorted on all Raspberry Pi's except the 3B+ which has a different pad arrangement.

Not sure what risks or dangers there are in just pulling the SD Card out.

Tzarls
Posts: 224
Joined: Tue Feb 26, 2013 6:59 am

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 6:51 pm

If you have an USB keybiard you can try the following:
1. Plug the keyboard to the Raspberry.
2. Press this combination: control alt f1
3. Write this command: sudo shutdown - h now

If this works, after a few seconds you should see the activity led blinking 10 times, which means your Raspberry is off.

alphanumeric
Posts: 1903
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: How to shut down a rasp you cant connect to

Sat May 26, 2018 10:33 pm

I have two Pi A+'s running headless with no WIFI. I shutdown via a push button wired to GPIO with the shutdown coded in the python file they run on bootup via crontab. One never has the power removed (other than a power failure). I have another push button wired to the RUN terminals to turn it back on when I want to use it again. That Pi basically runs 24/7 but I occasionally want to tweak my code so I coded a shutdown option in to avoid corrupting my SD card.
The other A+ also runs headless but is portable with a battery. I do the shutdown with one button, then kill the power with a switch after that act led stops flashing.

aardbewoner
Posts: 2
Joined: Thu May 10, 2018 11:40 am

Re: How to shut down a rasp you cant connect to

Wed May 30, 2018 7:07 pm

Thanks all , as i have no easy access to it i use the wait and pull the plug.
The problem was the ssh file needed to go in the ext4 /boot.
So it works now :)

Return to “Beginners”