How do I Enable Hibernation on Fedora 43 on multi boot system?
My fedora 43 partition uses ext4, not btrfs - how do I create swapfile step?
(I’m using triple boot - win/ubuntu/fedora - and btrfs was incompatible)
How do I Enable Hibernation on Fedora 43 on multi boot system?
My fedora 43 partition uses ext4, not btrfs - how do I create swapfile step?
(I’m using triple boot - win/ubuntu/fedora - and btrfs was incompatible)
Use mkdir /var/swap instead of btrfs subvolume create /var/swap.
Use mkswap --size $SWAPSIZE --uuid clear --file $SWAPFILE instead of btrfs filesystem mkswapfile --size $SWAPSIZE --uuid clear $SWAPFILE.
thanks for help, but got to the ‘test’ part and:
$ SWAPSIZE=$(free | awk ‘/Mem/ {x=$2/1024/1024; printf “%.0fG”, (x<2 ? 2x : x<8 ? 1.5x : x) }’)
SWAPFILE=/var/swap/swapfile
firebat@fedora:~$ mkdir /var/swap
mkdir: cannot create directory ‘/var/swap’: Permission denied
firebat@fedora:~$ sudo mkdir /var/swap
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
For security reasons, the password you type will not be visible.
[sudo] password for firebat:
firebat@fedora:~$ sudo mkswap --size $SWAPSIZE --uuid clear --file $SWAPFILE
Setting up swapspace version 1, size = 6 GiB (6442446848 bytes)
no label, UUID=00000000-0000-0000-0000-000000000000
firebat@fedora:~$ echo $SWAPFILE none swap defaults 0 0 | sudo tee --append /etc/fstab
sudo swapon --all --verbose
/var/swap/swapfile none swap defaults 0 0
swapon: /var/swap/swapfile: found signature [pagesize=4096, signature=swap]
swapon: /var/swap/swapfile: pagesize=4096, swapsize=6442450944, devsize=6442450944
swapon /var/swap/swapfile
firebat@fedora:~$ echo ‘add_dracutmodules+=" resume "’ | sudo tee /etc/dracut.conf.d/resume.conf
sudo dracut --force --verbose
add_dracutmodules+=" resume "
dracut[I]: Executing: /usr/bin/dracut --force --verbose
dracut[I]: *** Including module: bash ***
dracut[I]: *** Including module: systemd ***
dracut[I]: *** Including module: fips ***
dracut[I]: *** Including module: fips-crypto-policies ***
dracut[I]: *** Including module: systemd-ask-password ***
dracut[I]: *** Including module: systemd-battery-check ***
dracut[I]: *** Including module: systemd-initrd ***
dracut[I]: *** Including module: systemd-journald ***
dracut[I]: *** Including module: systemd-modules-load ***
dracut[I]: *** Including module: systemd-pcrphase ***
dracut[I]: *** Including module: systemd-sysctl ***
dracut[I]: *** Including module: systemd-sysusers ***
dracut[I]: *** Including module: systemd-tmpfiles ***
dracut[I]: *** Including module: systemd-udevd ***
dracut[I]: *** Including module: nss-softokn ***
dracut[I]: *** Including module: i18n ***
dracut[I]: *** Including module: drm ***
dracut[I]: *** Including module: plymouth ***
dracut[I]: *** Including module: prefixdevname ***
dracut[I]: *** Including module: kernel-modules ***
dracut[I]: *** Including module: kernel-modules-extra ***
dracut[I]: *** Including module: tpm2-tss ***
dracut[I]: *** Including module: resume ***
dracut[I]: *** Including module: rootfs-block ***
dracut[I]: *** Including module: terminfo ***
dracut[I]: *** Including module: udev-rules ***
dracut[I]: *** Including module: dracut-systemd ***
dracut[I]: *** Including module: usrmount ***
dracut[I]: *** Including module: base ***
dracut[I]: *** Including module: fs-lib ***
dracut[I]: *** Including module: memstrack ***
dracut[I]: *** Including module: openssl ***
dracut[I]: *** Including module: shell-interpreter ***
dracut[I]: *** Including module: shutdown ***
dracut[I]: *** Including modules done ***
dracut[I]: *** Installing kernel module dependencies ***
dracut[I]: *** Installing kernel module dependencies done ***
dracut[I]: *** Resolving executable dependencies ***
dracut[I]: *** Resolving executable dependencies done ***
dracut[I]: *** Hardlinking files ***
dracut[I]: *** Hardlinking files done ***
dracut[I]: *** Generating early-microcode cpio image ***
dracut[I]: *** Constructing GenuineIntel.bin ***
dracut[I]: *** Store current command line parameters ***
dracut[I]: *** Creating image file ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img.tmp’ ***
dracut[I]: Using auto-determined compression method ‘zstd’
dracut[I]: *** Creating initramfs image file ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img.tmp’ done ***
dracut[I]: *** Moving image file ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img.tmp’ to ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img’ ***
dracut[I]: *** Moving image file ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img.tmp’ to ‘/boot/initramfs-6.19.9-200.fc43.x86_64.img’ done ***
firebat@fedora:~$ sudo semanage fcontext --add --type swapfile_t $SWAPFILE
sudo restorecon -RF /var/swap
firebat@fedora:~$ sudo systemctl hibernate
firebat@fedora:~$
Well, that is a new error that is unrelated to the original swap file problem. I’m not sure how that resume= kernel parameter works or even if hybernation works at all on legacy BIOS systems. You’ll have to research that further on your own. (Or hope that someone else replies here.)
ran this per link’s info, to check if the above-referenced link to ‘get hibernate’ method, will even work on my system:
$ bootctl
Couldn’t find EFI system partition. It is recommended to mount it to /boot/ or /efi/.
Alternatively, use --esp-path= to specify path to mount point.
System:
Not booted with EFI
link sez UEFI Boot Required … If this prints “Not booted with EFI”, this method won’t work.
OH WELL ~ thanks for the assist, but guess I’ll have to look elsewhere.
Heck, on my Gateway’s Ubuntu back when it was at 20.04, hibernate didn’t work at all, then worked but would take 15 minutes to come up, later at 22.04 worked but first resume after standby took 15 minutes, finally recently under 24.04 hibernate works flawlessly as does suspend (aka standby). My Dell’s win7 hibernated fine, but installed win10 on it and suspend works fine but although it has hibernate on power menu, but when triggered it hibernates but can’t restore :-\
May be just another test of patience… a virtue.
…any chance there’s a way to get hibernation/restore on my fedora 43 that fails the ’ bootctl’ test - it exists on an ext4 partition so ubuntu grub can find it, so no btrfs, etc… some alternate method?
or is it just gonna be useless on this like my win10 machine that won’t retore from hibernation…
It might work. From that error message you provided, it sounds like you just need to add that resume= parameter to your kernel command line. I’m not sure how it works though. Does it just point to the swap file? Does the swap file have to be on the “root” partition? Is your /var filesystem on your root partition or have you put it on a separate partition? I don’t know the answers. You will have to find the documentation and figure all of that out.
I think you’re right, as testing hibernation now brings up:
$ systemctl hibernate
Call to Hibernate failed: Not running on EFI and resume= is not set, or noresume is set. No available method to resume from hibernation
btw - That link to hibernation in Fedora Magazine is an article from 2022 ~ here’s a link to hibernation on LinuxConfig.org written in 2025 that seems more usable for me (at least no btrfs method):
https://linuxconfig.org/how-to-restore-hibernation-on-fedora-35
… and I’m just a desktop on an old gateway laptop - no secure boot to worry about, and there’s no encryption - just want a simple machine that I can hibernate/restore at night and use suspend/resume during the day.
here’s discussion on the aticle:
Hmmmmm, still getting this error message even though grub is:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet resume=UUID=77fab13f-9a12-4786-8672-7134a20dfc19 resume_offset=83968"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=77fab13f-9a12-4786-8672-7134a20dfc19 resume_offset=83968"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
and fdtab is:
#
# /etc/fstab
# Created by anaconda on Sat Mar 28 11:38:00 2026
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=77fab13f-9a12-4786-8672-7134a20dfc19 / ext4 defaults 1 1
UUID=b681e60e-3e79-4749-b73c-f113b2f94a04 /boot ext4 defaults 1 2
/var/swap/swapfile none swap defaults 0 0
more:
$ free -h
total used free shared buff/cache available
Mem: 3.8Gi 2.0Gi 300Mi 245Mi 1.8Gi 1.8Gi
Swap: 9.8Gi 20Ki 9.8Gi
sudo swapon -s
[sudo] password for firebat:
Filename Type Size Used Priority
/var/swap/swapfile file 6291452 0 -1
/dev/zram0 partition 3986428 16 100
noticed one area says: Swap: 9.8Gi,
while another says: /var/swap/swapfile file 6291452 (kb?) (6.3Gb)
I followed: https://fedoramagazine.org/hibernation-in-fedora-36-workstation/ pretty closely and everything seemed to go w/o error… but still won’t hibernate - get that missing resume= error thing when I try to hibernate, but there’s info on resume= ![]()
I glanced at the documentation for that resume= parameter. Appearently, you also have to set resume_offset= if you are using a swapfile as opposed to a swap partition.
resume= [SWSUSP]
Specify the partition device for software suspend
Format:
{/dev/<dev> | PARTUUID=<uuid> | <int>:<int> | <hex>}
resume_offset= [SWSUSP]
Specify the offset from the beginning of the partition
given by "resume=" at which the swap header is located,
in <PAGE_SIZE> units (needed only for swap files).
See Documentation/power/swsusp-and-swap-files.txt
How to find the correct value for resume_offset= is documented here:
Further details are here:
https://www.kernel.org/doc/Documentation/power/swsusp-and-swap-files.txt
The former is a total that includes your /dev/zram0 swap device, while the latter is just the size of the swapfile. You probably need to disable /dev/zram0 if you want to enable hibernation. For details about turning off /dev/zram0, see here:
https://fedoraproject.org/wiki/Changes/SwapOnZRAM#How_can_it_be_disabled?
Just an afterthought - since I’m using the Ubuntu 24.04 grub to boot Fedora 43, will this affect Fedora’s hibernation and/or restore? My Windows partition hibernates fine even though it also uses the Ubuntu grub.
also, read this that indicates disabling zram not needed:
Disabling zram (optional) If we find hibernation works reliably on our machine, and we decide we want to disable zram, we can simply uninstall the zram-generator-default package: $ sudo dnf remove zram-generator-default Notice, however, that this step is not needed, since if a traditional swap partition exists, the system is intelligent enough to use it for hibernation, even if the zram device exists.
…and there’s the offset here:
GRUB_CMDLINE_LINUX="rhgb quiet resume=UUID=77fab13f-9a12-4786-8672-7134a20dfc19 resume_offset=83968"
that I got by:
Use offset from: sudo filefrag -v /swapfile |grep " 0:"| awk '{print $4}'
No, it shouldn’t matter what bootloader you use to load the kernel, as long as the kernel parameters are right.
Ah, sorry, I missed that when you replied earlier. If it still doesn’t work, then I don’t know what the problem would be.
You said you were still seeing that “missing resume=” error? One way you might confirm that the kernel parameters were set the way you think they were set would be to run cat /proc/cmdline. That should show the actual parameters that were used to boot the current system.
Her’s what I get - looks like there’s no ‘resume=’ there ~ wonder why…
firebat@fedora:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.19.9-200.fc43.x86_64 root=/dev/sda8
I think you said earlier that you were dual booting this system and using another OS’s bootloader? If so, your configuration changes would need to be made in that other bootloader’s configuration. Configuring one bootloader to manage multiple operating systems is somewhat non-trivial, but it can be done.
the ubuntu grub ‘bootloader’ already has a resume= for ubuntu… doesn’t seem possible to make two entries for resume=…
Like I said, it is somewhat non-trivial, but you can add additional menu entries to GRUB that will target other operating systems on other partitions or disks.
There is another user who is attempting that with another GRUB bootloader (in his case, one that was installed by CatchyOS) here:
He said he accomplished it by adding a 40_custom file with a custom menu entry definition.
I also use a lone bootloader to load multiple opertating systems, but I do it with systemd boot, which is a completely different boot loader that works in a completely different way and it only works on UEFI systems.
I know it can be done, but I haven’t done anything like that with GRUB for ages and about all I can do is point you to the documentation.
If you want, you could try collaborating with that other user who is working on this same problem.
Good luck. ![]()
Sure :D, I can help… I don’t know much about Linux yet… But I’ve been experimenting a lot with the boot process because I’ve been switching between distros all the time, hahaha… So I have some experience, although there are still things I don’t understand, so I can’t vouch for my configuration methods.
Plus, I rely heavily on AI agents… They’re usually very helpful.
But I’m willing to help with what I know so far.
Could you tell me what the main problem is, or what you’re trying to achieve?
Do you want to configure your computer’s boot loader so that the operating systems start up without any problems?