This content originally appeared on DEV Community and was authored by Kamran khan
If you’re running Fedora on a laptop or desktop, you might have noticed your system defaulting to a lighter sleep state (s2idle
) instead of the power-saving “deep sleep” (S3 Suspend-to-RAM). This can lead to faster battery drain and more warmth when suspended.
In this guide, you’ll learn how to:
Verify if your system supports “deep” suspend
Configure Fedora to use “deep” suspend by default
Understand the difference between sleep states
What is “Deep Sleep” (S3 Suspend)?
In the world of ACPI (Advanced Configuration and Power Interface), “deep sleep” typically refers to the S3 suspend state (Suspend-to-RAM). In this state:
- The CPU, chipset, and most other components are powered down.
- The RAM (Random Access Memory) remains powered to retain your session data.
- The system consumes minimal power, making it ideal for battery life.
- Resuming from S3 is fast, usually taking only a few seconds.
Fedora, by default, often uses s2idle
(Suspend-to-Idle), which keeps more components powered on, consuming more energy, especially in modern hardware. While it’s slightly faster to resume, S3 offers better power savings for true “deep sleep.”
Step 1: Verify “Deep Sleep” Support
First, let’s confirm that your system’s hardware and firmware (BIOS/UEFI) actually support the “deep” (S3) suspend state.
Open your terminal and run:
cat /sys/power/mem_sleep
You should see an output similar to this:
[s2idle] deep
- If
deep
is present in the output (even if it’s not in brackets), your system supports it. The[s2idle]
indicates it’s currently the default. - If
deep
is not present, your hardware or firmware might not support S3, or it’s not enabled in the BIOS/UEFI settings. In such cases, this guide might not be able to help you achieve S3.
Step 2: Configure Fedora for “Deep Sleep”
Fedora uses systemd
to manage sleep states. We can configure systemd
to prefer the “deep” sleep mode when you suspend your system.
-
Open the
sleep.conf
file:This file is where
systemd
‘s sleep configuration resides. It might be empty or not exist, which is normal.
sudo nano /etc/systemd/sleep.conf
-
Add the configuration lines:
If the file is empty, simply paste these lines. If there’s existing content, add these lines under the
[Sleep]
section.
[Sleep] SuspendState=mem MemorySleepMode=deep
-
[Sleep]
: This is the required section header for sleep-related configurations. -
SuspendState=mem
: This tellssystemd
to use themem
state for suspend, which corresponds to Suspend-to-RAM. -
MemorySleepMode=deep
: This explicitly forces the kernel to use the “deep” (S3) suspend mode whenSuspendState=mem
is requested.
- Save the file and exit
nano
:
- Press
Ctrl + O
(to write out/save). - Press
Enter
to confirm the filename. - Press
Ctrl + X
(to exitnano
).
Step 3: Reboot and Test Your New Sleep!
For the systemd
configuration changes to take effect, a reboot is necessary.
sudo reboot
After your system restarts, try suspending it using your preferred method (e.g., closing the laptop lid, clicking “Suspend” from your desktop environment’s power menu, or running systemctl suspend
in the terminal).
Your system should now enter the more power-efficient “deep” (S3) suspend state!
Understanding Sleep States (Briefly)
- S0 (Working State): Fully on.
- S0ix (Modern Standby/s2idle): A lightweight sleep state where the CPU goes into low-power idle states, but many components remain powered and responsive. It’s fast to resume but consumes more power than S3. This is often the default on newer hardware.
- S3 (Suspend-to-RAM / “Deep Sleep”): Most components are powered off, only RAM remains powered. Low power consumption, fast resume. This is what we aimed for!
- S4 (Suspend-to-Disk / Hibernation): Saves the entire system state to disk and powers off completely. No power consumption while off, but takes longer to resume. This requires a dedicated swap partition/file.
- S5 (Soft Off): Full shutdown.
TL;DR Cheatsheet
Task | Command/Action Example | Description |
---|---|---|
Check deep sleep support |
cat /sys/power/mem_sleep |
Shows if deep (S3) suspend is available |
Configure deep sleep | Edit /etc/systemd/sleep.conf with SuspendState=mem & MemorySleepMode=deep
|
Sets S3 as the preferred suspend state |
Apply changes |
sudo reboot |
Reboots the system to apply systemd configuration |
Initiate suspend (test) |
systemctl suspend (or close laptop lid) |
Puts the system into the configured suspend state |
Final Thoughts
By making this small but impactful change, you’re optimizing your Fedora system’s power management, especially beneficial for laptops where battery life matters. Enjoy a truly “deep” sleep for your system, extending standby time and keeping your device cooler.
If you encounter any issues or have questions, feel free to drop a comment!
This content originally appeared on DEV Community and was authored by Kamran khan