Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hibernate is available, but it does not work by default on Fedora 24.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where to store its state (memory) on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   73242620    1004    -1

Add this param to the boot config template:

As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of this quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting.

# sudo grub2-mkconfig -o /boot/grub2/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

Hibernate is available, but it does not work by default default on Fedora 24.24 due to a missing parameter.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where to store its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   73242620    1004    -1

Add this param to the boot config template:

As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of this quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting.

# sudo grub2-mkconfig -o /boot/grub2/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

Hibernate is available, but it does not work by default on Fedora 24 due to a missing parameter.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   73242620 16777216    1004    -1

Add this param parameter to the boot config template:

template:
As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of this the quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting.

# sudo grub2-mkconfig -o /boot/grub2/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

After a reboot, you can verify that the parameter is used by running the following command. The output should contain the resume parameter:

$ cat /proc/cmdline

You should then be able to hibernate the system using the GUI provided by your favorite desktop environment.

Hibernate is available, but it does not work by default on Fedora 24 due to a missing parameter.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   16777216    1004    -1

Add this parameter to the boot config template:
As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of the quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting.booting. The following command writes the boot configuration for BIOS systems. EFI systems have a different config file (see below). If you're not sure, make sure the file exists.

# sudo grub2-mkconfig -o /boot/grub2/grub.cfg

EFI systems may use /boot/efi/EFI/fedora/grub.cfg. If your system is using that file, use:

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

After a reboot, you can verify that the parameter is used by running the following command. The output should contain the resume parameter:

$ cat /proc/cmdline

You should then be able to hibernate the system using the GUI provided by your favorite desktop environment.

Hibernate is available, but it does not work by default on Fedora 24 due to a missing parameter.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   16777216    1004    -1

Note that this gives you the current device path of the mounted swap partition. If your swap partition is on top of another filesystem layer, e.g., if it's encrypted (luks/dmcrypt), use the path in your fstab, which might differ from the above output:

# cat /etc/fstab | grep swap
/dev/mapper/luks-123 swap                    swap    defaults,x-systemd.device-timeout=0 0 0

In this case, you might end up with something like: resume=/dev/mapper/luks-123

Add this parameter to the boot config template:
As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of the quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting. The following command writes the boot configuration for BIOS systems. EFI systems have a different config file (see below). If you're not sure, make sure the file exists.

# grub2-mkconfig -o /boot/grub2/grub.cfg

EFI systems may use /boot/efi/EFI/fedora/grub.cfg. If your system is using that file, use:

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

After a reboot, you can verify that the parameter is used by running the following command. The output should contain the resume parameter:

$ cat /proc/cmdline

You should then be able to hibernate the system using the GUI provided by your favorite desktop environment.

Hibernate is available, but it does not work by default on Fedora 24 due to a missing parameter.

When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted. In order for hibernate to work properly, the system needs to know where its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).

When booting, the Linux kernel must be provided with a resume parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.

Find out what you need to add:
It's resume=/path/to/swap, where /path/to/swap must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2 (parameter: resume=/dev/sda2):

# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                               partition   16777216    1004    -1

Note that this gives you the current device path of the mounted swap partition. If your swap partition is on top of another filesystem layer, e.g., if it's encrypted (luks/dmcrypt), use the path in your fstab, which might differ from the above output:

# cat /etc/fstab | grep swap
swap /etc/fstab
/dev/mapper/luks-123 swap                    swap    defaults,x-systemd.device-timeout=0 0 0

In this case, you might end up with something like: resume=/dev/mapper/luks-123

Add this parameter to the boot config template:
As root, edit /etc/default/grub (e.g., sudo vi ... or sudo gedit /etc/default/grub), find the line that starts with GRUB_CMDLINE_LINUX= and append the resume=... parameter at the end of the quote (before ").

Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting. The following command writes the boot configuration for BIOS systems. EFI systems have a different config file (see below). If you're not sure, make sure the file exists.

# grub2-mkconfig -o /boot/grub2/grub.cfg

EFI systems may use /boot/efi/EFI/fedora/grub.cfg. If your system is using that file, use:

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

This is the command you mentioned in your question, but as long as you don't update the config template by adding the relevant parameter, you're just recreating the same boot config that you already have, which obviously does not solve your problem.

After a reboot, you can verify that the parameter is used by running the following command. The output should contain the resume parameter:

$ cat /proc/cmdline

You should then be able to hibernate the system using the GUI provided by your favorite desktop environment.