LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Laptop poweroff abruptly…ONLY ON LINUX (https://www.linuxquestions.org/questions/linux-newbie-8/laptop-poweroff-abruptly%85only-on-linux-4175625405/)

Fernandezz 03-12-2018 07:39 AM

Laptop poweroff abruptly…ONLY ON LINUX
 
I bought a new SSD and a battery for my laptop (Thinkpad W520) recently and installed Linux.

Everything works fine when running on AC. However when I try to boot the system on battery the system shutsdown abruptly without warning anywhere between grub and the desktop. However, if I boot the system with AC power and run on the battery it's stable and works fine.

Same system on a different hard drive boot and runs perfectly well with Windows. That confirms that the problem lies in the Linux OS (configuration?, kernel?) not in the hardware. What might be causing this problem? Any help much appreciated!

BW-userx 03-12-2018 08:06 AM

AC = alternating current = the plug
DC = direct current = the battery.

you state you got a "new" battery. How much did it cost? $50 ~ 100 US Dollars? if less then the big chance is you got a "new" battery Old stock. with the batteries today they start to deprecate as soon as they are made. So the life expectancy is already becoming shorter before they're even put inside of the box to be shipped to the store.

So if you're saying I can boot up on AC but as soon as I unplug it Linux shuts off, it may be because you're battery is relatively old even though it may have came in original packaging. Therefore it is not holding a charge let alone actually being charged to the original 100 percent that is suppose to give you that 4 to 8 hours of battery life. Even though it maybe telling you it is charged 100 percent the "cells" do not actually hold a charge that will last as long as a "new" freshly made battery will.


send it back would be your best best.

also how long does Windows last on your battery?
the power settings on when to shut down depending on percent of battery power might be looked into as well.

AwesomeMachine 03-12-2018 09:02 AM

If the laptop shuts down on battery power but not on AC power, it tells me the battery is delivering less power than the AC. Try running the battery down as far as it will go, charge it up again for a good 10 hours with the laptop off. Then try it again.

rokytnji 03-12-2018 09:13 AM

Quote:

Same system on a different hard drive boot and runs perfectly well with Windows. That confirms that the problem lies in the Linux OS (configuration?, kernel?) not in the hardware. What might be causing this problem? Any help much appreciated!
Don't know what the problem is. Not enough info. So far the replies are hardware related. Not software related.

Maybe dmesg might say something in /var/log. Just to show what is in my /var/log

Code:

harry@biker:~
$ cd /var/log
harry@biker:/var/log
$ ls
alternatives.log      bittorrent      debug      dmesg.3.gz            kern.log      messages.4.gz          slim.log.1  syslog.4.gz    wicd
alternatives.log.1    cli-aptiX.log    debug.1    dmesg.4.gz            kern.log.1    partimage              slim.log.2  syslog.5.gz    Xorg.0.log
alternatives.log.2.gz  ConsoleKit      debug.2.gz  dpkg.log              kern.log.2.gz  pm-powersave.log      slim.log.3  syslog.6.gz    Xorg.0.log.old
apt                    cups            debug.3.gz  dpkg.log.1            kern.log.3.gz  pm-powersave.log.1    slim.log.4  syslog.7.gz
auth.log              daemon.log      debug.4.gz  dpkg.log.2.gz          kern.log.4.gz  pm-powersave.log.2.gz  smxi.log    user.log
auth.log.1            daemon.log.1    dmesg      fontconfig.log        messages      pm-suspend.log        syslog      user.log.1
auth.log.2.gz          daemon.log.2.gz  dmesg.0    fsck                  messages.1    pm-suspend.log.1      syslog.1    user.log.2.gz
auth.log.3.gz          daemon.log.3.gz  dmesg.1.gz  hp                    messages.2.gz  samba                  syslog.2.gz  user.log.3.gz
auth.log.4.gz          daemon.log.4.gz  dmesg.2.gz  init.d-networking.log  messages.3.gz  slim.log              syslog.3.gz  user.log.4.gz

Code:

lshw
and
Code:

upower -d
may give some helpful also as well as

Code:

acpi -b

rokytnji 03-12-2018 09:16 AM

Also. Not all hardware is equal sometimes. I bought a charger that freezes the touch pad when plugged in. This stuff happens sometimes. My solution to this ? I run a external wireless usb mouse when on the charger. It is a hardware problem though. Not software. Freezes in Windows also. Freezes in Android.

Fernandezz 03-12-2018 03:38 PM

@ rokytnji

Output of /var/log:
Code:

alternatives.log  faillog                    preload.log
apt                  fontconfig.log            speech-dispatcher
aptitude          gdm3                            syslog
auth.log          gnustep-back-common.log  syslog.1
auth.log.1          gufw.log                    syslog.2.gz
battery-stats          installer                    syslog.3.gz
battery-stats.csv  kern.log                    syslog.4.gz
bootstrap.log          kern.log.1                    unattended-upgrades
btmp                  lastlog                    user.log
daemon.log          libvirt                    user.log.1
daemon.log.1          messages                    wtmp
debug                  messages.1                    Xorg.0.log
debug.1                  pm-powersave.log            Xorg.0.log.old
dpkg.log          pm-suspend.log            Xorg.1.log

Output of upower -d:

Code:

Device: /org/freedesktop/UPower/devices/line_power_AC

  native-path:          AC
  power supply:        yes
  updated:              Mon 12 Mar 2018 04:10:12 PM EDT (1070 seconds ago)
  has history:          no
  has statistics:      no
  line-power
    warning-level:      none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:              LGC
  model:                42T4848
  serial:              23368
  power supply:        yes
  updated:              Mon 12 Mar 2018 04:26:13 PM EDT (109 seconds ago)
  has history:          yes
  has statistics:      yes
  battery
    present:            yes
    rechargeable:        yes
    state:              discharging
    warning-level:      none
    energy:              41.22 Wh
    energy-empty:        0 Wh
    energy-full:        85.64 Wh
    energy-full-design:  84.24 Wh
    energy-rate:        21.188 W
    voltage:            10.669 V
    time to empty:      1.9 hours
    percentage:          48%
    capacity:            100%
    technology:          lithium-ion
    icon-name:          'battery-good-symbolic'
  History (rate):
    1520886373        21.188        discharging

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:        yes
  updated:              Mon 12 Mar 2018 04:26:13 PM EDT (109 seconds ago)
  has history:          no
  has statistics:      no
  battery
    present:            yes
    state:              discharging
    warning-level:      none
    energy:              41.22 Wh
    energy-full:        85.64 Wh
    energy-rate:        21.188 W
    time to empty:      1.9 hours
    percentage:          48%
    icon-name:          'battery-good-symbolic'

Daemon:
  daemon-version:  0.99.4
  on-battery:      yes
  lid-is-closed:  no
  lid-is-present:  yes
  critical-action: PowerOff

Thank you!

rokytnji 03-13-2018 07:27 AM

I thought you might be able to poke around in dmesg file to see what it had to say. But I see no /var/log/dmesg file.

What does

Code:

harry@biker:~
$ uname -a
Linux biker 4.15.5-antix.1-amd64-smp #2 SMP PREEMPT Fri Feb 23 12:27:47 EET 2018 x86_64 GNU/Linux
harry@biker:~
$ cat /etc/issue
Welcome to antiX. Powered by Debian.
harry@biker:~
$

Have to say since you left out what version of Linux you are running.

sundialsvcs 03-13-2018 07:40 AM

If the machine shuts down every time and at the same point in the boot process, and never actually finishes booting, then you'd be looking at some very obscure mis-configuration between Linux and your battery controller. There is a poweroff capability that is normally used when Linux finishes shutting-down on a laptop, and maybe that underlying facility is behaving wrongly. But, I must say, I think that the chances of this are very remote.

Fernandezz 03-13-2018 09:31 AM

Quote:

Originally Posted by sundialsvcs (Post 5830453)
If the machine shuts down every time and at the same point in the boot process, and never actually finishes booting, then you'd be looking at some very obscure mis-configuration between Linux and your battery controller. There is a poweroff capability that is normally used when Linux finishes shutting-down on a laptop, and maybe that underlying facility is behaving wrongly. But, I must say, I think that the chances of this are very remote.

Earlier I could get to the desktop before 'shutting-down' (this is not graceful shutdown. It just 'dies' without any warning). Now it happens apparently at the same point between the grub and the login prompt. I tried a live (Debian stable) usb, and the result is the same.

AwesomeMachine 03-13-2018 01:21 PM

The laptop might not be cleanly shut down from Windows, i.e. Windows suspends the laptop to ram, which most laptops do when you just press the power button. That leaves the machine in a sleep state. So, when you boot into Linux there can be problems.

Try holding down the power button until the machine shuts off in Windows. Then boot Linux.

sundialsvcs 03-13-2018 01:24 PM

Quote:

Originally Posted by AwesomeMachine (Post 5830610)
The laptop might not be cleanly shut down from Windows, i.e. Windows suspends the laptop to ram, which most laptops do when you just press the power button. That leaves the machine in a sleep state. So, when you boot into Linux there can be problems.

Try holding down the power button until the machine shuts off in Windows. Then boot Linux.

I would tell Windows to shut down and power off, then wait until it has actually done so. Cause it to completely wind-up its own affairs, whatever they might be, and then to turn the machine off.

BW-userx 03-13-2018 01:32 PM

If you're going that route and it works you can go into Windows power management, advance then select off for hybridization and such.

Fernandezz 03-13-2018 03:06 PM

I really appreciate all your replies. I'm not dual booting. I have two hard drives. One with Linux installed and the other with Windows 8.1. I just connected the hard drive with Windows just to test the other hardware and the battery. Everything worked fine when I booted the system with Windows (booting, running and shutting-down and everything works as it should). I experience this problem only with Linux. That also only when I boot the system on battery

Fernandezz 03-13-2018 03:18 PM

Quote:

Originally Posted by rokytnji (Post 5830447)
I thought you might be able to poke around in dmesg file to see what it had to say. But I see no /var/log/dmesg file.

What does

Code:

harry@biker:~
$ uname -a
Linux biker 4.15.5-antix.1-amd64-smp #2 SMP PREEMPT Fri Feb 23 12:27:47 EET 2018 x86_64 GNU/Linux
harry@biker:~
$ cat /etc/issue
Welcome to antiX. Powered by Debian.
harry@biker:~
$

Have to say since you left out what version of Linux you are running.


Linux debian 4.14.0-0.bpo.3-amd64 #1 SMP Debian 4.14.13-1~bpo9+1 (2018-01-14) x86_64 GNU/Linux

rokytnji 03-13-2018 03:57 PM

OK. If you can install this. It will give more info on your machine hardware and model of computer.

https://packages.debian.org/stretch/inxi

Command to run after a install

Code:

inxi -Fxxx
To see if inxi is in your repos.

Code:

sudo apt-get update
Let it finish

Code:

apt search inxi
To see if it is there. If it is installed already. You will see that in the readout also like so below
Code:

[installed]
To install it using terminal

Code:

sudo apt-get install inxi
Since this is a battery software issue. The more info members can see on your hardware. Like make and model that inxi will show. The better to help you out.

I find it weird there is no dmesg log in /var/log

After you boot debian. What does

Code:

dmesg | tail
say? I do not not expect to see any battery error messages till after the shutdown occurs. Because the command above is just running before shutdown occurs.

Also. Try finding old dmesg files with

Code:

sudo updatedb
let it finish updating the data base.

Code:

locate dmesg
Because /bin/dmesg should be on the 1st line of that readout if it is installed.

Code:

which dmesg
should show /bin/dmesg also.


All times are GMT -5. The time now is 02:06 PM.