Debian 10 on Lenovo not shutting down
Hi,
I have an old "lenovo m55e 9644" with debian 10 installed. I want to use it to backup some other systems. I don't want it to stay on 24/7 though, I want it to turn itself on (or maybe via WOL), take a snapshot of the other systems and then shut itself down. The issue I have is that instead of shutting down, it keeps rebooting itself and I don't understand why. All I know is that this only happens when there is a USB key plugged in. I can't remove the USB keys as that's where the OS is installed (mainly due to the low number of SATA ports). At first I thought this might be caused by something in the BIOS so I disabled/changed everything I could, like: Advanced: Legacy free - changed from "disabled" to "enabled" (no difference) Power: PCI Wake Up - changed from "primary" to "disabled" (no difference) Startup: Automatic Startup Sequence - changed from "enabled" to "once" (no difference) Advanced: Plug and Play OS - changed from "no" to "yes" (no difference) Power: ACPI BIOS RQ - changed from "9" to "x11" (no difference) I normally use "shutdown -h now" and what happens is that the power light goes off for just about a second, and then the machine turn itself back on. Any idea of what I could check to debug this from the software side, please? For example I wonder, which part of the OS would be making the machine reboot? Regards, Andrea |
Quote:
Quote:
In this case I'd say systemd. |
>> How can you know?
Take this with a pinch of salt if you like. I just remember having the same issue years ago, when first inserting a USB key (I can't remember whether the OS was installed on the USB key back then). >> Do you boot from hard drive also? I've never experienced this issue when booting from a hard drive. >> Which OS? I would say most things I use at home are Debian/Ubuntu. I remember using this for proxmox with OpenVZ (no KVM, as it does not have hardware virtualization). >> Why can't you dual boot from hard drive? I'm not sure why you ask, sorry. I don't need to dual boot. I just use this from the cli, no desktop environment installed. Since the motherboard has only two SATA ports (which I want to use for 2 drives in raid1), I'm using multiple USB ports with mdadm (in raid1 also) for the OS. Before anyone asks, I'm using "folder2ram" to prevent excessive writes to the USB keys. I'm just done some further testing right now. First of all I reset the BIOS to the default values, since nothing made any difference, and confirmed the issue was still there. Then I booted another OS (SystemRescueCD 6.0.2 - Arch Linux 4.19.24-1-lts), from another USB key and with all the current USBs still plugged in and "shutdown -h now" worked! The machine actually shut down. So it seems to be a sofware "issue" or at least some difference between the two OSs. Going back to the Debian 10 system, I've already tried to modify "GRUB_CMDLINE_LINUX_DEFAULT" in /etc/default/grub from: GRUB_CMDLINE_LINUX_DEFAULT="quiet" to one of these in turn: GRUB_CMDLINE_LINUX_DEFAULT="acpi=noacpi quiet" GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq quiet" GRUB_CMDLINE_LINUX_DEFAULT="acpi=off quiet" None of them fixed the issue and one made the system unbootable (can't remember which one it was now). If anyone knows what else I could try I'm all ears. @ondoho - what settings do I need to investigate for systemd please? and maybe where are they? Thanks, Andrea |
Just guessing: did you try
Code:
systemctl start poweroff.target --job-mode=replace-irreversibly |
At first I tried all the following with no luck:
init 0 systemctl start poweroff.target systemctl start poweroff.target --job-mode=replace-irreversibly systemctl start poweroff.target --job-mode=replace-irreversibly --force poweroff -f Then I found this comment: https://forums.linuxmint.com/viewtop...95951#p1395951 Here is the comment in case the link stops working at some point: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [..] # GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noacpi" # GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX_DEFAULT="reboot=acpi" # GRUB_CMDLINE_LINUX_DEFAULT="reboot=efi" # GRUB_CMDLINE_LINUX_DEFAULT="reboot=pci" # GRUB_CMDLINE_LINUX_DEFAULT="reboot=ahci" GRUB_CMDLINE_LINUX="" # GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" Originally, the 1st line worked with LM18.2. Then it stopped working. For awhile, the 3rd line worked. Then it stopped working, running LM18.2. Then the 2nd line worked. Then it stopped working, after upgrading from LM18.2 to LM18.3. Now, the 3rd line is working again. Try all of them, one at a time, then update-grub. [..] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For me, the first one that worked is: GRUB_CMDLINE_LINUX_DEFAULT="reboot=ahci quiet" Let's see how long it will work for (according to other comments these options seem to be a bit temperamental with kernel changes). Anyway, if anyone can shed some light on why "reboot=acpi" makes the system shutdown properly, it would be much appreciated. I'm going to mark this as solved for now. Thanks all, Andrea |
hold on, it worked 2/3 times in a row and then started failing again... maybe when I removed the USB keyboard, the VGA cable or the "quiet" option in the kernel.
Who knows. Or maybe it's just totally random.. lol :-D More debugging needed... |
I've just skimmed https://www.kernel.org/doc/html/late...arameters.html and there seems to be many things to try.
I've also found https://askubuntu.com/questions/1328...-of-a-shutdown, which you may have already read. Good luck. |
Quote:
|
I just don't remember experiencing this issue when booting from one of the internal SATA hard drives, but I do remember the issue when having a USB key in. That's all I remember.
Back then I did not investigate this far, now I'm doing my best to see whether I can get to a point where I can shut down the machine. I'll post back with progress as soon as I find out something new Thanks, Andrea PS: thanks for the resources elucches, I'm taking a look |
The other night when I thought it was solved and then it wasn't, was because I had unplugged the VGA cable.
Go figure! Here is what the machine looks like right now: https://ibb.co/6DnwJCh - Power cable - VGA - ethernet - 2 USB keys (for the OS) Nothing else, and nothing plugged at the front. And here is the grub settings which has been consistently working (tried 4/5 times so far): GRUB_CMDLINE_LINUX_DEFAULT="" Yes, with nothing in it. If I add "quiet" it breaks. It did not break with "reboot=ahci" but now I realise it made no difference, so I removed it. From my point of view, I can live with this. I'll get a VGA dummy plug for now, and report back in case of problems. Quick tip for the reader from the future. When changing the grub params, you need to do a complete reboot before testing. Like: 1) edit /etc/default/grub; 2) update settings with "update-grub"; 3) do a full reboot, so that the new parameters get loaded; 4) then you can test the shutdown procedure. Thanks, Andrea |
2 possible causes:
Degraded/Slow USB Stick. Lack of specific Hardware Drivers. Open Synaptic Package Manager and search "lenovo". Then Install all found Packages. |
thanks linux_party.
USB sticks I'm not sure exactly what you mean by "Degraded/Slow USB Stick.". The USB sticks are new Sandisk (https://www.amazon.co.uk/gp/product/B015CH1JIW/). Years ago, when I experienced the same issue, I had other USB sticks, so I don't think this is related to the USB sticks. Drivers That's very possible, I'm just not sure how to find what might be missing. There is no GUI so I can't use Synaptic but this is what I get from the cli: # apt-cache search lenovo acpi-support - scripts for handling many ACPI events aes2501-wy - userspace software for usb aes2501 fingerprint scanner brightd - daemon which regulates brightness of LCDs dynamically hdapsd - HDAPS daemon for various laptops with motion sensors thinkfan - simple and lightweight fan control program The only one which seems relevant to me is "acpi-support", so I installed it with all its dependencies (acpi-support-base acpid libice6 libsm6 libxaw7 libxcursor1 libxfixes3 libxi6 libxmu6 libxrandr2 libxt6) but unfortunately made no difference. If you have any other ideas let me know please. Regards, Andrea |
All times are GMT -5. The time now is 07:52 PM. |