Exercise: Exploring Battery and Power Management
Using acpi, upower, and Power Profile Tools
1 Purpose
Modern operating systems use sophisticated services to monitor battery health and manage power consumption. This exercise explores the powerful tools available in Fedora for getting detailed battery reports and controlling the system’s power-performance balance. You will use acpi and upower to view status, and then learn to identify which power management service is active on your system (tuned or power-profiles-daemon) and use the correct command-line tool to manage it.
2 What You’ll Accomplish
By the end of this exercise, you will be able to:
- Use
acpifor a quick, human-readable battery status. - Use
upowerto display detailed battery information, including capacity and health. - Identify whether
tunedorpower-profiles-daemonis the active power management service. - Use
tuned-admorpowerprofilesctlto view and change the system’s power profile.
This exercise maps to the following program and course learning outcomes:
- Course Learning Outcomes (CLOs):
- 1. Identify hardware and basic network components: You will query the battery, a critical hardware component, for its status and health.
- 3. Troubleshoot hardware and basic network components: Checking battery health and power profiles are key steps when diagnosing performance issues or poor battery life.
This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.
| Learning Objective | O*NET KSAs | Technologies Used |
|---|---|---|
| Inspect and manage power systems via CLI. | Knowledge: Computers & Electronics Skills: Systems Analysis, Troubleshooting, Operations Analysis |
acpi, upower, tuned-adm, powerprofilesctl |
3 Prerequisites
This exercise requires a running Fedora 42 virtual machine. It is most effective when run on a host machine (like a laptop) that has a battery, as this data will be passed through to the VM.
4 Step-by-Step Guide
Open a terminal window in your Fedora VM to begin.
4.1 Part 1: Basic Status with acpi
The acpi command provides a simple, immediate status report.
Install the tool if it is not already present:
sudo dnf install -y acpiRun the verbose command:
acpi -V
4.2 Part 2: Detailed Reporting with upower
The upower utility provides much more detail than acpi.
Enumerate all power sources
upowerknows about:upower -eUse the battery’s device path from the previous command to get a detailed report (it will be similar to
/org/freedesktop/UPower/devices/battery_BAT0).# Replace with your actual battery path upower -i /org/freedesktop/UPower/devices/battery_BAT0Analyze the Output: Note the
capacityfield. This value represents the battery’s current health compared to its original design.
4.3 Part 3: Identifying and Managing Power Profiles
Fedora uses one of two services to manage power profiles: the newer power-profiles-daemon or the older, more complex tuned. You must first identify which is active on your system and then use the appropriate tool.
Identify the Active Service: Run the following
systemctlcommand. It will print “active” if the service is running, or “inactive” if it is not.systemctl is-active tunedBased on the output, follow the instructions in the correct tab below.
The tuned service uses the tuned-adm command. It is very powerful and has many profiles for specific server workloads, but we will focus on the basic power-saving profiles.
List Available Profiles:
tuned-adm listView the Active Profile:
tuned-adm activeSet a New Profile: Set the profile to
powersave. This requiressudo.sudo tuned-adm profile powersaveVerify the change by running
tuned-adm activeagain.Return to the Default Profile:
sudo tuned-adm profile balanced
If tuned was inactive, your system is likely using power-profiles-daemon. This is common on modern Fedora Workstation installs. The tool is powerprofilesctl.
List Available Profiles:
powerprofilesctl listYou will see
power-saver,balanced, and possiblyperformance. An asterisk (*) indicates the active profile.Get the Current Profile:
powerprofilesctl getSet a New Profile: Set the profile to
power-saver.powerprofilesctl set power-saverVerify the change by running
powerprofilesctl getagain.Return to the Default Profile:
powerprofilesctl set balanced
In your notebook, record your battery’s health (the capacity value from upower). Also, write down which power management service (tuned or power-profiles-daemon) was active on your system.
5 Reflect and Review
Now that you have completed this exercise, reflect on your experience in your Microsoft Teams Student Notebook:
- 3 key pieces of information you found in the
upowerreport. - 2 different command-line tools for managing power profiles.
- 1 question you still have about the difference between
tunedandpower-profiles-daemon.
Answer these questions in your notebook to solidify your understanding:
- What is the key difference between the information provided by
acpiandupower? - You are trying to diagnose poor battery life on a laptop. Which value in the
upowerreport is the most important indicator of the battery’s long-term health? - Which power management service was active on your VM? What command would you use to set its profile to
powersave? - If
upower -edoes not list a battery device, what does that likely tell you about the machine you are on?