[no longer SOLVED] Resume Hibernation uswsusp freeze at boot

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Wouter_db

[no longer SOLVED] Resume Hibernation uswsusp freeze at boot

Post by Wouter_db »

Hello all, I have a problem and hope that the fix will have me abandon Win7 completely.

In Mint 13 XFCE suspend and Hibernation where broken on my Asus EEEPC, but with Mint 14 XFCE at least suspend is working.
All that remains is fixing the resume from hibernation. The system seems to go to Hibernation just fine and shuts down. But when I boot up and select Mint (Win7 dual boot) in Grub2.00 there's no 'Resume from disk xxx' message and it's treated as a normal boot.

So the swap file's disk image is not used (or written) for some reason. The swap file's obviously enabled as seen in swapon -s & the blkid output:

Code: Select all

Filename				Type		Size	Used	Priority
/dev/sda6                               partition	1952764	168	-1

Code: Select all

/dev/sda1: LABEL="WIN7" UUID="F430478C304754B0" TYPE="ntfs" 
/dev/sda2: LABEL="RECOV" UUID="CAD0-08A7" TYPE="vfat" 
/dev/sda5: LABEL="SHARED" UUID="B614-DB8E" TYPE="vfat" 
/dev/sda6: UUID="ad8066cd-478f-44bf-9171-9b9c116ab4bf" TYPE="swap" 
/dev/sda7: UUID="e28ff18a-af9f-455e-a590-96bfb77dd942" TYPE="ext3" 
/dev/sda8: UUID="2da104e0-ce4e-4f6c-acd3-9e7991d8afa2" TYPE="ext3" 
I tried altering the resume file in /usr/share/initramfs-tools/scripts/local-premount from identification by Label to UUID, but to no avail.
Original Resume file:

Code: Select all

#!/bin/sh

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

if [ -z "${resume}" ]; then
	exit 0
fi

case $resume in
LABEL=*)
	resume="${resume#LABEL=}"

	# support any / in LABEL= path (escape to \x2f)
	case "${resume}" in
	*/*)
		if  command -v sed >/dev/null 2>&1; then
			resume="$(echo ${resume} | sed 's,/,\\x2f,g')"
		else
			if [ "${resume}" != "${resume#/}" ]; then
				resume="\x2f${resume#/}"
			fi
			if [ "${resume}" != "${resume%/}" ]; then
				resume="${resume%/}\x2f"
			fi
			IFS='/'
			newresume=
			for s in $resume; do
				newresume="${newresume:+${newresume}\\x2f}${s}"
			done
			unset IFS
			resume="${newresume}"
		fi
	esac
	resume="/dev/disk/by-label/${resume}"
	;;
UUID=*)
	resume="/dev/disk/by-uuid/${resume#UUID=}"
	;;
esac

SWAPTYPE=$(wait-for-root "${resume}" ${RESUMEDELAY:-5})

case "${SWAPTYPE}" in
    swsuspend|s1suspend|s2suspend|ulsuspend|tuxonice)
	if [ -x /bin/plymouth ] && plymouth --ping; then
		plymouth message --text="Resuming from $resume"
	fi

	# hardcode path, uswsusp ships an resume binary too
	if [ -n "${resume_offset}" ]; then
		/bin/resume ${resume} ${resume_offset}
	else
		/bin/resume ${resume}
	fi
	;;
esac
ANd the altered one:

Code: Select all

#!/bin/sh

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

if [ -z "${resume}" ]; then
	exit 0
fi

case $resume in
LABEL=*)
	resume="${resume#UUID=ad8066cd-478f-44bf-9171-9b9c116ab4bf}"

	# support any / in LABEL= path (escape to \x2f)
	case "${resume}" in
	*/*)
		if  command -v sed >/dev/null 2>&1; then
			resume="$(echo ${resume} | sed 's,/,\\x2f,g')"
		else
			if [ "${resume}" != "${resume#/}" ]; then
				resume="\x2f${resume#/}"
			fi
			if [ "${resume}" != "${resume%/}" ]; then
				resume="${resume%/}\x2f"
			fi
			IFS='/'
			newresume=
			for s in $resume; do
				newresume="${newresume:+${newresume}\\x2f}${s}"
			done
			unset IFS
			resume="${newresume}"
		fi
	esac
	resume="/dev/disk/by-uuid/${resume#UUID=ad8066cd-478f-44bf-9171-9b9c116ab4bf}"
	;;
UUID=*)
	resume="/dev/disk/by-uuid/${resume#UUID=ad8066cd-478f-44bf-9171-9b9c116ab4bf}"
	;;
esac

SWAPTYPE=$(wait-for-root "${resume}" ${RESUMEDELAY:-5})

