LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-02-2008, 06:56 AM   #1
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
Hibernate (suspend to disk) breaks swap


I've been trying to get hibernation to work on my ThinkPad R50. The machine seems to write the contents of the memory to the swap-partition and then power down exactly as it should, but when I switch the machine back on, it simply boots up again instead of resuming from the hibernation. The swap partition is trashed and I need to do mkswap /dev/[swap-partition] and then swapon -a to get it working again.

The machine has 512 MB of memory and the size of the swap if 1 GB.
 
Old 03-02-2008, 08:11 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
Do you pass 'resume = /dev/[swap]' to kernel in grub/lilo?
 
Old 03-04-2008, 04:14 PM   #3
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Original Poster
Rep: Reputation: 46
Yep, there is:

append="resume2=swap:/dev/[swap] splash=silent quiet sysrq=1"

in lilo.conf
 
Old 07-21-2008, 02:32 AM   #4
cgoetz
LQ Newbie
 
Registered: Oct 2004
Location: Brussels
Posts: 6

Rep: Reputation: 0
Working hibernation on Slackware 12.1

At first, I experienced also problems running s2disk (uwsusp) on Slackware 12.1 but looking further, I discovered that my swap device wasn't valid.

/etc/fstab
/dev/sda2 swap swap defaults 0 0
/dev/sda1 / reiserfs defaults 1 1
/dev/sda3 /mnt/sda3 reiserfs defaults 1 2
/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0

This issue was fixed by running a check on the swap partition:
mkswap -c /dev/sda2

And hibernating to disk now works great !

Slackware is still there and remains worth-while

my s2disk script

#!/bin/bash
msd=$(cat /etc/suspend.conf |grep resume|sed -e "s/resume.*\/dev/\/dev/")
swt=$(swapon -s|grep $msd)
mrc="$?"
if [ "$swt" = "" ]; then {
echo -e "\nyour swap device seems to be incorrectlynot defined - please check /etc/fstab and /etc/suspend.conf !"
echo -e "you may try to fix this issue by running: mkswap -c $msd\n"
exit 0
}
fi
if [ "$mrc" = "0" ]; then {
echo -e "\nusing swap device $swt to suspend to disk ...\n"
echo " Going to suspend mode ... please wait."
echo "8" >/proc/sys/kernel/printk
echo "disk" >/sys/power/state
}
fi


-- cgoetz
 
Old 07-21-2008, 09:25 AM   #5
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Original Poster
Rep: Reputation: 46
Still doesn't work for me. I think the problem is with lilo refusing to understand that the machine has to be resumed. Suspending seems to work fine.

--edit--

Oh god... all this time and the only problem was that there must not be the swap: in append string XD

It works if you put:

append="resume=/dev/[swap] splash=silent quiet sysrq=1"

in lilo.conf and run lilo

Last edited by alienDog; 07-21-2008 at 09:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hibernate/suspend with two swap partitions ordealbyfire83 Linux - Hardware 8 07-30-2007 12:11 PM
Possible Suspend/HIbernate fix angryfirelord Linux - Hardware 0 07-20-2007 06:46 PM
Hibernate/Suspend issues on opensuse10.2 with swap on LVM tea of evil Suse/Novell 3 03-26-2007 11:14 AM
Wireless not working after suspend/hibernate fatbeaver Suse/Novell 9 04-26-2006 02:16 PM
suspend a.k.a hibernate on kernel 2.6, how to use it? demmylls Linux - General 1 03-06-2004 12:06 PM


All times are GMT -5. The time now is 10:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration