You close your laptop and lose your session
You close your laptop lid after a long work session. You expect to open it tomorrow and find your terminal tabs, browser windows, and unsaved documents exactly where you left them. Instead, the screen stays black for a moment, the fans spin up, and you get a fresh login prompt. Your work is still in memory, but the system discarded it on shutdown. Fedora disables hibernate by default. The desktop environment hides the power option, and the kernel refuses to write RAM to disk unless you explicitly tell it where to store the image.
What is actually happening
Suspend to RAM keeps your system alive on a trickle of power. Hibernate, or suspend to disk, writes the entire contents of RAM to a swap area, powers off completely, and restores the image on boot. Fedora leaves this off because early boot recovery is fragile. If the kernel cannot find the resume device during the initramfs stage, it drops to an emergency shell or boots normally and ignores the hibernation image. The system needs three things to make this work. It needs a swap area large enough to hold your compressed RAM. It needs the kernel parameter pointing to that exact location. It needs the initramfs rebuilt so the early boot environment knows how to read the image before the root filesystem mounts.
Think of the resume parameter like a GPS coordinate for a buried time capsule. The kernel powers on, reads the coordinate from the bootloader, searches the disk for the capsule, and loads it into RAM. If the coordinate is wrong, or if the early boot environment lacks the tools to read the disk format, the kernel gives up and starts a fresh session. Fedora uses grubby to manage kernel boot parameters instead of editing /etc/default/grub directly. grubby updates every installed kernel automatically and prevents configuration drift across updates. You also need dracut to regenerate the initramfs. The initramfs is a temporary root filesystem that loads before your actual disk mounts. If the resume parameter lives in the GRUB config but not in the initramfs, the kernel will panic when it tries to resume.
Run journalctl -xe after any boot failure. The x flag adds explanatory text and the e flag jumps to the end. Most sysadmins type journalctl -xeu systemd-logind muscle-memory style to isolate power management failures.
The fix
Check your current swap configuration first. Fedora Workstation usually creates a swap file by default, but you need to verify its size and location. Hibernate requires swap space that can hold your compressed RAM. Modern kernels compress the memory image before writing it to disk, so swap equal to 60 to 70 percent of your physical RAM is usually sufficient. Allocating swap equal to your RAM is the safe baseline. If your swap is too small, the hibernate command will fail immediately.
Here is how to inspect your active swap setup and verify the available space.
# Show active swap devices and their current sizes
swapon --show
# Display physical RAM to compare against swap allocation
free -h
# List block devices to confirm whether you are using a partition or a file
lsblk -f
If your swap is missing or too small, create a properly sized swap file. The file must be created with fallocate or dd, formatted with mkswap, and given strict permissions so unprivileged users cannot read memory contents.
# Allocate a 16GB swap file. Adjust the size to match your RAM requirements.
sudo fallocate -l 16G /swapfile
# Restrict access to root only. Swap contains unencrypted memory dumps.
sudo chmod 600 /swapfile
# Initialize the swap signature so the kernel recognizes the file format
sudo mkswap /swapfile
# Activate the swap file immediately for the current session
sudo swapon /swapfile
Add the swap file to /etc/fstab so it persists across reboots. Config files in /etc/ are user-modified. Files in /usr/lib/ ship with the package. Always edit /etc/. Never edit /usr/lib/.
# Append the swap entry to the filesystem table for automatic mounting
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Find the exact UUID for your swap area. The kernel parameter requires a precise identifier. If you are using a swap file, you need the UUID of the underlying filesystem, not the file path itself. The blkid command prints the UUID for every recognized block device and swap signature.
# Print UUIDs for all mounted filesystems and swap signatures
sudo blkid
# Filter the output to isolate the swap entry and copy the UUID value
sudo blkid | grep swap
Add the resume parameter to the kernel command line. This tells the bootloader and the early boot environment where to look for the hibernation image. Replace the UUID placeholder with the value you just copied.
# Update all installed kernels with the resume parameter pointing to your swap
sudo grubby --update-kernel=ALL --args="resume=UUID=your-actual-uuid-here"
# Verify the parameter was applied to the default kernel entry
sudo grubby --default-kernel --args
Rebuild the initramfs. This step injects the resume configuration into the early boot image and ensures the kernel can read the swap area before the root filesystem mounts.
# Force dracut to regenerate the initramfs for the running kernel
sudo dracut --force
# Confirm the new initramfs image was written to /boot
ls -lh /boot/initramfs-$(uname -r).img
Test the configuration safely. Do not rely on the desktop environment power menu yet. Use the command line to verify the kernel accepts the state and writes the image correctly.
# Trigger hibernate through systemd-logind with verbose output
sudo systemctl hibernate
# Wait for the system to power off completely, then press the power button
# The system should restore your session exactly as it was before shutdown
Reboot before you debug. Half the time the symptom is gone after a clean initramfs rebuild.
Verify it worked
After the system powers back on, check that your terminal sessions and applications are exactly where you left them. Run cat /sys/power/state to see which power states the kernel currently recognizes. You should see freeze mem disk listed. The disk state confirms hibernate is active. If disk is missing, the kernel compiled without suspend-to-disk support or the resume parameter failed to load. Check your GRUB configuration and initramfs rebuild steps again.
Run systemctl status systemd-logind to verify the power management daemon is healthy. The status output shows recent log lines and the current state in one view. Always check status before restarting services. If the service reports active (running), your hibernate configuration is fully integrated into the desktop session manager.
Common pitfalls and what the error looks like
The most common failure is insufficient swap space. The systemctl hibernate command will refuse to proceed and print the following error:
Failed to hibernate system via logind: Not enough swap space for hibernation
The check is strict. Resize the swap file or partition before retrying. You can shrink and recreate the file, or add a second swap partition if your disk layout allows it.
Another frequent issue is a mismatched resume path. If you point resume= to a swap partition but your system actually uses a swap file, the kernel will fail to locate the image. You will see a kernel panic during early boot, followed by a normal login screen. The hibernation image remains on disk until you manually delete it or overwrite it. Run swapoff -a && swapon -a to clear a stuck swap file, then verify the UUID matches the grubby parameter.
Btrfs users face an additional constraint. The swap file must be created with compress=no and resv=0 mount options, or the kernel cannot write the hibernation image reliably. If you are on Btrfs, verify your /etc/fstab entry includes those options before enabling hibernate. The filesystem metadata overhead will otherwise corrupt the resume image during the write phase.
SELinux denials occasionally block logind from writing to the swap area. You will see AVC messages in the journal. Run journalctl -t setroubleshoot to read the one-line summary. Fix the policy with semanage fcontext and restorecon before disabling SELinux. Trust the package manager. Manual file edits drift, snapshots stay.
When to use this vs alternatives
Use hibernate when you are working on battery power and need to preserve your session for days without draining the battery. Use suspend when you only need to step away for a few hours and want instant wake-up. Use hybrid-sleep when you want the safety of a disk image but the speed of RAM suspend, knowing the system will fall back to disk if power is lost. Stay on suspend-to-RAM if your laptop has a known ACPI bug that causes random wake-ups or thermal throttling.