1

I have 5 - 4B-4GB's and 1-8GB systems. One of the 4GB systems is experiencing an excessive shutdown (power off) time of 4.5 minutes. All the other systems take about 15-20 seconds, all my systems utilize the boot from USB. The 4GB one in question uses a 500GB SSD USB 3.0. I am using the shutdown option from the GUI. All systems are up-to-date.

Troubleshooting performed: Removed SDD and used a 32gb SD card, shut down took longer (5 minutes). I wager, that this is not directly related to the 500GB SSD. Ran Pi Diagnostics - SSD and SD card passed.

  • Added troubleshooting steps:
  • Swapped the SSD from the 4GB Pi to a 8GB Pi. The 4GB Pi still took about 5 minutes to shutdown with a different SSD. The 8GB Pi using the 4GB SSD shutdown in < 10 seconds.
  • Used sudo systemctl poweroff from the command line the outcome is identical as using the GUI shutdown - 5 minutes to shutdown - no messages were displayed.
  • Performing a Reboot does not take more than a few seconds, it is not affected by the problem(s) the shutdown has.

Trying to identify a process(es) that may be taking to long to perform an orderly shutdown or a process that shouldn't be running at all; but not understanding how the OS operates has its draw backs. I am not sure of next steps to try. I've searched online and the search engines are of little help.

I'd rather not rebuild the SSD as this just makes the problem go away without the learning process to add to my knowledge. Any help would be appreciated.

4
  • when you did the one trouble shooting, was that a fresh, unaltered, raspberry pi OS image? – Jaromanda X Mar 2 at 21:47
  • Does it do the same when you shutdown with the command line? If it does, does it say anything out of the ordinary? Maybe a stop job? – Unsigned_Arduino Mar 3 at 0:03
  • Do you see any messages on the command line if you use sudo systemctl poweroff? Does the USB3 SSD drive need also about 15-20 seconds to boot on another comparable system? – Ingo Mar 3 at 10:46
  • Thank you for the ideas @Ingo @Jaromanda `@Unsigned_Arduino Yes the OS's are the same. When I use the "sudo systemctl poweroff" from the command line the outcome is identical as using the GUI shutdown - 5 minutes to shutdown. Also after pressing enter on the command line, no messages are displayed and screen blanks immediately. Swapped the SSD from the 4GB Pi to a 8GB Pi. The 4GB Pi still took about 5 minutes to shutdown with a different SSD. The 8GB Pi using the 4GB SSD shutdown in < 10 seconds. – Korbendallaz Mar 3 at 16:48
1

Swapped the SSD from the 4GB Pi to a 8GB Pi. The 4GB Pi still took about 5 minutes to shutdown with a different SSD. The 8GB Pi using the 4GB SSD shutdown in < 10 seconds.

So this is clearly a hardware-related problem: the same SW performs fine on a different hardware (the 8GB Pi).

The first diagnostic step would be to run reboot -f: if that doesn't take 5 minutes, the problem is in userland processes, likely in systemd. If forced reboot is still long, it's likely a kernel/driver issue.

In both cases, running sudo dmesg -w in a terminal connected to a serial console will yield you the shutdown messages which are typically lost because they are issued when the file system is already read-only and log files cannot be written.

If the issue is systemd-related, boot with systemd.log_target=kmsg in /boot/cmdline.txt to collect systemd messages in the kernel log. If nothing useful shows up, try again with additionally systemd.log_level=debug log_buf_len=1M.

5
  • Thank you Dmitry for your ideas, I've been trying to create that serial console. I've searched the web and have found countless answers to that question, but have not gotten anything to work as described by the answers I found. At this time I have not been able to create a serial console to be able to capture messages during a shutdown.. I skipped ahead yesterday and setup the system messages input in the kernel.log. Shutdown the system, powered up located the kernel.log and was amazed on how large it was and of course not knowing what to look for as useful, left me scratching my head. – Korbendallaz Mar 8 at 20:19
  • Before trying countless answers, did you try the official doc? raspberrypi.org/documentation/configuration/uart.md But of course, you should analyze the kernel log you got so far, perhaps the relevant error messages are already there and there's no need for UART. – Dmitry Grigoryev Mar 9 at 9:43
  • Yes I have referenced raspberry.org (first one), but being able to submit proper phraseology for the problem is one of the issues. There are some very intelligent Pi users on there, but being able to talk their talk is the major problem on raspberrypi.org as I am discovering on Stack Exchange as well. I am actively trying to learn the Linux, terminology, the processes of the Raspberry Pi OS and the hardware. It takes time to do this. I appreciate your effort in making suggestions. But at this point in time I am so far in over my head. It was easier taking my certification exams for WinNT 4. – Korbendallaz Mar 14 at 16:23
  • @Korbendallaz To make it short, run raspi-config and enable a login shell on a serial. You will need another computer or Pi to collect the messages. But first (to reiterate) you should check the logs you already got. And BTW, I doubt that diagnosing such a problem in Windows would be easier. For instance, I once had a HW problem on Windows 10 computer, and never could really solve it. 1GB download (WDK) just to get a tool displaying kernel memory consumption and 4-letter module names look kinda crazy after Linux. – Dmitry Grigoryev Mar 14 at 16:59
  • I setup the kernel logs like you suggested also setup another Pi 's kernel log to compare to. Not knowing what I am really looking for I reviewed both kernel logs and didn’t find anything that might be construed as ‘out of the ordinary’. Did this review on numerous power downs over several days. Apologize for waiting a month to answer your comment but... – Korbendallaz Apr 9 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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