Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Auto suspend after some time of hard drive inactivity
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
Menhir
n00b
n00b


Joined: 23 Feb 2005
Posts: 9

PostPosted: Sat Oct 01, 2016 4:34 pm    Post subject: Auto suspend after some time of hard drive inactivity Reply with quote

Hi,

I am using Gentoo on my builded NAS. It means I have no GUI, just simple gentoo.
I want to fully hibernate after some time of inactivity. Is there any posibility to do it?

I instaled laptop-mode, and have fucntioning pm-utils with possibility to hibernate to disk a then resume manualy.
I also setup wake on lan. I just want my NAS going to deep sleep if we not use it for a while and then wake it on lan.

Can you help me?

Thanks,
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Oct 01, 2016 9:18 pm    Post subject: Reply with quote

Hello,

first the Linux kernel must know where to copy the memory contain on the hard disk and where to resume. It's in a swap partition. The swap partition must be enough big to contain all the memory size.Than the kernel parameter resume=/dev/sda1, or anywhere else the swap partition is, must be pass at the boot time before to hibernate and at the resume time. So the kernel know where to hibernate and resume. It can be set in the kernel image too.

When I hibernate, I do it through a command line
Code:
echo shutdown > /sys/power/disk && echo disk > /sys/power/state

What you can do is to create a script who will execute this command after a fixed idle time and pass it to Cron or At or, make it work in background from /etc/local.d with Openrc or from /etc/rc.local with Systemd.

With both Openrc and Systemd you can create a boot script and add it to the boot process. There are several ways to do this.
_________________
Paul
Back to top
View user's profile Send private message
Menhir
n00b
n00b


Joined: 23 Feb 2005
Posts: 9

PostPosted: Sat Oct 01, 2016 9:32 pm    Post subject: Reply with quote

Hello,

I managed to setup kernel, grub2 with kernel resume parametrs, etc. It's working and resuming like a charm.
What I do not have is enough experience to make script you mentioned. Any help?

Thanks a lot
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Oct 01, 2016 11:00 pm    Post subject: Reply with quote

I cannot help you for the details unless I want to do it myself. I just come to make a search
https://www.google.ca/?hl=fr&gws_rd=ssl#hl=fr&q=linux+hibernate+after+idle+time
It can give you ideas.
_________________
Paul
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