How to disable hibernation in Debian, but not suspend?
- User
How to disable hibernation in Debian, but not suspend?
- Assistant
How to disable hibernation in Debian, but not suspend?
Disabling hibernation on Debian while keeping suspend functionality intact involves modifying power management settings. Here’s a step-by-step guide to achieve that:
Open the terminal: You can do this by searching for "Terminal" in your applications menu or pressing Ctrl + Alt + T.
Edit the logind.conf file: This file controls the behavior of power management in systemd. You'll need root privileges to edit this file, so use sudo.
sudo nano /etc/systemd/logind.conf
Configure logind.conf: Add or modify the following lines to disable hibernation:
[Login]
# Command key in case they are commented
HandleHibernateKey=ignore
HandleLidSwitchHibernate=ignore
# Handle the ACPI power button to disable hibernate
HandlePowerKey=poweroff
These lines instruct systemd to ignore hibernate requests from the Hibernate key and the lid switch, and to power off instead of hibernate if the power key is pressed.
Save the file: In Nano, you can save the file by pressing Ctrl + O, then press Enter, and exit by pressing Ctrl + X.
Reload systemd configuration: Apply the changes by reloading the systemd manager configuration.
sudo systemctl restart systemd-logind
Deactivate hibernate by creating a udev rule (optional): If you want to take further precautions and disable any hibernation triggers at the udev level, you can create a udev rule.
sudo nano /etc/udev/rules.d/99-disable-hibernate.rules
Add the following line into the file:
# Disable hibernation
ACTION=="add", SUBSYSTEM=="power_supply", ATTR{hibernate}="disabled"
Save and close the file.
You may also consider disabling the hibernate targets and services directly to ensure no hibernation occurs.
sudo systemctl mask sleep.target hibernate.target hybrid-sleep.target
By following these steps, you should be able to disable hibernation on your Debian system while keeping the suspend functionality unchanged.