Bug#902416: systemd: systemctl hibernate: unable to resume after upgrade

Mario.Limonciello at dell.com Mario.Limonciello at dell.com
Mon Jul 9 04:56:51 BST 2018


> -----Original Message-----
> From: Joel Cross [mailto:joel at kazbak.co.uk]
> Sent: Saturday, July 7, 2018 10:00 AM
> To: Michael Biebl; Limonciello, Mario; 902416 at bugs.debian.org
> Subject: Re: Bug#902416: systemd: systemctl hibernate: unable to resume after
> upgrade
> 
> On Fri, 6 Jul 2018, at 5:31 PM, Michael Biebl wrote:
> > Am 06.07.2018 um 17:02 schrieb Mario.Limonciello at dell.com:
> > >> -----Original Message-----
> > >> From: Michael Biebl [mailto:biebl at debian.org]
> >
> > >> If you have multiple swap partitions and you run
> > >> echo "disk" > /sys/power/state
> > >> which partition does the kernel use?
> > >>
> > >
> > > Whichever one was configured in /sys/power/resume prior to running that
> command.
> > >
> > > The kernel can't know which one /to/ hibernate to unless it was configured in
> advance.
> > > Just like the initramfs can't know which one to resume /from/ unless it knew
> which one
> > > it resumed to.
> > >
> >
> > Joel, can you please tell us,
> > - which partition you have configured in /etc/initramfs-tools/conf.d/resume
> > - which partition you have configured in /sys/power/resume
> > - the size of both swap partitions
> >
> 
> $ cat /proc/swaps
> Filename				Type		Size	Used	Priority
> /dev/sdb4                               partition	9752572	1473128	100
> /dev/sda8                               partition	6236156	0	10
> 
> $ blkid /dev/sdb4 /dev/sda8
> /dev/sdb4: LABEL="Swap" UUID="0797ee37-d1b9-49ea-a865-c73682cd96a7"
> TYPE="swap" PARTUUID="57f4c922-04"
> /dev/sda8: UUID="84f3e7a4-c3af-4ac1-a789-cc554395a50b" TYPE="swap"
> PARTUUID="170bc00e-08"
> 
> $ grep resume /boot/grub/grub.cfg|head -n 1
> 	linux	/vmlinuz-4.16.0-2-amd64 root=UUID=033d10f2-5402-4632-bed0-
> 5e24842cf1b7 ro  quiet splash resume=UUID=84f3e7a4-c3af-4ac1-a789-
> cc554395a50b
> 
> $ cat /etc/initramfs-tools/conf.d/resume
> cat: /etc/initramfs-tools/conf.d/resume: No such file or directory
> 
> $ cat /sys/power/resume
> 8:8
> 
> From the above (especially grub.cfg) you can see that the smaller, lower-priority
> partition is set as the resume partition (this was actually an oversight on my part
> when I installed the second drive). Do you think this could be what's preventing
> hibernate from working properly?
> 
> Also, do you think it is significant that the /etc/initramfs-tools/conf.d/resume file
> does not exist on my system?
> 
> -Joel

I think I have an understanding on what's happening here.  So when you configured
your system to have a RESUME= variable on the DEFAULT kernel command line then
the kernel chooses to fill this one at bootup (hence the 8:8).  This kernel command line
is also what's passed to the initramfs, so even if you didn't configure that resume file
it's what is used for resuming.

Now the systemd changes have messed this up for you because they are writing to the
biggest swap (changing your 8:8).

As a simple fix, I expect if you change your RESUME= to the other swap partition your
resume behavior will be fine.

That being said, I think it makes sense to amend the systemd logic to also look for the
kernel command line RESUME= variable and choose that if the user had put it on kernel
command line.


More information about the Pkg-systemd-maintainers mailing list