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

Hibernation #157

Closed
josephnz opened this issue Apr 29, 2021 · 8 comments · Fixed by #160
Closed

Hibernation #157

josephnz opened this issue Apr 29, 2021 · 8 comments · Fixed by #160

Comments

@josephnz
Copy link

@ne9z, I have the following issue with the Arch Linux Root on ZFS HOWTO:
Can you please include the steps to enable hibernation with encrypted bootpool ?

@mskarbek
Copy link
Contributor

@nabijaczleweli
Copy link

nabijaczleweli commented Apr 29, 2021

heh, yeah. i say this with as much sincerity as i can muster: if you have to ask, the answer is "you can't"

(and if you recreate what i did there, you have a fifty-fifty chance of it either not working or raking your pool each time you try if you so much as breathe at it wrong. I permanently damaged that pool more times than I can count, so, I repeat: do NOT do it on a pool you can't can)

@josephnz
Copy link
Author

just to clarify, I have a separate swap partition as described in the document. Are you saying it's still a no go? If so perhaps the document should be modified. For eg: currently it says
"Adjust the swap partition size to your needs. If hibernation is needed, swap size should be same or larger than RAM"

@ghost
Copy link

ghost commented Apr 30, 2021

If you have created a separate swap partition during installation and enabled encryption, you need to

  • encrypt boot pool with LUKS1, see here
  • encrypt swap partition with LUKS2 and add kernel cmdlines, see here

I removed the hibernation section as the guide is getting too long ;-)

@ghost
Copy link

ghost commented Apr 30, 2021

@nabijaczleweli I guess you are doing swap on zvol.

  • zvol in general is extremely patchy, see here and other issues, it should be avoided at all cost.
  • swap on zvol is known to crash the system, see here
  • resume hibernation from a pool will corrupt it, this is known

This guide does not use ZFS for swap at all, for reasons described above. It creates a randomly encrypted swap partition by default and the user can optionally switch to persistent (LUKS2) encryption in optional configuration section.

After switching LUKS2 for swap, it is possible to enable hibernation (suspend to disk).

@ghost
Copy link

ghost commented Apr 30, 2021

Also note that hibernation might not work on some hardware.

  • HP EliteBook 820 G3, i3 6100U, integrated Intel Graphics, works
  • HP EliteBook 735 G5, R5 2500U, integrated Radeon Vega 8 Graphics, black screen on resume

Basically resume from hibernation only works on integrated Intel graphics. Expect trouble if you are using discrete graphics or AMD APU. This is not specific to this guide - stock Ubuntu installation on ext4 also has these problems.

@josephnz
Copy link
Author

josephnz commented May 1, 2021 via email

@ghost ghost mentioned this issue May 2, 2021
@ghost
Copy link

ghost commented May 2, 2021

I've opened a pull request to add this instruction back, among other improvements. #160

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