V
V
Vadim Chernov2015-08-12 08:34:31
linux
Vadim Chernov, 2015-08-12 08:34:31

How to hibernate linux server when disks stop?

Preamble
I'm going to assemble a server from old iron at home (samba, apple time machine, minidlna, etc.). I want to put it without a case on top of the cabinet so that it does not interfere and cools. Making wakeonlan from a phone or computer is not a problem, and I would like it to turn itself off when not needed (at first it will be with noisy fans, but electricity is not free with us).
I noticed such an interesting feature in Windows: when there is a second physical disk other than the system one, it turns it off if it does not use it (you can hear it). Maybe so Linux I don't know.
I have an opinion that if the file server does not access the disk, it means that it is idle and can "sleep".
So, then the essence of the issue is the example of watching a movie on a TV, which the TV pulls from this server from minidlna.
essence

  1. We watch a movie, the TV pumps it out of the server, the hard drive on it is spinning - it works
  2. The movie is over, we don’t touch the server anymore, the disks are idle
  3. After N minutes of idle disks, the server goes into hibernation
  4. By magic packet from the phone / computer / cat, the server wakes up, go to step 1.

How to implement hibernation when disks are idle on a server running, say, Ubuntu Server 14.04 or 15.04?
If you have experience with another OS on the Linux kernel, write too! The distribution is not important :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ostin, 2015-08-12
@nitso

Why turn it off entirely? It is usually enough to "extinguish" the discs to reduce noise. Since it will lie on a cabinet, it is quite possible to pick up silent cooling (but here the issue of dust is very acute, so some kind of case is needed).
About turning off disks: google [ 1 ] [ 2 ] [ 3 ]
About hibernation: WOL is not very convenient because you need to press some button with your hands. There is also the option of waking up during network activity (with the support of the motherboard / network card), but the big minus is false positives with all the leaks (for example, spinning up disks in the middle of the night).
In general, for the same money you can take a more powerful router, connect a hard drive to it and not suffer. If you have a budget - take a NAS, for example, Synology, which "drags" a ton of different software.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question