You are not logged in.

#1 2012-12-02 15:32:42

letian_north
Member
Registered: 2012-11-28
Posts: 19

[SOLVED]Hibernation fails with "systemd hibernate"

Hibernation does not work on my laptop. After issuing the "systemd hibernate" laptop goes black, but after 10 seconds it wakes up again, with my lid light still blinking.

I'm receiving "cannot find swap device" and "cannot get swap writer" message

# systemctl hibernate
A dependency job for hibernate.target failed. See 'journalctl -xn' for details.

Last edited by letian_north (2012-12-02 16:35:04)

Offline

#2 2012-12-02 16:05:44

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED]Hibernation fails with "systemd hibernate"

Just to make sure.... do you have a swap device?

Offline

#3 2012-12-02 16:26:59

letian_north
Member
Registered: 2012-11-28
Posts: 19

Re: [SOLVED]Hibernation fails with "systemd hibernate"

Ok, I set that thing up.
First try running

#swapon -s
Filename				Type		Size	Used	Priority
/dev/sda4                              	partition	2091004	103532	-1

If you don't see any output, then you need to make/activate your swap partition. For that purpose use any partition tool like fdisk/cfdisk. Read more here

Then you need to check if your mkinitcpio.conf, grub, fstab have the necessary lines for your swap image file to be read at boot.
Add this line to /etc/fstab file, so that swap is mounted by the system:

# /dev/sda4
UUID=YOUR_DISK_UUID_NUMBER	none swap defaults 0 0

to find the uuid of your swap partition do blkid /dev/sdaX, X -- is the number of your swap partition.

Go to /etc/mkinitcpio.conf and add "resume" to HOOKS array like this:

HOOKS="base udev autodetect pata scsi sata filesystems usbinput fsck resume"

Go to /etc/default/grub and add this line "resume=/dev/sdaX" like this:

GRUB_CMDLINE_LINUX="resume=/dev/sda4"

After that run the following commands to update your grub setup and rebuild the ramdisk image.

# grub-mkconfig -o /boot/grub/grub.cfg
# mkinitcpio -p linux

Go and try "systemctl hibernate", all should work now.

Last edited by letian_north (2012-12-02 16:33:20)

Offline

#4 2013-01-20 00:55:30

creese
Member
Registered: 2012-07-21
Posts: 26

Re: [SOLVED]Hibernation fails with "systemd hibernate"

My situation is similar, but I use EFISTUB as my bootloader (no GRUB). What steps would I need to take to tell it how to find the swap partition?

Offline

#5 2013-01-20 03:18:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED]Hibernation fails with "systemd hibernate"

Seriously?  Have you tried the wiki?

Offline

#6 2013-01-20 03:45:19

creese
Member
Registered: 2012-07-21
Posts: 26

Re: [SOLVED]Hibernation fails with "systemd hibernate"

Yes.

Offline

#7 2013-01-20 19:52:07

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: [SOLVED]Hibernation fails with "systemd hibernate"

I had this problem not long time ago and I fixed it this way:

# swapoff /dev/drive/swap
# swapon -f /dev/drive/swap

Offline

#8 2013-01-20 21:00:57

creese
Member
Registered: 2012-07-21
Posts: 26

Re: [SOLVED]Hibernation fails with "systemd hibernate"

I had

resume=/path/to/swap

in the wrong place.

Offline

Board footer

Powered by FluxBB