I'd like to fully discharge my laptop battery (to comply with a vendor instruction to fully discharge after first full charge). What's a simple way to do this on Linux (that is, prevent the laptop from going into sleep/hibernation while maintaining processor load)?
If the laptop will still try to turn on after the OS shuts it down for having a low battery (i.e. it's only the OS that turns it off, not the laptop's firmware/BIOS) then you could:
- Use the laptop normally (unplugged) until it shuts itself off.
- Turn it back on but immediately go straight to the firmware/BIOS settings, and leave it running there until the battery completely dies.
This would have the added benefit of not risking corruption of the OS / filesystems, since they shouldn't be mounted while in the firmware/BIOS settings. And you don't have to know/find/change any of the OS's settings.
Many battery suppliers recommend an initial cycle of fully charging the battery, then running it down to 5%, or even 2-3%, before recharging. That's good for the battery. But taking it to zero at any time can shorten the battery's life. If the vendor is recommending a full discharge, they're trying to sell more batteries by shortening the time until you need a replacement.
In most Linux distros, power management in the configuration settings has "advanced" settings for defining the critical level at which the laptop will protect itself by shutting down. That often can't be set below about 5% as a safety precaution.
So that's a place where it's simple to do this. At least for the initial cycle, set it to allow the battery to run down as far as it should. But it's bad for the battery to go below a few percent, so don't try to "game the system" and get the battery to fully discharge.
BTW, you can typically also set the action for when the battery is at the critical level. There are usually options to shut down or suspend. I've experience problems with suspending at the critical level, where laptops suspend and then resume on their own. Even if it doesn't resume, suspending still uses some current unless it's a true hibernation. So if you don't recharge within a reasonable time of suspending at the critical level, you can end up with a fully discharged battery. The safe setting is to have it shut down.
There are more sophisticated ways, but very simple and effective can be playing a movie in your favorite player(they should prevent sleep/hibernate), or better, stream a youtube mix. You can always set manually in every linux distro sleep and hibernation options to never.