You are not logged in.

#1 2015-11-08 06:46:54

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

[Solved] How do I gain the ability to hibernate in Arch linux

First of all I have already read the arch wiki but I got a question that I don't know where to find the answer. So to be able to hibernate and save my file on my created swap partition I would have to :
1. Add this parameter to the kernel resume=/dev/sdb1 (this will have to point to the root partition) which is located in the /boot/loader/entries/arch.conf?
2 I need to configure my /etc/mkinitcpio.conf to HOOKS="base udev resume autodetect modconf block filesystems keyboard fsck"?
3. Then I should update my intramfs > mkinitcpio -p linux correct?

Thank you

Last edited by mapring (2015-11-10 09:47:49)

Offline

#2 2015-11-08 09:30:44

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: [Solved] How do I gain the ability to hibernate in Arch linux

You need to obtain quest from Arch Wiki NPC, and then complete it. As reward you will obtain needed skills.
Sorry, I couldn't resist big_smile


But really, you can find needed answers in the very article on the wiki.

mapring wrote:

First of all I have already read the arch wiki but I got a question that I don't know where to find the answer. So to be able to hibernate and save my file on my created swap partition I would have to :
1. Add this parameter to the kernel resume=/dev/sdb1 (this will have to point to the root partition) which is located in the /boot/loader/entries/arch.conf?

Wrong, this have to point to swap partition. I strongly recommend to put UUID instead of /dev/sdb1, since sdb could be "sdanything" at next boot. I don't know what bootloader you are using. If systemd-boot the rest is correct.

2. Yes
3. Yes (if using linux, and not linux-lts, linux-ck, linux-whatever)

Offline

#3 2015-11-09 07:10:25

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

Ok I will give it a go now
Thank you big_smile

Offline

#4 2015-11-09 07:30:03

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

[mapring@P170SM-A ~]$ mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> ERROR: Unable to write to /boot/initramfs-linux.img
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: Unable to write to /boot/initramfs-linux-fallback.img

What happen ?
Did I type something wrong

Offline

#5 2015-11-09 07:48:19

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

OK the problem was that I needed to run with sudo.. Now I got another problem is this look to be servre. For some unknown reason I decided to add resume=UUID=myuuid behide the Linux kernel and I cannot boot.. I'm stuck at the grub screen. Is there a way for me to go back and edit this out. Please tell me there is.

Offline

#6 2015-11-09 07:51:03

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

I will try to find a way to fix this. At the moment I'm looking at pressing Ctrl+alt+f1 but as far as I remember that didn't work before.

Offline

#7 2015-11-09 08:05:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,309

Re: [Solved] How do I gain the ability to hibernate in Arch linux

In the grub screen, you can press a button that allows you to edit the boot line. I'm no grub user, so see the grub docs. The alternative is to boot from a live system (the Arch installer would do) and fix the boot line from there.

Offline

#8 2015-11-09 12:06:52

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: [Solved] How do I gain the ability to hibernate in Arch linux

If you did edit /boot/loader/entries/arch.conf then you're using something else than grub.
You should boot arch installation media, mount /boot partition and just remove that particular entry in bootloader config.

How did you obtain correct UUID?

Lets see how it could be done:
1. Need to check what is UUID of my swap partition.

# lsblk -fs
NAME                        FSTYPE      LABEL UUID                                   MOUNTPOINT
sda1                        swap              7b3c3e59-673c-4f00-afb3-2f4197f535fa   [SWAP]
└─sda                                                                                
 . . . MORE OUTPUT . . .

2. Ok, lets use it.

resume=UUID=7b3c3e59-673c-4f00-afb3-2f4197f535fa

For grub you could put it in /etc/default/grub into GRUB_CMDLINE_LINUX="" like:

GRUB_CMDLINE_LINUX="resume=UUID=7b3c3e59-673c-4f00-afb3-2f4197f535fa"

and regenerate grub.cfg via:

# grub-mkconfig -o /boot/grub/grub.cfg

Offline

#9 2015-11-09 16:52:25

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

I'm back ! (fixed the problem by booting into the arch installer)
As you said I use bootctl not grub. (Don't know why I booted into that screen tongue)
Does the same step you provided to me apply to bootctl ?

Offline

#10 2015-11-10 02:38:55

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: [Solved] How do I gain the ability to hibernate in Arch linux

You need to add boot option to your config, but you already know where it is.

Offline

#11 2015-11-10 09:47:29

mapring
Member
From: Thailand
Registered: 2015-11-08
Posts: 18

Re: [Solved] How do I gain the ability to hibernate in Arch linux

I finally got it working this problem is solved.

Thank you

Offline

Board footer

Powered by FluxBB