case "${SWAPTYPE}" in
    swsuspend|s1suspend|s2suspend|ulsuspend|tuxonice)
	if [ -x /bin/plymouth ] && plymouth --ping; then
		plymouth message --text="Resuming from $resume"
	fi

	# hardcode path, uswsusp ships an resume binary too
	if [ -n "${resume_offset}" ]; then
		/bin/resume ${resume} ${resume_offset}
	else
		/bin/resume ${resume}
	fi
	;;
esac
I also installed the 'powermanagement-interface' package, but again to no effect. I'm kinda at a loss now.. If anyone can help me out, much appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Matt267
Level 3
Level 3
Posts: 184
Joined: Sat May 07, 2011 7:53 am
Location: USA

Re: Resume from Hibernation elusive..

Post by Matt267 »

Wouter,

Maybe there is something here that might help: http://forums.linuxmint.com/viewtopic.php?f=200&t=55859 It's worked for me in LMDE, but I haven't tried it for other mints distros.

Matt
Wouter_db

Re: Resume from Hibernation elusive..

Post by Wouter_db »

Thx for the link, but I allreay dug trough that one. For some reason my Resume file seems different then the one they use.
I can't see the proper way of inserted my UUID's (it keeps mentioning 'LABEL', but swap doesn't have one, doh.) into the code.
This is how my Resume file looks:

Code: Select all

#!/bin/sh

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

if [ -z "${resume}" ]; then
	exit 0
fi

case $resume in
LABEL=*)
	resume="${resume#LABEL=}"

	# support any / in LABEL= path (escape to \x2f)
	case "${resume}" in
	*/*)
		if  command -v sed >/dev/null 2>&1; then
			resume="$(echo ${resume} | sed 's,/,\\x2f,g')"
		else
			if [ "${resume}" != "${resume#/}" ]; then
				resume="\x2f${resume#/}"
			fi
			if [ "${resume}" != "${resume%/}" ]; then
				resume="${resume%/}\x2f"
			fi
			IFS='/'
			newresume=
			for s in $resume; do
				newresume="${newresume:+${newresume}\\x2f}${s}"
			done
			unset IFS
			resume="${newresume}"
		fi
	esac
	resume="/dev/disk/by-label/${resume}"
	;;
UUID=*)
	resume="/dev/disk/by-uuid/${resume#UUID=}"
	;;
esac

SWAPTYPE=$(wait-for-root "${resume}" ${RESUMEDELAY:-5})

case "${SWAPTYPE}" in
    swsuspend|s1suspend|s2suspend|ulsuspend|tuxonice)
	if [ -x /bin/plymouth ] && plymouth --ping; then
		plymouth message --text="Resuming from $resume"
	fi

	# hardcode path, uswsusp ships an resume binary too
	if [ -n "${resume_offset}" ]; then
		/bin/resume ${resume} ${resume_offset}
	else
		/bin/resume ${resume}
	fi
	;;
esac
I checked the logs, and my system indeed goes to Hibernation just fine, as suspected it's when it has to use the disk image it fails to do so. Could Grub2 also be at fault here? I've read something about inserted a kernel line that identifies the resume UUID and needs some kind of 'offset' as well. But that might be for a swap-file, not a swap partition.

I've nearly exhausted my options I'm afraid.
Matt267
Level 3
Level 3
Posts: 184
Joined: Sat May 07, 2011 7:53 am
Location: USA

Re: Resume from Hibernation elusive..

Post by Matt267 »

do you have "laptopmode" installed? Maybe you can try creating a new resume file? Obviously you would want to save your current resume file and create a new file which includes only:

Code: Select all

#RESUME=UUID=xxxxxxxx
RESUME=/dev/disk/by-uuid/xxxxxxxx
Then run:

Code: Select all

update-initramfs -u
I don't know why your current resume file has so much stuff in it. If the new file doesn't work, then you can always restore the current one. But, keep in mind, I'm not an expert here. But that's what I would do.

Matt
Wouter_db

Re: Resume from Hibernation elusive..

Post by Wouter_db »

Thx for your suggestions. I changed the resume file and replaced it with the two lines you mentioned, but sadly to no effect. It really seems my laptop is completely ignoring the resume file altogether. I triple checked the UUID's in fstab, and they do match up and the swap partition is active and used.

Could it have anything to do with the partition architecture o my laptop? The Mint, Home and swap partitions are on an extended partition. I'm not fully sure but I think I've read something about this on a forum.

Oh, and I didn't had laptop-mode-tools installed, but thx for the tip because it helped reduce power consumption even more in cooperation with the Jupiter applet + EEEPC files.
Matt267
Level 3
Level 3
Posts: 184
Joined: Sat May 07, 2011 7:53 am
Location: USA

Re: Resume from Hibernation elusive..

Post by Matt267 »

Sorry I wasn't able to help with the hibernation issue. But I'm glad I helped save you power consumption. (Powertop might help save some power too.) Hopefully someone with more knowledge then I will come along and help you troubleshoot the hibernating problem.

Matt
Wouter_db

Re: Resume from Hibernation elusive..

Post by Wouter_db »

UPDATE.

Every now and then I find a new snippet of information that I'm trying out to fix the hibernation issue I described.

I installed the 'uswsusp package' as an alternative to PM-utils that govern Hibernate/suspend, and behold (some) progress. :D
What happens now is that when I press the Hibernation button or type sudo s2disk the system logs out, goes to the terminal and you see the image file being made and compressed with no errors of any kind.

At boot you first get GRUB2.0 and select Mint as usual. Then you see in a terminal style way that it actually finds and loads the image file from the swap partition. Last is the line that says 'Resume: Loading Image File successful' which sounds great, but then the system hangs.

Dammit, so close. :evil:

I then tried several suggested kernel commands like resume=/dev/sda6, nomodeset and acpi_sleep=nonvs but no no effect. I'm almost there. It seems it's not really a problem with Hibernation itself, but with some kind of hardware error (ehci, xhci?) halting the system (that's where acpi_sleep=nonvs came in). I tried to look into the suspend logfile and Syslog but they list nothing. Perhaps I need a different logfile?

Suspend log:

Code: Select all

enabled, active

/usr/lib/pm-utils/sleep.d/01laptop-mode resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/00powersave resume suspend:

/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/00logging resume suspend:

/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change resume suspend:

/usr/lib/pm-utils/sleep.d/000kernel-change resume suspend: success.
Running hook /etc/pm/sleep.d/00-jupiter-restore resume suspend:

/etc/pm/sleep.d/00-jupiter-restore resume suspend: success.
Wed Mar 27 19:24:09 NZDT 2013: Finished.
Initial commandline parameters: 
Wed Mar 27 20:19:35 NZDT 2013: Running hooks for hibernate.
Running hook /etc/pm/sleep.d/00-jupiter-restore hibernate hibernate:

/etc/pm/sleep.d/00-jupiter-restore hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate:

/usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:
Linux ICBM 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 19:02:34 UTC 2013 i686 athlon i686 GNU/Linux
Module                  Size  Used by
btrfs                 735359  0 
zlib_deflate           26446  1 btrfs
libcrc32c              12544  1 btrfs
ufs                    73638  0 
qnx4                   13102  0 
hfsplus                83192  0 
hfs                    49291  0 
minix                  31288  0 
ntfs                   99830  0 
msdos                  17133  0 
jfs                   173906  0 
xfs                   744278  0 
reiserfs              229048  0 
ext2                   67205  0 
zram                   18068  2 
rfcomm                 37277  0 
bnep                   17708  2 
parport_pc             31969  0 
ppdev                  12818  0 
lp                     13300  0 
bluetooth             183270  10 rfcomm,bnep
parport                40754  3 parport_pc,ppdev,lp
binfmt_misc            17261  1 
nls_iso8859_1          12618  1 
joydev                 17162  0 
eeepc_wmi              12950  0 
asus_wmi               19321  1 eeepc_wmi
sparse_keymap          13659  1 asus_wmi
snd_hda_codec_realtek    63579  1 
snd_hda_codec_hdmi     31457  1 
snd_hda_intel          32516  6 
arc4                   12474  2 
kvm_amd                54395  0 
snd_hda_codec         111548  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_hwdep              13273  1 snd_hda_codec
uvcvideo               71278  0 
kvm                   357807  1 kvm_amd
snd_pcm                80235  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
videobuf2_core         32071  1 uvcvideo
videodev               95842  2 uvcvideo,videobuf2_core
snd_seq_midi           13133  0 
videobuf2_vmalloc      12757  1 uvcvideo
ath9k                 116588  0 
videobuf2_memops       13213  1 videobuf2_vmalloc
snd_rawmidi            25383  1 snd_seq_midi
mac80211              461261  1 ath9k
snd_seq_midi_event     14476  1 snd_seq_midi
snd_seq                51281  2 snd_seq_midi,snd_seq_midi_event
ath9k_common           13784  1 ath9k
psmouse                84878  0 
ath9k_hw              376228  2 ath9k,ath9k_common
snd_timer              24412  2 snd_pcm,snd_seq
fglrx                4325618  80 
ath                    19188  3 ath9k,ath9k_common,ath9k_hw
snd_seq_device         14138  3 snd_seq_midi,snd_rawmidi,snd_seq
k10temp                12959  0 
cfg80211              175574  3 ath9k,mac80211,ath
serio_raw              13032  0 
sp5100_tco             13418  0 
snd                    62146  22 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
mac_hid                13038  0 
i2c_piix4              12984  0 
soundcore              14600  1 snd
snd_page_alloc         14037  2 snd_hda_intel,snd_pcm
vesafb                 13478  1 
hid_generic            12485  0 
usbhid                 41734  0 
hid                    82179  2 hid_generic,usbhid
microcode              18210  0 
video                  18895  0 
atl1c                  36176  0 
wmi                    18591  1 asus_wmi
             total       used       free     shared    buffers     cached
Mem:        749056     629928     119128          0       5296     232832
-/+ buffers/cache:     391800     357256
Swap:      2327284     191536    2135748

/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate:

/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/01laptop-mode hibernate hibernate:

/usr/lib/pm-utils/sleep.d/01laptop-mode hibernate hibernate: success.
Running hook /etc/pm/sleep.d/10_grub-common hibernate hibernate:

/etc/pm/sleep.d/10_grub-common hibernate hibernate: success.
Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate hibernate hibernate:

/etc/pm/sleep.d/10_unattended-upgrades-hibernate hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate:
Having NetworkManager put all interaces to sleep...Failed.

/usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate:
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

/usr/lib/pm-utils/sleep.d/60_wpa_supplicant hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:

/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: not applicable.
Running hook /usr/lib/pm-utils/sleep.d/90clock hibernate hibernate:

/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: not applicable.
Running hook /usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate:

/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate:
stop: Unknown instance: 

/usr/lib/pm-utils/sleep.d/95anacron hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate:

/usr/lib/pm-utils/sleep.d/95hdparm-apm hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/95led hibernate hibernate:

/usr/lib/pm-utils/sleep.d/95led hibernate hibernate: not applicable.
Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:
ATI Catalyst driver detected, not using quirks.

/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:

/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.
Running hook /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate:

/etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate: success.
Wed Mar 27 20:19:42 NZDT 2013: performing hibernate
Wouter_db

Re: Resume from Hibernation elusive..

Post by Wouter_db »

UPDATE & SOLVED. :D

YES, success at last!
Bit of a long(4 months)shot and some bloody luck to find this trick, but alas I'm a very happy penguin.
When once again being confronted with a halted system at boot I randomly punched in the ALT-SysR REISUB command and behold, it resumed after I was halfway punching it in. :shock:
Also, this meddling around has learned my a lot about Linux so all is good.

The culprit that halted my system at boot when resuming from hibernate (uswsusp) was the plymouth splash screen.
No need for fancy kernel boot parameters, just tell uswsusp no quit plymouth before hibernation.
I found this trick on the Ubuntu bug launchpad thx to lars-linbit, I don't fully how it does what it does because I'm an amateur just randomly punching code, but uswsusp.config is backupped, and modified.

Code: Select all

Lars Ellenberg (lars-linbit) wrote on 2012-09-17: 

I found the following workaround to be good enough for me: basically just tell the initrd plymouth to quit before resume.

sudo -i # become root
cd /usr/share/initramfs-tools/scripts/local-premount
patch <<EOF uswsusp
--- uswsusp.orig
+++ uswsusp
@@ -34,4 +34,6 @@
      mknod /dev/snapshot c ${DEV%:*} ${DEV#*:}
 fi

+[ -x /bin/plymouth ] && plymouth quit
+
 /sbin/resume
EOD

(Note, open a new terminal)

sudo update-initramfs -u

Done.

Have fun.
You loose the splash screen, but I don't care. Now Linux Mint can fully finally replace Windows.

I'll mark this thread as Solved. I also changed the topic title to better accommodate users searching for this.
Wouter_db

Re: [SOLVED] Resume Hibernation uswsusp freeze at boot

Post by Wouter_db »

Hello Again,

The problem has resurfaced in Mint XFCE 16 unfortunately... The steps above no longer seem to work, meaning that the editing of the uswsusp config file and telling Plymouth to quit before startup fails.
As in the beginning the system goes into hibernation just fine, and then reloads the image from HD. Then it halts indefinitely, and again Plymouth seems to mess things up (the uswsusp file is edited). Only when I press ALT-Sysreq R, E and I the system proceeds with loading the saved environment like it should, and all is as I left it.

Now, it seems the uswsusp config that tell Plymouth to shut the hell down like a good boy is ignored. Where else can I tell it to quit? I suppose deleting plymouth altogether will cause dependency issues?
Locked

Return to “Xfce”