Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how do i achieve suspend to disk/ram on my amd64 desktop?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Fri Apr 22, 2011 9:30 pm    Post subject: how do i achieve suspend to disk/ram on my amd64 desktop? Reply with quote

do i have to follow this? http://www.gentoo.org/doc/en/power-management-guide.xml

seems overkill for desktop.
i just need a command to suspend to disk.

thx
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54239
Location: 56N 3W

PostPosted: Fri Apr 22, 2011 10:16 pm    Post subject: Reply with quote

h2sammo,

Try the tuxonice kernel

Suspend to disk and suspend to RAM are really intended for laptops but there is no reason why you sould not try it on a desktop too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sat Apr 23, 2011 4:10 am    Post subject: Reply with quote

You can also use s2disk from sys-power/suspend in a stock kernel if you enable the hibernation options.
Back to top
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Sat Apr 23, 2011 12:48 pm    Post subject: Reply with quote

if i use stock kernel and sys-power/suspend do i have to set a hibernation partition in the kernel (i saw an option for it).

what should i put there? /dev/sdax or the swap partition? does it matter?

do i have to edit grub even if i use sys-power/suspend and stock kernel or suspend will make those changes for me?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sat Apr 23, 2011 5:35 pm    Post subject: Reply with quote

h2sammo wrote:
if i use stock kernel and sys-power/suspend do i have to set a hibernation partition in the kernel (i saw an option for it).
You do not need to set one, but it is easier to set it in the kernel configuration than to configure it at runtime.
h2sammo wrote:
what should i put there? /dev/sdax or the swap partition?
Specify the swap partition.
h2sammo wrote:
do i have to edit grub even if i use sys-power/suspend and stock kernel or suspend will make those changes for me?
Grub does not need to be modified at all to work with s2disk based suspend, but you do need to have the resume kernel know to resume, either via an initramfs or a command line entry. I use an initramfs since I hibernate to encrypted swap.
Back to top
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Sat Apr 23, 2011 7:38 pm    Post subject: Reply with quote

i went ahead with the gentoo preferred tuxonice. i followed instructions but on reboot, tuxonice loads with an error and trying the hibernate command fails with an error as well, any ideas?
Code:

localhost bobby # dmesg | grep TuxOnIce
[    1.204514] TuxOnIce 3.2-rc2 (http://tuxonice.net)
[    1.209782] TuxOnIce: No matching enabled allocator found. Resuming disabled.
localhost bobby # hibernate
/usr/share/hibernate/scriptlets.d/tuxonice: line 525: echo: write error: Device or resource busy


one thing different from the setup was that i cold not find the following in my kernel so i did not enable it:
Quote:
Processor type and features --->
[*] Support for suspend on SMP and hot-pluggable CPUs


also, hibernate command is not recognized from my user, only from root.

thx
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54239
Location: 56N 3W

PostPosted: Thu Apr 28, 2011 4:50 pm    Post subject: Reply with quote

h2sammo,

Please post your kernel .config file and grub.conf

If you have an initrd - how was it made?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
aronparsons
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 117
Location: Virginia

PostPosted: Thu Apr 28, 2011 5:00 pm    Post subject: Reply with quote

emerge pm-utils
/usr/sbin/pm-suspend for suspend-to-ram
/usr/sbin/pm-hibernate for hibernate

Make sure you have the support enabled in your kernel for whichever suspend method you want to use. Suspend works quite well in current kernels; TuxOnIce shouldn't be necessary these days.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Thu Apr 28, 2011 6:03 pm    Post subject: Reply with quote

w/ a str8 vanilla kernel
Code:
sync; echo mem > /sys/power/state
suspends and
Code:
sync; echo disk > /sys/power/state
hibernates.
Back to top
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Fri Apr 29, 2011 1:26 am    Post subject: Reply with quote

NeddySeagoon wrote:
h2sammo,

Please post your kernel .config file and grub.conf

If you have an initrd - how was it made?


.config: http://ompldr.org/vOGd2eA
Code:

default 0
timeout 2
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.36-tuxonice-r3
root (hd0,0)
kernel /boot/2.6.36-tuxonice-r3 video=uvesafb:ywrap,mtrr:3,1280x1024-32@70 root=/dev/sda3 resume=s$

title Gentoo Linux 2.6.36-gentoo-r5
root (hd0,0)
kernel /boot/2.6.36-gentoo-r5 video=uvesafb:ywrap,mtrr:3,1280x1024-32@70 root=/dev/sda3

# vim:ft=conf:

title Windows XP
rootnoverify (hd0,3)
makeactive
chainloader +1
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54239
Location: 56N 3W

PostPosted: Fri Apr 29, 2011 5:15 pm    Post subject: Reply with quote

h2sammo,

This truncated part of grub.conf
Code:
resume=s$
should say resume=swap:/dev/<your_swap>

You need to use the command
Code:
nano -w /boot/grub/grub.conf
to avoid lines being truncated.

Your kernel looks ok.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Sat Apr 30, 2011 2:01 pm    Post subject: Reply with quote

thank you i have fixed that:
Code:
title Gentoo Linux 2.6.36-tuxonice-r3
root (hd0,0)
kernel /boot/2.6.36-tuxonice-r3 video=uvesafb:ywrap,mtrr:3,1280x1024-32@70 root=/dev/sda3 resume=swap:/dev/sda2

based on
Code:

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63       80324       40131   83  Linux
/dev/sda2           80325    16868249     8393962+  82  Linux swap / Solaris
/dev/sda3        16868250   217279124   100205437+  83  Linux
/dev/sda4   *   217279125   390716864    86718870    7  HPFS/NTFS

but it still complains:
Code:
localhost bobby # hibernate
/usr/share/hibernate/scriptlets.d/tuxonice: line 525: echo: write error: Device or resource busy


any ideas?
Back to top
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Sat Jun 04, 2011 5:22 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
qdii
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2009
Posts: 106
Location: Madrid

PostPosted: Mon Dec 05, 2011 9:00 am    Post subject: Reply with quote

Hey did you find a solution for that? I’m having the same problem here.
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 283
Location: Canada

PostPosted: Mon Sep 29, 2014 2:02 am    Post subject: Reply with quote

toralf wrote:
w/ a str8 vanilla kernel
Code:
sync; echo mem > /sys/power/state
suspends and
Code:
sync; echo disk > /sys/power/state
hibernates.

Can I do this without being root?
I can't seem to execute this command even with sudo.
Only root(su) seemed to work
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Mon Sep 29, 2014 2:59 am    Post subject: Reply with quote

Please do not resurrect retired threads for off-topic questions. You must be privileged to suspend or hibernate the machine. You did not explain how you failed, but you most likely made the standard mistake of most sudo users. Redirections are processed by the unprivileged shell, before sudo runs.
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 283
Location: Canada

PostPosted: Mon Sep 29, 2014 11:22 am    Post subject: Reply with quote

Hu wrote:
Please do not resurrect retired threads for off-topic questions. You must be privileged to suspend or hibernate the machine. You did not explain how you failed, but you most likely made the standard mistake of most sudo users. Redirections are processed by the unprivileged shell, before sudo runs.

What does that mean?
and is it bad to resurrect retired threads?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Mon Sep 29, 2014 3:48 pm    Post subject: Reply with quote

ShanaXXII, though it was great that you searched for a similar problem, but your problem deserves a new posting "create a new thread" because it is of a different aspect than of the original thread creator, and can be confusing to people subscribed to the thread.

Anyway, to clarify the redirection problem Hu hinted at, these two methods should work for you to write while in a regular user shell as /sys/power/state requires root to be written to:

sync; sudo sh -c 'echo mem > /sys/power/state'

or

sync; echo mem | sudo tee /sys/power/state
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
ShanaXXII
Apprentice
Apprentice


Joined: 29 Jun 2014
Posts: 283
Location: Canada

PostPosted: Mon Sep 29, 2014 4:07 pm    Post subject: Reply with quote

eccerr0r wrote:
ShanaXXII, though it was great that you searched for a similar problem, but your problem deserves a new posting "create a new thread" because it is of a different aspect than of the original thread creator, and can be confusing to people subscribed to the thread.

Anyway, to clarify the redirection problem Hu hinted at, these two methods should work for you to write while in a regular user shell as /sys/power/state requires root to be written to:

sync; sudo sh -c 'echo mem > /sys/power/state'

or

sync; echo mem | sudo tee /sys/power/state

Oh, okay. Thank you very much
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum