cross-posted from: https://piefed.ca/c/selfhosted@lemmy.world/p/957754/local-homeserver-suddenly-not-responsive-to-ssh-but-can-be-pinged
Cross-posting this from Lemmy world where it seems my post coming from piefed.ca is not federating.
This is something that seems to happen randomly to my little RaspberryPi 4B homeserver, like once every few months maybe.
What happens is that out of nowhere (meaning I didn’t make any change to config or installation) I cannot reach any services I host on it (i.e. Jellyfin, Anchor notes…). I cannot access it via SSH at all, connection keeps timing out.
Ping however gives a signal. I can see/hear its running and doing something, since I hear the external HDD working. It is running headless and I have no monitor and/or keyboard I could connect.
So far my only way out is to just switch its power off, which is obviously not good for the hard drive. It has happened now like half a dozen times over the past few years, so I am wondering what a better way is to handle this. This was on RPI OS and now its happening on DietPi, so seems not related to the OS version.
I tried sending a shutdown signal via SSH but that also just times out, so how do I get it to shutdown properly?
Secondly, what kind of logs could I look at or start collecting to make sense of this?
gedfromgont@piefed.ca
povoq@slrpnk.net@slrpnk.net
ianhclark510@lemmy.blahaj.zone
dhork@lemmy.world 10 hours ago
This can sometimes happen if the filesystem has failed or is otherwise inaccessible. SSH needs to read config files and if it can’t, it fails to connect. It would try to write a failure to the log, but can’t.
Things that don’t require filesystem access, and can run totally from processes in memory interacting with hardware, would be fine. So your Ethernet stack works, and so does ping. A serial port would probably work. SNMP would work, too, for anything that doesn’t need to get a metric from the filesystem. I bet if you had a remote syslog server, you would get the logs that are falling out of your filesystem.
I think you might onto something with the filesystem. I am using Hd-idle to switch off the HDD when not in use. It was of course in use the entire time during this, but I noticed in the logs that it came up multiple times as “assuming disk spun up after long sleep” even though it hadn’t been off at all.
Only saw this after I made my post and I cannot make sense of it, but I have never seen this message otherwise, it only happened during this period of not being able to access the server.
Zwuzelmaus@feddit.org 7 hours ago
I have also seen a situation where ssh did not accept a connection anymore when the disk was full.