Skip to main content
Topic: Recommendations on How to Hibernate with OpenRC (Read 1653 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Recommendations on How to Hibernate with OpenRC

I've been postponing adding hibernation forever with my current Artix OpenRC setup. Mostly it's because I'm very insecure about trying it. I just can't seem to find any comprehensive tutorials on this topic anywhere when it comes to OpenRC, and not even good ones for Systemd.

Does anyone have a link or a simple recipe for this? The closest I've got so far was this video, but it's nothing much anyway.


Re: Recommendations on How to Hibernate with OpenRC

Reply #2
I wish I had the stomach to go through that whole tutorial for my first time doing it, it seems so dangerous if you make a mistake.

I think I'll probably wait for Ermanno Ferrari or some other good Linux YouTuber to make a video on the topic, I guess then.

Re: Recommendations on How to Hibernate with OpenRC

Reply #3
All you need is:

1. A swap partition, say /dev/sda3
2. Add 'resume' to HOOKS in /etc/mkinitcpio.conf
3. Add 'resume=/dev/sda3' to GRUB_CMDLINE_LINUX in /etc/default/grub
4. Re-create initrd and grub.cfg: grub-mkconfig -o /boot/grub/grub.cfg && mkinitcpio -P
5. Profit

Re: Recommendations on How to Hibernate with OpenRC

Reply #4
Thanks for the nice outline, @nous. Do you know if there are any serious risks to the integrity of my system if I make a mistake? If so, could you briefly list them? Or am I just being paranoid?

Re: Recommendations on How to Hibernate with OpenRC

Reply #5
Using a swap partition, the worst that could happen is you plugging external media, it getting recognized as /dev/sda, and you overwriting the one its partitions. However, it's very unlikely, and the risk becomes zero if you use the UUID (printed when you run mkswap) instead of the /dev/sdXY.

 

Re: Recommendations on How to Hibernate with OpenRC

Reply #6
What @capezotte said. I use labels instead of UUIDs though, ROOT for / and SWAP for my swap partition. The entries then become /dev/disk/by-label/SWAP instead of /dev/sda3.