LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2018, 07:39 AM   #1
Fernandezz
LQ Newbie
 
Registered: Mar 2018
Posts: 7

Rep: Reputation: Disabled
Question 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!

Last edited by Fernandezz; 03-13-2018 at 06:35 AM.
 
Old 03-12-2018, 08:06 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro
Posts: 6,397

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
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.

Last edited by BW-userx; 03-12-2018 at 08:09 AM.
 
Old 03-12-2018, 09:02 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,133

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
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.
 
Old 03-12-2018, 09:13 AM   #4
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17
Posts: 5,525
Blog Entries: 20

Rep: Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626
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
 
Old 03-12-2018, 09:16 AM   #5
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17
Posts: 5,525
Blog Entries: 20

Rep: Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626
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.

Last edited by rokytnji; 03-12-2018 at 09:18 AM.
 
Old 03-12-2018, 03:38 PM   #6
Fernandezz
LQ Newbie
 
Registered: Mar 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
@ 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!
 
Old 03-13-2018, 07:27 AM   #7
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17
Posts: 5,525
Blog Entries: 20

Rep: Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626
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.
 
Old 03-13-2018, 07:40 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166
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.
 
Old 03-13-2018, 09:31 AM   #9
Fernandezz
LQ Newbie
 
Registered: Mar 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
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.

Last edited by Fernandezz; 03-13-2018 at 09:34 AM.
 
Old 03-13-2018, 01:21 PM   #10
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,133

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
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.
 
Old 03-13-2018, 01:24 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166Reputation: 3166
Quote:
Originally Posted by AwesomeMachine View Post
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.
 
Old 03-13-2018, 01:32 PM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro
Posts: 6,397

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
If you're going that route and it works you can go into Windows power management, advance then select off for hybridization and such.
 
Old 03-13-2018, 03:06 PM   #13
Fernandezz
LQ Newbie
 
Registered: Mar 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
Old 03-13-2018, 03:18 PM   #14
Fernandezz
LQ Newbie
 
Registered: Mar 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
Lightbulb

Quote:
Originally Posted by rokytnji View Post
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
 
Old 03-13-2018, 03:57 PM   #15
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17
Posts: 5,525
Blog Entries: 20

Rep: Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626Reputation: 2626
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Laptop turns off abruptly without hibernating when on low battery mvikramreddy92 Red Hat 1 10-01-2014 11:27 PM
Laptop screen turns off abruptly!! & Fan runs continuously Nikhil_Lagwankar Linux - Hardware 12 08-16-2013 04:12 AM
I noticed that when my laptop is charging w/ ac wall outlet and I enter poweroff... trist007 Slackware 3 03-18-2009 03:49 PM
X stops abruptly pafrica Linux - Software 5 09-05-2004 01:00 PM
Poweroff under linux blackzone Linux - General 2 08-01-2004 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration