LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-10-2011, 12:02 PM   #1
mfan
LQ Newbie
 
Registered: Sep 2010
Location: Germany
Distribution: Ubuntu 11.10, 12.04
Posts: 18

Rep: Reputation: 0
Hibernate problem using 2 swap partitions


Hi folks!



I have a debian 6.0.3 on a 2GB RAM desktop with (initially) only a 1GB swap partition.

Not surprisingly, when I used to run programs that occupied more than 1GB of my RAM, I couldn't hibernate.

Because I had an 8GB partition that I didn't use, I turned it into a second swap partition. (I formatted the partition as swap, I edited the /etc/fstab adding it and then I used swapon IIRC, it was a few months ago.)

But even after that, when I try to hibernate with over than 1GB of RAM used, I get the same error: "PM: not enough free space". Frustrating... I have some free time now to search and resolve this.


Some more info (sda5 -> my original swap, sda8 -> my 2nd swap):

% fdisk -l /dev/sda | grep sda[58]
/dev/sda5 6225 6348 995998+ 82 Linux swap/Solaris
/dev/sda8 8341 9336 8000338+ 82 Linux swap/Solaris

% cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 995988 0 -1
/dev/sda8 partition 8000328 0 -2

% grep swap /etc/fstab
UUID=7d76837c-e342-48f7-a625-6799ccc548b4 none swap sw 0 2
/dev/sda8 none swap sw 0 2

% cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=7d76837c-e342-48f7-a625-6799ccc548b4

% blkid /dev/sda[58]
/dev/sda5: UUID="7d76837c-e342-48f7-a625-6799ccc548b4" TYPE="swap"
/dev/sda8: UUID="e3227967-2f70-4540-92c9-3e0e324fdd04" TYPE="swap"


First, I tried to stop using my initial swap partition. It's only 1GB anyway. So, I commented it out in the /etc/fstab. Then, I updated the UUID of the new partition in resume file. After a reboot, I tried to hibernate but the computer didn't do it. I got no error message as far as I understand the output (or it was too quick, or just I didn't notice). It tried to hibernate entering console mode, it did not reach the point when writing to swap file (one can see the progress in a % counter) and it came back.

No clue why this does not work.

Do I need to add one more line in the resume file with the uuid of the 2nd partition perhaps? I am not sure if this works, if it supports multiple lines, that is.

I am looking for this in the net, but I can't find any similar problem with 2 swap partitions.



Any ideas? Thanks in advance!
 
Old 11-10-2011, 03:01 PM   #2
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
What is the output of cat /proc/swaps now?

In your grub.cfg (assuming you are using GRUB) do you have any additional parameters in the boot entries? ('linux' lines within 'menuentry' blocks)
Try adding resume=/dev/sda8 to the end - you can test this out by hitting 'e' at the grub menu.
 
Old 11-11-2011, 12:38 AM   #3
mfan
LQ Newbie
 
Registered: Sep 2010
Location: Germany
Distribution: Ubuntu 11.10, 12.04
Posts: 18

Original Poster
Rep: Reputation: 0
SOLVED: Adding the swap partition as a resume=... parameter in /etc/default/grub

> In your grub.cfg [...] Try adding resume=/dev/sda8 to the end

Yeap! That was the missing setting. It worked.


For some strange reason -stupid of me maybe- I thought myself yesterday: "There is no resume parameter there, why should I _add_ one?" But seems if there is no parameter, the kernel may just grab the first swap partition in the disk.



Thanks a lot!!
 
  


Reply

Tags
hibernate, initramfs, problem, resume, swap



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What size swap partition for hibernate? catkin Linux - Desktop 6 10-05-2009 01:18 PM
F7: Hibernate using new swap partition Mleahy Linux - Software 2 07-26-2008 02:16 PM
Expanded Swap for Hibernate, now what? sixsidepentagon Linux - Newbie 12 10-06-2007 12:58 PM
Some questions about swap and hibernate Ryzol Linux - Desktop 1 08-29-2007 07:34 AM
Hibernate/suspend with two swap partitions ordealbyfire83 Linux - Hardware 8 07-30-2007 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration