Ubuntu 17.10下联想X270双电池充电方式及电池损耗疑问
Hey there! I totally get your worry about how your X270's two batteries charge differently in Ubuntu compared to Windows. Let me break this down and help you get that optimized charging behavior back—no need to stress about battery damage right off the bat.
Why the Difference?
On Windows, Lenovo's built-in power management tools use a smart charging strategy designed to extend battery lifespan: it tops up one battery to 80%, switches to fill the second to 100%, then goes back to finish the first one. Ubuntu's default power manager doesn't have this custom logic baked in, so it just charges both batteries at the same time. While this default method won't instantly harm your batteries, it's not as kind to their long-term health as Lenovo's optimized approach.
How to Adjust the Charging Strategy
You have a couple of solid tools to replicate that Windows-style charging behavior. Let's start with the most targeted one for ThinkPads:
Option 1: Use tpacpi-bat (ThinkPad-Specific Tool)
tpacpi-bat is a dedicated utility for controlling ThinkPad battery thresholds and charging order. Here's how to set it up:
Install the tool and dependencies:
sudo apt-get install acpi-call-dkms tpacpi-batConfigure charging thresholds
Open the configuration file with your favorite text editor (I'm using nano here):sudo nano /etc/tpacpi-bat.confAdd these lines to mimic the Windows charging logic:
# Set battery 0 (internal) to stop at 80% initially START_CHARGE_THRESH_BAT0=40 STOP_CHARGE_THRESH_BAT0=80 # Set battery 1 (external) to charge fully to 100% START_CHARGE_THRESH_BAT1=40 STOP_CHARGE_THRESH_BAT1=100Save and exit nano (press
Ctrl+O, thenEnter, thenCtrl+X).Once set, your X270 will charge the internal battery up to 80%, then switch to filling the external battery to 100%. After the external battery is full, most X270 models will automatically go back to top up the internal battery to 100%—if yours doesn't, you can temporarily adjust the internal battery's stop threshold to 100% using:
sudo tpacpi-bat -s ST 0 100Verify your settings
Check the current thresholds to make sure everything's applied:tpacpi-bat -g ST 0 tpacpi-bat -g ST 1Or check the battery status directly:
acpi -b
Option 2: Use TLP (General Power Management Tool)
If you prefer a more user-friendly, all-in-one power management tool, TLP works great for ThinkPads too:
- Install TLP:
sudo apt-get install tlp tlp-rdw - Edit the TLP configuration:
Find the lines for battery charge thresholds and modify them to:sudo nano /etc/default/tlp
Save and exit, then restart TLP to apply changes:STOP_CHARGE_THRESH_BAT0=80 STOP_CHARGE_THRESH_BAT1=100sudo systemctl restart tlp
Quick Note on Battery Health
Remember that battery lifespan mostly depends on charge cycles. Keeping batteries between 40-80% charge as much as possible reduces cycle wear, which is exactly what Lenovo's Windows strategy is doing. Adjusting Ubuntu to match this will help keep your X270's great battery life going strong for longer.
内容的提问来源于stack exchange,提问作者Jurgen Celmeta

