LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-18-2020, 04:19 PM   #1
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Rep: Reputation: 0
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
 
Old 10-19-2020, 09:08 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ^andrea^ View Post
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).
How can you know? Do you boot from hard drive also? Which OS? Why can't you dual boot from hard drive?

Quote:
Originally Posted by ^andrea^ View Post
For example I wonder, which part of the OS would be making the machine reboot?
In other cases I'd usually say ACPI.
In this case I'd say systemd.
 
Old 10-19-2020, 06:08 PM   #3
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
>> 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
 
Old 10-19-2020, 07:00 PM   #4
elucches
Member
 
Registered: Jan 2011
Posts: 108

Rep: Reputation: 11
Just guessing: did you try
Code:
systemctl start poweroff.target --job-mode=replace-irreversibly
, playing with the --force and --job-mode options?
 
Old 10-20-2020, 03:58 PM   #5
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
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
 
Old 10-20-2020, 04:49 PM   #6
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
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...
 
Old 10-20-2020, 06:33 PM   #7
elucches
Member
 
Registered: Jan 2011
Posts: 108

Rep: Reputation: 11
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.
 
Old 10-21-2020, 03:51 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ^andrea^ View Post
>> 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).
Sorry, but from my POV this completely invalidates your original statement.
 
Old 10-21-2020, 02:04 PM   #9
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
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
 
Old 10-22-2020, 10:40 AM   #10
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
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:
- 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
 
Old 11-07-2020, 06:58 AM   #11
linux_party
LQ Newbie
 
Registered: Oct 2020
Location: Deep in the clouds...
Distribution: iLinux OS - https://ilinuxos.com
Posts: 2

Rep: Reputation: 7
2 possible causes:

Degraded/Slow USB Stick.

Lack of specific Hardware Drivers.

Open Synaptic Package Manager and search "lenovo". Then Install all found Packages.
 
Old 11-07-2020, 03:07 PM   #12
^andrea^
Member
 
Registered: Mar 2011
Distribution: Arch Linux
Posts: 53

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shutting down an interface when another interface goes down deadheadblues Linux - Networking 2 11-17-2014 05:48 PM
Errors on shutting down (does not let shut down) Sefid par Linux - Server 1 03-09-2014 03:27 PM
Shutting down and non shutting down x windows golden_boy615 Linux - General 1 03-01-2010 06:28 AM
Shutting Down XFCE in Debian debianboy Linux - Desktop 5 05-04-2009 07:30 PM
shutting down computer does not auto power down... mmail75 Fedora 3 11-18-2003 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration