You are not logged in.

#1 2021-10-05 19:43:09

kbunny
Member
Registered: 2021-04-04
Posts: 29

[SOLVED]resume: no device specified for hibernation

Hi,

I've been struggling setting up hibernation

I created a swap file on /

-rw-------   1 root root  16G Oct  5 19:32 swapfile
cat /proc/swaps
Filename     Type            Size            Used            Priority
/swapfile       file            16777212        0               -2         

configured the initramfs and regenerate it

cat /etc/mkinitcpio.conf | grep resume
HOOKS=(base udev autodetect modconf block filesystems keyboard resume fsck)

and modify the kernel parameters

cat /etc/default/grub | grep resume
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet iommu=soft resume=UUID=942a579c-141a-4e77-a743-848bbda9891e resume_offset=8540160"
sudo grub-mkconfig -o /boot/grub/grub.cfg && cat /boot/grub/grub.cfg | grep resume
linux   /vmlinuz-linux root=UUID=942a579c-141a-4e77-a743-848bbda9891e rw  loglevel=3 quiet iommu=soft resume=UUID=942a579c-141a-4e77-a743-848bbda9891e resume_offset=8540160

On boot this error shows up:

ERROR: no device specified for hibernation

Basically systemctl hibernate acts as shutdown

Last edited by kbunny (2021-10-07 16:27:01)

Offline

#2 2021-10-05 20:36:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

btrfs? LV?
How did you calculate the offset?

https://wiki.archlinux.org/title/Power_ … e_on_Btrfs

Offline

#3 2021-10-06 12:34:28

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

btrfs? LV?
How did you calculate the offset?

https://wiki.archlinux.org/title/Power_ … e_on_Btrfs

I'm not using LVM neither btrfs

I calculated the offset using

filefrag -v /swapfile | awk '{ if($1=="0:"){print substr($4, 1, length($4)-2)} }'

Offline

#4 2021-10-06 12:57:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

ZFS? Parallel windows installation?

lsblk -f

Offline

#5 2021-10-06 13:03:04

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

ZFS? Parallel windows installation?

lsblk -f

Nope

NAME   FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
└─sda3 ext4   1.0         942a579c-141a-4e77-a743-848bbda9891e   98.7G    50% /boot
                                                                              /
sdb

Last edited by kbunny (2021-10-06 13:08:21)

Offline

#6 2021-10-06 13:10:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

Copy and paste error?

Offline

#7 2021-10-06 13:20:43

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

Copy and paste error?

ERROR: resume: no device specified for hibernation

Last edited by kbunny (2021-10-06 13:20:57)

Offline

#8 2021-10-06 13:22:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

No, in #5 - there's something wrong w/ that lsblk.

Offline

#9 2021-10-06 16:46:57

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

No, in #5 - there's something wrong w/ that lsblk.

It returns no error..

Offline

#10 2021-10-06 16:49:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

The lsblk output is severly misaligned or whatever…, please run

lsblk -f | curl -F 'f:1=<-' ix.io

and post the url you receive

Offline

#11 2021-10-06 16:52:53

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

The lsblk output is severly misaligned or whatever…, please run

lsblk -f | curl -F 'f:1=<-' ix.io

and post the url you receive

It's because of xsel

http://ix.io/3B1X

Offline

#12 2021-10-06 17:07:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

That's the same output and it's weirdly off.
sda3 is ~100GB and mounted to /boot, nothing(?) is mounted to /, there's some sda1, no sda2 and an sdb.
Did you shred the partition table?
=>

fdisk -l /dev/sda

Offline

#13 2021-10-06 17:13:50

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

That's the same output and it's weirdly off.
sda3 is ~100GB and mounted to /boot, nothing(?) is mounted to /, there's some sda1, no sda2 and an sdb.
Did you shred the partition table?
=>

fdisk -l /dev/sda
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4A456725-6CA2-D044-893E-DABB711039C2

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda3  3147776 468862094 465714319 222.1G Linux filesystem


Disk /dev/sdb: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 16E83746-7F17-4270-8089-4675CB258D17

I had /dev/sda2 as swap, which I deleted

Offline

#14 2021-10-06 17:36:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

/dev/sda3  3147776 468862094 465714319 222.1G Linux filesystem

That's significantly bigger than the filesystem listed in lsblk, I assume you repartitioned the drive but didn't move & grow the filesystem?

Offline

#15 2021-10-06 17:58:05

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:
/dev/sda3  3147776 468862094 465714319 222.1G Linux filesystem

That's significantly bigger than the filesystem listed in lsblk, I assume you repartitioned the drive but didn't move & grow the filesystem?

There's around 1GB unallocated space on /dev/sda(the old swap partition size) and 99GB free space on /dev/sda3, allocated

Offline

#16 2021-10-06 18:08:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

Ah, lsblk does indeed account for the 10% reserve, sorry.

Can you boot w/ "resume=/dev/sda3"?

Offline

#17 2021-10-06 18:15:21

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

Ah, lsblk does indeed account for the 10% reserve, sorry.

Can you boot w/ "resume=/dev/sda3"?

Boot? Yes
Hibernate? No, same error

Offline

#18 2021-10-06 18:34:05

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

Got something out of journalctl

Oct 06 21:30:38 ArchWrkSt systemd[1]: Reached target Sleep.
Oct 06 21:30:38 ArchWrkSt systemd[1]: Starting Hibernate...
Oct 06 21:30:38 ArchWrkSt systemd-sleep[955]: Failed to find location to hibernate to: Function not implemented
Oct 06 21:30:38 ArchWrkSt systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Oct 06 21:30:38 ArchWrkSt systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
Oct 06 21:30:38 ArchWrkSt systemd[1]: Failed to start Hibernate.
Oct 06 21:30:38 ArchWrkSt systemd[1]: Dependency failed for System Hibernation.
Oct 06 21:30:38 ArchWrkSt systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.
Oct 06 21:30:38 ArchWrkSt audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hibernate comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termi>
Oct 06 21:30:38 ArchWrkSt systemd-logind[308]: Operation 'sleep' finished.
Oct 06 21:30:38 ArchWrkSt systemd[1]: Stopped target Sleep.

edit: nvm I put 8:0 instead of 8:3 in /sys/power/resume

Last edited by kbunny (2021-10-06 18:37:26)

Offline

#19 2021-10-06 19:47:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

Do/did you always hibernate by writing /sys/power/resume and is 8:3 correct (lsblk) and do you also write /sys/power/resume_offset ?
Do the journals otherwise promise successful hibernation preperation?
You did "mkswap /swapfile" (ie. did follow https://wiki.archlinux.org/title/Swap#Manually )?

Offline

#20 2021-10-07 12:46:18

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

Do/did you always hibernate by writing /sys/power/resume and is 8:3 correct (lsblk) and do you also write /sys/power/resume_offset ?
Do the journals otherwise promise successful hibernation preperation?
You did "mkswap /swapfile" (ie. did follow https://wiki.archlinux.org/title/Swap#Manually )?

I tried to hibernate using /sys/power/resume to avoid reboot
I also wrote /sys/power/resume_offset
I did mkswap on that file

cat /proc/swaps
Filename                                Type            Size            Used            Priority
/swapfile                               file            16777212        0               -2

systemd-hibernation log:

sudo journalctl -e -u systemd-hibernate
-- Boot acb38c2a1d1642a3b93d6039e97108e1 --
Oct 07 15:35:58 ArchWrkSt systemd[1]: Starting Hibernate...
Oct 07 15:35:58 ArchWrkSt systemd-sleep[29028]: Entering sleep state 'hibernate'...

Offline

#21 2021-10-07 14:43:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

I tried to hibernate using /sys/power/resume to avoid reboot

Don't.
Reboot (you only need to do that once to get the kernel commandline) and then use the regular "systemctl hibernate" for hibernation.

Offline

#22 2021-10-07 14:51:58

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

I tried to hibernate using /sys/power/resume to avoid reboot

Don't.
Reboot (you only need to do that once to get the kernel commandline) and then use the regular "systemctl hibernate" for hibernation.

Tried both. Same error

Offline

#23 2021-10-07 16:17:07

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

Edited kernel parameters in grub manually and it works. It doesn't pick up what's in /boot/grub/grub.cfg ffs

Offline

#24 2021-10-07 16:24:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED]resume: no device specified for hibernation

But you had

sudo grub-mkconfig -o /boot/grub/grub.cfg && cat /boot/grub/grub.cfg | grep resume
linux   /vmlinuz-linux root=UUID=942a579c-141a-4e77-a743-848bbda9891e rw  loglevel=3 quiet iommu=soft resume=UUID=942a579c-141a-4e77-a743-848bbda9891e resume_offset=8540160

?

Did you simpyl forget to mount the /boot partition at the time?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#25 2021-10-07 16:26:38

kbunny
Member
Registered: 2021-04-04
Posts: 29

Re: [SOLVED]resume: no device specified for hibernation

seth wrote:

But you had

sudo grub-mkconfig -o /boot/grub/grub.cfg && cat /boot/grub/grub.cfg | grep resume
linux   /vmlinuz-linux root=UUID=942a579c-141a-4e77-a743-848bbda9891e rw  loglevel=3 quiet iommu=soft resume=UUID=942a579c-141a-4e77-a743-848bbda9891e resume_offset=8540160

?

Did you simpyl forget to mount the /boot partition at the time?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

No. It doesn't read /boot/grub/grub.cfg

Offline

Board footer

Powered by FluxBB