0

I'm using Artix OpenRC actually, which is just Arch with OpenRC instead of Systemd.

This is my first time attempting to make hibernation work with Linux, and so far I'm really afraid of trying it. Most of the tutorials I've found both in text-form and on YouTube kind of suck, and offer a lot of seemingly questionable, very potentially destructive operations without much explanation. They also suffer from a lot of specificity, so there's little explanation about how things work, most are tutorials for specific setups.

Can someone please walk me through:

  1. Creating a swap partition
  2. Enabling hibernation
  3. Then how to trigger it — and maybe some tips on best practices...

I have Linux as dual-boot with Windows, with Windows as a first partition on disk, my lsblk and df give me this:

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   529M  0 part 
├─nvme0n1p2 259:2    0    99M  0 part /boot
├─nvme0n1p3 259:3    0    16M  0 part 
├─nvme0n1p4 259:4    0 418.2G  0 part /windows10
└─nvme0n1p5 259:5    0 512.7G  0 part /
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev              10M     0   10M   0% /dev
run              16G  1.6M   16G   1% /run
/dev/nvme0n1p5  504G  301G  178G  63% /
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
shm              16G  138M   16G   1% /dev/shm
/dev/nvme0n1p2   95M   86M  9.8M  90% /boot
/dev/nvme0n1p4  419G  297G  122G  72% /windows10
tmpfs           3.2G   12K  3.2G   1% /run/user/1000

How do I do this in the safest way possible? Is there a way of going around it with GParted perhaps?

An extra problem that might or might not complicate things is that, when I installed Artix in dual-boot, I wasn't able to integrate Windows into GRUB, so I have to press F12 in order to have access to the Windows partition, otherwise it goes into GRUB while never showing the Windows partition.

1 Answer 1

0

First, Make a swap partition/file(Rule of Thumb, swap size is 2xRAM). GParted should do fine, but if you going to resize your Windows partition better do that in windows(just my personal preference)

Second, make the filesystem and mount it (instructions on Arch Installation Guide should work fine here). Also update your /etc/fstab entries.

Third, you need to add a kernel parameter resume to your bootloader. Again, Arch wiki has the required details for this. Don't forget to rebuild initramfs after that adding the parameter with:

# mkinitcpio -P

That should allow you to hibernate.

For grub not showing Windows, make sure you have os-prober package installed and GRUB_DISABLE_OS_PROBER=false set in /etc/default/grub.

After setting it, regenerate the grub config files with:

# grub-mkconfig -o /boot/grub/grub/cfg
1
  • 1
    Please, place the commands for all of the steps in the answer, don't put a link and assume everything is said and done. If the Arch Wiki were enough, I wouldn't even have asked the question. Generally speaking there are too many details on the Arch Wiki and it's all scattered around. For example, the page you linked talks about formatting the swap partition, not creating it (there's a very succinct section above it, I know...),
    – psygo
    Commented Jul 14, 2021 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .