You are not logged in.
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
Just to make sure.... do you have a swap device?
Offline
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
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
Seriously? Have you tried the wiki?
Offline
Yes.
Offline
I had this problem not long time ago and I fixed it this way:
# swapoff /dev/drive/swap
# swapon -f /dev/drive/swap
Offline
Offline