Fan Control for D-Link DNS-320 with USB support

D-Link DNS-320
Based on the great script provided by John Mnemonic (here) I have adapted to use the USB Drive, to prevent the constant use of the hard disk so the hibernation can kick in, saving some energy and preventing the wear of the drives.

The files are configured to monitor only one drive and with standard temperature configuration from the original script, all this parameters are configurable within the first lines of the file fancontrol.sh from BIN folder. Tplot.sh files are only required only if you want graphics from temperature levels.

The temperature is obtained in Celsius from parameter 194 of SMART values. The script is tested and working with fun_plug 0.7.

Installation procedure:

  1. Unzip the files in the appropiate folders and give execution permissions to the unzipped files, with chmod +x <<filename>>
  2. Create the required folders in the USB Drive: log, tmp/graphs
  3. Reboot the DNS-320

If everything goes OK you will see log files created in folder LOG from USB Drive.

Comments are closed.

  1. chrisz says:

    Don’t work:

    ffp/bin/fancontrol.sh: line 73: cannot create /mnt/USB/HD_c1/log/fan.log: nonexistent directory
    ffp/bin/fancontrol.sh: line 74: hdparm: not found

  2. Nexus says:

    Hello. You must create the folder “log” on the USB mounted drive, line 74 can be omited, it uses smartctl to obtain temperature data. Try again and if you can not make it work let me know to find the solution.

    Remember, it is intended to run with fun_plug v0.7 and with a USB drive.

  3. Mathew says:

    This is great! I’m now running an almost silent NAS 🙂 Thanks Nexus!

  4. Mathew says:

    @Chrisz: If hdparm is not found, you have to install it separately using ‘funpkg -i hdparm-9.39-arm-1.txz’.

    Download the package first on your NAS. Downloadlink: https://docs.google.com/open?id=0B2ZXjnx9Zi-TVGVndy00dnFPMDA

  5. Nexus says:

    Great to know it is working OK, it is a very good script to maintain the unit very silent.

  6. Amith says:

    Thanks for your work. But my HDs are not going to sleep now – is this because of the smartctl running every 30s? does this keep the HDs from going to hibernation? The scripts does check if they are in hibernation *before* running smartctl but if the hibernation time is more than 30s and smartctl wakes it up, I guess the HDs never go into hibernation?

  7. Amith Ganesan says:

    Hi. With the smartclt always running (hdparm will always return false because hibernation cannot happen <30s), will the HDs every go to sleep?

  8. Martin says:

    Successfully installed script on my DNS-320. Yet it seems it doesn’t work O.K. Fan is not started even when HDD temp reached 50C.

    Script was installed O.K. and is started.

    From ffp.log
    * /ffp/start/fancontrol.sh …
    * OK

    I also installed “hdparm-9.42-arm-0”

    Log (from USB) shows lines:
    2013-06-19 15:53:34: “” 50 -1 -1 20
    2013-06-19 15:54:06: “” 50 -1 -1 20
    2013-06-19 15:54:38: “” 50 -1 -1 20

    Are these readings O.K. or am I missing something? Thank for help.

    I tried this command to verify it’s running:
    [email protected]:/mnt/USB/HD_c/ffp/start# ./fancontrol.sh status
    Fancontrol daemon is running

    I don’t want to forget my change so it’s complete:
    I changed string “HD_c1/” “to HD_c/” in scripts so it goes with my mapping. I’m not into unix world … so I don’t know how to proceed.

    Once again thanks for help.

  9. mpm says:

    Minor bug.

    On lines 55 and 63, “grep 194” should be replaced by “grep ^194” to avoid picking up other lines erroneously.

    Otherwise, works great!

  10. Martin says:

    Successfully installed script on my DNS-320 + fonz fun plug 0.7. Yet it seems it doesn’t work O.K. Fan is not started even when HDD temp reached 50C.

    Only thing I modified is string “HD_c1/” “to HD_c/” in scripts so it goes with my DNS-320 mapping.

    Script was installed O.K. and is started.

    From ffp.log
    * /ffp/start/fancontrol.sh …
    * OK

    I also installed “hdparm-9.42-arm-0″

    Log (from USB) shows lines:
    2013-06-19 15:53:34: “” 50 -1 -1 20
    2013-06-19 15:54:06: “” 50 -1 -1 20
    2013-06-19 15:54:38: “” 50 -1 -1 20

    Are these readings O.K. or am I missing something? Thank for help.

    I tried this command to verify it’s running:
    [email protected]:/mnt/USB/HD_c/ffp/start# ./fancontrol.sh status
    Fancontrol daemon is running

    I’m not into unix world … so I don’t know how to proceed.

    Once again thanks for help.

  11. Martin says:

    Hi,

    I successfully installed script on my DNS-320 + fonz fun plug 0.7. Yet it seems it doesn’t work O.K. Fan is not started even when HDD temp reached 50C.

    Only thing I modified is string “HD_c1/” “to HD_c/” in scripts so it goes with my DNS-320 mapping.

    Script was installed O.K. and is started.

    From ffp.log
    * /ffp/start/fancontrol.sh …
    * OK

    I also installed “hdparm-9.42-arm-0″

    Here’s part of log (from USB):
    2013-06-19 15:53:34: “” 50 -1 -1 20
    2013-06-19 15:54:06: “” 50 -1 -1 20
    2013-06-19 15:54:38: “” 50 -1 -1 20

    Are these readings O.K. or am I missing something? Thank for help.

    I tried this command to verify it’s running:
    [email protected]:/mnt/USB/HD_c/ffp/start# ./fancontrol.sh status
    Fancontrol daemon is running

    I’m not into unix world … so I don’t know how to proceed.

  12. Florian says:

    Hi,

    I’ve been using this script on a USB drive now for a couple of months and it worked perfectly.

    Yesterday I had to restart my DNS-320 and unfortunately the fan now runs permanently. The system temperature is 44°C and the HD temperature is 29°C.

    When I check the log under /mnt/USB/HD_c1/log/fan.log I see that the daemon is running.

    Any ideas?

    Thanks a lot for your help!

    Cheers,
    Florian

  13. Florian says:

    Hi,

    Last night I unmounted and mounted the USB stick a couple of times. I also stopped and started fancontrol.sh several times and now it seems to work again…

    Cheers,
    Florian

  14. Darian says:

    I have successfully installed both packages. But I can autostart fancontrol.sh even I have placed in under ‘start’ folder given the script executable right.

    Can someone shred a light on me? Thnaks.