I have a problem with Lenovo ThinkPad x270 and AlmaLinux. The laptop turns off by itself when one battery reaches 5%, second can be charged to 100%. I have already tried different settings in UPower LoginD But without results, I also have another Linux on this laptop and I don’t have this problem, what can I do?
Do you have upower
package installed? Please show output from that package.
If not installed, perhaps you could try out the ltp package.
dnf install tlp
I have UPower and TLP installed. UPower also correctly detects two batteries.
I wonder are they clashing, although I believe both can work together.
These commands work ok?
upower -i /org/freedesktop/UPower/devices/battery_BAT0
upower -i /org/freedesktop/UPower/devices/battery_BAT1
Try this command for tlp.
sudo tlp-stat -b
also please show the tlp.conf file?
upower -i /org/freedesktop/UPower/devices/battery_BAT0
upower -i /org/freedesktop/UPower/devices/battery_BAT1
native-path: BAT0
vendor: SANYO
model: 45N1773
serial: 2878
power supply: yes
updated: czw, 10 kwi 2025, 19:39:14 (101 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: pending-charge
warning-level: none
energy: 15,59 Wh
energy-empty: 0 Wh
energy-full: 16,84 Wh
energy-full-design: 23,2 Wh
energy-rate: 0 W
voltage: 12,155 V
percentage: 92%
capacity: 72,5862%
technology: lithium-ion
icon-name: 'battery-full-charging-symbolic'
History (charge):
1744306754 0,000 unknown
History (rate):
1744306754 0,000 unknown
native-path: BAT1
vendor: LGC
model: 45N1127
serial: 2447
power supply: yes
updated: czw, 10 kwi 2025, 19:39:14 (101 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: charging
warning-level: none
energy: 6,61 Wh
energy-empty: 0 Wh
energy-full: 19,75 Wh
energy-full-design: 23,48 Wh
energy-rate: 28,279 W
voltage: 12,301 V
time to full: 27,9 minutes
percentage: 33%
capacity: 84,1141%
technology: lithium-ion
icon-name: 'battery-good-charging-symbolic'
History (charge):
1744306754 0,000 unknown
History (rate):
1744306754 0,000 unknown
tlp-stat -b
--- TLP 1.5.0 --------------------------------------------
+++ Battery Care
Plugin: thinkpad
Supported features: charge thresholds, recalibration
Driver usage:
* natacpi (thinkpad_acpi) = active (charge thresholds)
* tpacpi-bat (acpi_call) = active (recalibration)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1: 0(off)..96(default)..99
* STOP_CHARGE_THRESH_BAT0/1: 1..100(default)
+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer = SANYO
/sys/class/power_supply/BAT0/model_name = 45N1773
/sys/class/power_supply/BAT0/cycle_count = 89
/sys/class/power_supply/BAT0/energy_full_design = 23200 [mWh]
/sys/class/power_supply/BAT0/energy_full = 16840 [mWh]
/sys/class/power_supply/BAT0/energy_now = 15590 [mWh]
/sys/class/power_supply/BAT0/power_now = 0 [mW]
/sys/class/power_supply/BAT0/status = Not charging
/sys/class/power_supply/BAT0/charge_control_start_threshold = 0 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold = 100 [%]
tpacpi-bat.BAT0.forceDischarge = 0
Charge = 92.6 [%]
Capacity = 72.6 [%]
+++ ThinkPad Battery Status: BAT1 (Ultrabay / Slice / Replaceable)
/sys/class/power_supply/BAT1/manufacturer = LGC
/sys/class/power_supply/BAT1/model_name = 45N1127
/sys/class/power_supply/BAT1/cycle_count = 142
/sys/class/power_supply/BAT1/energy_full_design = 23480 [mWh]
/sys/class/power_supply/BAT1/energy_full = 19750 [mWh]
/sys/class/power_supply/BAT1/energy_now = 8470 [mWh]
/sys/class/power_supply/BAT1/power_now = 28438 [mW]
/sys/class/power_supply/BAT1/status = Charging
/sys/class/power_supply/BAT1/charge_control_start_threshold = 0 [%]
/sys/class/power_supply/BAT1/charge_control_end_threshold = 100 [%]
tpacpi-bat.BAT1.forceDischarge = 0
Charge = 42.9 [%]
Capacity = 84.1 [%]
+++ Charge total = 65.8 [%]
TLP I have default configuration.
Have you by any chance upgraded the firmware recently?
I have not updated the firmware. I’ve currently commented out the criticalpoweraction and % levels for critical in the UPower cfg, I’ll see if that does anything.
However, even after disabling UPower, the laptop will shut down after updating the BIOS version to a newer one is the same. With TLP can you do something about it?
Hi Mica, I ran out of messages yesterday as I just signed up. Here’s what you could try.
sudo systemctl enable --now tlp # if you have not already
use tlp-stat -b
to check battery order and status.
also sudo tlp-stat -b | grep tpacpi-bat
This check will tell you if this is supported.
If it’s supported, the per-battery thresholds will be enforced, and you’ll be able to control discharge priority indirectly by controlling which battery stays more charged.
Then back up the following file.
cp /etc/tlp.conf /etc/tlp.conf.backup
Then edit or add these settings to the tlp.conf file
# Set combined battery threshold behavior
START_CHARGE_THRESH_BAT0=95
STOP_CHARGE_THRESH_BAT0=100
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=100
# Prefer discharging external (removable) battery first
# BAT0 = internal, BAT1 = external on X270 typically (can vary, check with tlp-stat)
BATTERY_CHARGE_START_THRESH=90
BATTERY_CHARGE_STOP_THRESH=95
# Enable TPACPI interface: This lets TLP interact with the,
# ThinkPad-specific ACPI battery controls
TPACPIBAT=1
reboot your laptop.
then sudo tlp-stat -b
and check its status again.
Unfortunately, these settings did not help. It’s a shame because AlmaLinux works very stably and quickly on this laptop, I only have this problem. I will add that if the laptop turns off when the external battery reaches 5%, the system turns off by itself after restarting, only after the battery is charged can AlmaLinux be launched. TLP does not start at system startup even though it is set to enabled. Even enabling TLP manually does not solve the problem. I thought maybe it has a conflict with the power-profiles-daemon service setting on masked., but TLP still does not start after system startup.
Micah89, please try to check logging for anything related to tlp.
journalctl -u tlp -b
You can also try this. This might be a systemd issue and why its not following your commands.
sudo systemctl edit tlp
Then paste this line in to the [Unit] section
[Unit]
After=multi-user.target network.target
Then
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl restart tlp.service
Then
systemctl status tlp
I solved the problem with starting TLP with a script, but the laptop still turns off when one battery reaches 5%. I think there is a bug that cannot be solved. On Xubuntu and Kubuntu everything is Ok, but AlmaLinux works best, I guess I’ll have to get used to it.