# Hibernate not working from swap file

**URL:** <https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139>\
**Category:** General system\
**Created:** [January 3, 2022, 12:40am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139 "2022-01-03T00:40:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ComfyRice](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/comfyrice/32/41507_2.png) [@ComfyRice](https://forum.endeavouros.com/u/ComfyRice)\
**Post date:** [January 3, 2022, 12:40am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/1 "2022-01-03T00:40:08Z")

</div>

So I recently put Endeavour on another of our machines, and since it had 32GB of memory thought “I don’t need swap”, not knowing that swap was necessary for Hibernation.

So I setup a swap file [following these steps](https://forum.endeavouros.com/t/adding-swap-hibernation-after-install/10831/11). After that and a restart my DE now has a Hibernate option in the power options. However, when I use it, it doesn’t actually save my session at all, and turning on the PC after a hibernate is the same as a cold boot, my session wasn’t saved at all.

Has anyone else had this issue? I even tried making my swapfile bigger than my system memory to be extra sure it has enough space to save. I’ve done everything identical to the post except in `etc/default/grub`'s GRUB\_CMDLINE\_LINUX\_DEFAULT I also have ‘quiet’ and ‘nvme\_load=yes’ as they were already there and I didn’t want to mess with the existing config more. Would either of these interfere with saving/loading the state?

Here are my relevant lines of the grub config

```auto
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=<my uuid here> nowatchdog nvme_load=YES"

```

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [January 3, 2022, 12:51am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/2 "2022-01-03T00:51:06Z")

</div>

You didn’t follow the instructions properly & add the UUID of the partition that has the swap file on it. Please go back and re-read the instructions from the post.

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [January 3, 2022, 1:06am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/3 "2022-01-03T01:06:30Z")

</div>

at least it misses ` resume_offset:`

---

<div class="post-metadata">

**Author:** ![ComfyRice](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/comfyrice/32/41507_2.png) [@ComfyRice](https://forum.endeavouros.com/u/ComfyRice)\
**Post date:** [January 3, 2022, 1:37am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/4 "2022-01-03T01:37:39Z")

</div>

Where am I missing that? I have my UUID where I put `<my uuid here>`

---

<div class="post-metadata">

**Author:** ![ComfyRice](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/comfyrice/32/41507_2.png) [@ComfyRice](https://forum.endeavouros.com/u/ComfyRice)\
**Post date:** [January 3, 2022, 1:45am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/5 "2022-01-03T01:45:34Z")

</div>

Ah, thanks. Should that be set in the grub config at all?  
I’m reading the Arch wiki on it [here](https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation), but I’m getting permission denied trying to add the value to /sys/power/resume\_offset, even as root

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [January 3, 2022, 1:46am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/6 "2022-01-03T01:46:38Z")

</div>

I think it needs resume=\<swap\_file\_partition\> resume\_offset=\<swap\_file\_offset\>

[https://wiki.archlinux.org/title/Power\_management/Suspend\_and\_hibernate#Hibernation\_into\_swap\_file](https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file)

---

<div class="post-metadata">

**Author:** ![anon63071375](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@anon63071375](https://forum.endeavouros.com/u/anon63071375)\
**Post date:** [January 3, 2022, 1:56am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/7 "2022-01-03T01:56:00Z")

</div>

You may find this thread very helpful.

> [@Can't seem to get hibernation to work properly](https://forum.endeavouros.com/t/cant-seem-to-get-hibernation-to-work-properly/5933/4):
>
> I usually follow this guide when I setup hibernation. I don’t think you also set the resume\_offset properly Also, if you don’t want to type out the whole sudo grub mkconfig -o /boot/grub/grub.cfg every time you update grub. . . .yay -S update-grub

---

<div class="post-metadata">

**Author:** ![ComfyRice](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/comfyrice/32/41507_2.png) [@ComfyRice](https://forum.endeavouros.com/u/ComfyRice)\
**Post date:** [January 3, 2022, 2:00am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/8 "2022-01-03T02:00:20Z")

</div>

I’ve added the resume\_offset and regenerated my grub config, but it still does not load my session.

```auto
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=<my uuid here> resume_offset=34816 nowatchdog nvme_load=YES"

```

34816 comes from the physical\_offset column from `filefrag -v /swapfile`.

---

<div class="post-metadata">

**Author:** ![ComfyRice](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/comfyrice/32/41507_2.png) [@ComfyRice](https://forum.endeavouros.com/u/ComfyRice)\
**Post date:** [January 3, 2022, 2:12am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/9 "2022-01-03T02:12:29Z")

</div>

Thanks, that was it. I needed to update the mkinitcpio config and generate the images

---

<div class="post-metadata">

**Author:** ![system](https://forum.endeavouros.com/uploads/default/original/2X/9/9ea52f9fd5ef8e609e593c362d61a36295f48be8.png) [@system](https://forum.endeavouros.com/u/system)\
**Post date:** [January 5, 2022, 2:12am UTC](https://forum.endeavouros.com/t/hibernate-not-working-from-swap-file/22139/10 "2022-01-05T02:12:48Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
