Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap files not recognized as swap in resume module #496

Closed
jonas2515 opened this issue Nov 28, 2018 · 7 comments · Fixed by #715
Closed

Swap files not recognized as swap in resume module #496

jonas2515 opened this issue Nov 28, 2018 · 7 comments · Fixed by #715

Comments

@jonas2515
Copy link

@jonas2515 jonas2515 commented Nov 28, 2018

If a swap file is used for hibernation, dracut doesn't automatically install the resume module to the initramfs, making hibernation impossible.

This happens because in the check() function of the resume module, the host_fs_types array is checked for file systems of type "swap" and this array doesn't include swap files. To fix this issue and automatically install the resume module if a swapfile is used, the host_fs_types array should include swap files or the check() function should be adjusted to search for swap files itself.

@haraldh
Copy link
Collaborator

@haraldh haraldh commented Nov 30, 2018

Swap files for hibernation sounds so fragile...

@haraldh
Copy link
Collaborator

@haraldh haraldh commented Nov 30, 2018

Does the kernel even support that?

@jonas2515
Copy link
Author

@jonas2515 jonas2515 commented Nov 30, 2018

Actually it's way better than swap partitions. If you have full disk encryption you don't have to go through the whole hassle of encrypting your swap partition. I can setup a swapfile in 5 minutes without having to resize all my partitions and I can resize it if I want to.

Here's some documentation:
https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption#Using_a_swap_file
https://wiki.archlinux.org/index.php/swap#Swap_file

@l29ah
Copy link

@l29ah l29ah commented Dec 25, 2019

@jonas2515 how did you manage to tell dracut to specify the swap file offset to the kernel?

@jonas2515
Copy link
Author

@jonas2515 jonas2515 commented Jan 23, 2020

@l29ah It's been some time since I set up hibernation on my machine, but IIRC the only thing I had to do was set the kernel parameters as described in the Arch wiki and make sure the resume module is loaded by adding add_dracutmodules+="resume" to /etc/dracut.conf.

@jonas2515
Copy link
Author

@jonas2515 jonas2515 commented Jan 23, 2020

@haraldh I'd like to fix that issue, do you have any suggestions or implementation ideas for how we can solve this?

@l29ah
Copy link

@l29ah l29ah commented Jan 23, 2020

Oh, the hard-coded offset parameter, okay. I was hoping dracut is able to tell the offset itself, since i'm considering producing a swap file on demand only for the suspending purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants