View previous topic :: View next topic |
Author |
Message |
Menhir n00b
Joined: 23 Feb 2005 Posts: 9
|
Posted: Sat Oct 01, 2016 4:34 pm Post subject: Auto suspend after some time of hard drive inactivity |
|
|
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 |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Sat Oct 01, 2016 9:18 pm Post subject: |
|
|
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 |
|
|
Menhir n00b
Joined: 23 Feb 2005 Posts: 9
|
Posted: Sat Oct 01, 2016 9:32 pm Post subject: |
|
|
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 |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
|
Back to top |
|
|
|