14

I have a dual-boot setup with Ubuntu 16.04 LTS and Windows 10 on an HP Pavilion 15-CC508NF. When I shutdown from Windows 10, my battery remains as it is, no discharge. But when I shutdown from Ubuntu, the battery loses 5% by day.

I have installed the TLP package and disabled WOL (Wake-On-Lan) on the Ethernet card. But the battery continues to discharge when the computer is off - 2% by day.

I think that some hardware continues to drain power while the computer is off.

Any idea to identify the problem/the hardware causing the problem?

yoann_dev
  • 151
  • do you have laptop-mode-tools installed? – Sebastian Stark Apr 10 '18 at 09:51
  • 4
    How are you shutting down the computer (power button, command line ect...)? You mention both shutdown and sleeping in your question. Shutdown, hibernate, and sleep all have different behaviour. – Jeff Apr 10 '18 at 11:49
  • How do you identify the battery discrepancy ? Could it be that Ubuntu displays a different charge state then windows ? – Robert Riedl Apr 10 '18 at 13:14
  • @sebastien No laptop-mode-tools is installed, I can try laptop-mode-tools package and remove TLP for avoid conflicts. – yoann_dev Apr 10 '18 at 20:54
  • @jeff It's only about shutdown, I will edit my question to clarify this point.

    @RobertRiedl I identify the battery discrepancy thanks to the TLP package in Ubuntu with : sudo tlp-stat -b. It displays the current remaining charge in mAh and the full charge. After windows 10 or Ubuntu shutdown, the next day I boot on Ubuntu to get the remaining charge.

    – yoann_dev Apr 10 '18 at 21:04
  • @yoann_dev hm, I'm not entirely convinced that the values you are getting from Windows vs Ubuntu are accurate. Is your battery easily removable ? If so, try to see if the "discharge" also happens if the battery is removed (Shutdown from Ubuntu, immediately after poweroff remove the battery, wait one day, reinsert and start ubuntu to see the charge lvl). Another tip: to make sure the laptop shuts down, try to do it manually with sudo shutdown -P now. Also, how did you disable WOL ? Here is a decent answer on how to do that from ubuntu. – Robert Riedl Apr 12 '18 at 06:43
  • Is there any device that is permanently connected to the laptop (SD card plugged in, or wireless mouse dongle)? Also is it available powered USB (usually they are yellow coloured)? – pa4080 Apr 12 '18 at 07:28
  • @SebastianStark I have installed laptop-mode-tools to replace TLP, and I have the same battery problem. @pa4080 No device connected and no powered USB. @RobertRiedl The battery is not removable. I will try sudo shutdown -P now to test if there is any difference. – yoann_dev Apr 13 '18 at 17:43
  • @RobertRiedl For WOL, I used command line sudo ethtool -s eno1 wol d, but according to your link it's not persistent after reboot. I will implement the service to switch off WOL to see if there is any difference about battery discrepancy. – yoann_dev Apr 13 '18 at 17:54

2 Answers2

6

Another user with an HP Pavilion was loosing 10% battery overnight. Apparently there was no BIOS configuration for Wake-on-LAN and they had to use this method:

$ sudo lshw -class network | grep logical
       logical name: enp59s0
       logical name: wlp60s0

The logical name starting with e is for Ethernet which means "LAN". The logical name starting with w is for WiFi which is of no concern.

Then take the Ethernet/LAN logical name and pass it to the ethtool command:

$ sudo ethtool enp59s0
Settings for enp59s0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Current message level: 0x000060e4 (24804)
                   link ifup rx_err tx_err hw wol
    Link detected: yes

In my case "Wake on LAN" is not turned on but if yours shows:

    Wake-on: g

That means "Wake-on-LAN" is turned on and like the OP is loosing `0% battery per night you are loosing the 5% per day.

To turn off "Wake-on-LAN" the OP used:

sudo ethtool -s enp59s0 wol d
  • Remember to substitute enp59s0 with your logical name from step 1. above.
  • wol stands for "Wake-on-LAN".
  • The d stands for disable.

ArchLinux has an extensive write-up about Wake-on-LAN.

Why would you use "Wake-on-LAN"?

Some servers will want to wake up client PCs overnight and install new programs on them overnight or update files.


USB turned off in Windows, left on in Ubuntu

A user on Tom's Hardware reports that when Windows shuts down all USB powered devices power off. However when Ubuntu 16.04 shuts down USB powered devices stay powered on.

To confirm if this is happening in your case, attach a USB powered device such as a Cell phone or mouse to all USB ports and see if they are powered when Ubuntu shuts down the computer.

Less likely scenerios

  • Wake on USB
  • Wake on Wireless LAN

Review shutdown log

I've experience during suspend the system doesn't finish the process. When the system resumes it completes the process. You should check your /var/log/syslog or /var/log/syslog.1 to ensure everything shutdown properly and was powered off. You can also check journalctl -b-1 to look at end of previous boot. Use journalctl -b to look at start of current boot.

Background: systemd suspends system but upon resume kernel then enters sleep and wake-up

  • Thanks for the answer. As I say in my first post, I had disable WOL for en01 interface, but the modification seems not to be persistent after reboot... Maybe the reason to my battery problem ? I will try the extensive write-up for ArchLinux. – yoann_dev Apr 13 '18 at 17:49
  • @yoann_dev What I've seen in the past on dual-boot is that the Windows driver itself might turn WoL back on so disable on both OSes and try powering down instead of rebooting from one to the other OS. – Fabby Apr 13 '18 at 22:01
  • @Fabby There is also the problem when you reboot from Windows to grub it sometimes turns off LAN card power altogether making it inoperative for Ubuntu. You must shutdown from Windows, power on and then boot into Ubuntu in these cases. Granted it is rare though. – WinEunuuchs2Unix Apr 14 '18 at 00:44
  • What are you doing up so late? (ping me in chat) – Fabby Apr 14 '18 at 00:47
  • 1
    @yoann_dev en01 might be a generic name like eth0. Make sure you run sudo lshw -class network | grep logical to confirm the exact name. I didn't research tlp approach to this problem but I encourage you to try ethtool used in this answer and the links referenced. – WinEunuuchs2Unix Apr 14 '18 at 02:30
  • @WinEunuuchs2Unix sudo lshw -class network | grep logical gives me eno1. I'm trying ethtool with a service to disable WOL on shutdown. I have remove laptop-mode-tools (@Sebastian tip to replace TLP). – yoann_dev Apr 15 '18 at 07:59
  • @Fabby I have checked and WOL is disable in Windows 10 too. – yoann_dev Apr 15 '18 at 08:00
  • @yoann_dev I really like TLP as a thermal management system to keep heat down and fans low or even off. If removing it doesn't have any effect I would put it back. – WinEunuuchs2Unix Apr 15 '18 at 16:25
  • @WinEunuuchs2Unix ethtools service to disable WOL doesn't have any effect on battery discrepancy... Still -2% by day. – yoann_dev Apr 16 '18 at 19:04
  • @yoann_dev I added new section on USB left powered on at bottom of answer. – WinEunuuchs2Unix Apr 16 '18 at 22:37
  • @WinEunuuchs2Unix no usb port left powered after shutdown. I tested with a usb key with a LED and my phone. – yoann_dev Apr 18 '18 at 19:12
  • @yoann_dev I added shutdown log section. If you find anything questionable, please update your question with it so we can review. Thanks. – WinEunuuchs2Unix Apr 18 '18 at 23:48
  • @WinEunuuchs2Unix Thanks for added log section. Log analysis didn't give anything, Everything seems normal when I turn off the computer. – yoann_dev Apr 24 '18 at 22:03
  • @yoann_dev Sorry to hear that. Look at the bright side at 2% / day you have 50 days before you have to plug the battery in to recharge. Others loosing 10% / day in the links were much worse off. New kernels come out twice a week so hopefully the root of the problem gets fixed on its own. – WinEunuuchs2Unix Apr 24 '18 at 22:58
  • @WinEunuuchs2Unix thank you for the different answers and the time spent to help me. – yoann_dev Apr 25 '18 at 09:30
0

I would imagine that the system is still running services or something.

I would suggest first looking at service --status-all and decide if there's any you just want to stop. You can try to stop all before shutting down, too. There's ways to stop a service until reboot, so that may be exactly what you need.

You can also put a list of services in a .txt file, and use that to stop or start a group of services.

If you're not all about the "one after the other" approach, either, you can install something that gives you a GUI-type interface - a tool like sysv-rc-conf or Jobs-Admin. They both provide a nice interface for you to stop and start services. The first runs in terminal, the second runs a seperate GUI, as I know some people are bias to either-or.

Hope that helps. I honestly don't know if it will, as I assume shutting down a system stops the runlevels all together, right? But it's worth a try. :)