DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2012-08-26 16:11:51

boredazfcuk
New member
Registered: 2012-08-26
Posts: 3

Fan control on Debian Squeeze

Hi,

First off a big thanks to Johny and Gyngy for the fun_plug fancontrol script, without their work I'd have RMA'd my DNS-320 a couple of weeks ago.

I have a Seagate drive in my unit which reports the temperature as the difference from 100, so a temp reading of 65 meant that the drive was actually 35 degrees C. This meant that the fan was permanently on high. Installing fonz fun_plug, and small modification to your script meant that my fan now spins up and down when it should.

However, I wanted to run Debian Squeeze (for SAB/SickBeard/CouchPotato/Headphones) and the script wouldn't work for a number of reasons so I fixed it up and thought I'd post it here in case anyone else was struggling with the same thing. I've had the box for 3 weeks now and this is my first experience of Linux and I come from a Windows background so my solution is far from elegant but it works for me, and if it works for one other person, it'll have been worthwhile...

The most obvious problem was that a lot of files were being called that didn't exist in the squeeze installation. So I created /opt/fancontrol/ (I have no idea if this is the right place to put stuff) and copied the following files (sorry, I don't remember their locations) to it:

fanspeed
ffp.subr
FT_testing
smart_ch_hd_result
smart_test
smartctl

I also had to copy a file called libshare.so to /lib/

I placed the modified fancontrol.sh in Squeeze's /bin folder and a fancontrol program to start the script in /etc/init.d

I updated the boot order with: update-rc.d fancontrol defaults

I also put: service fancontrol start in the /boot/linuxrc file (I have no idea if this or the technique above loads the script).

I placed the line: rm /mnt/USB/HD_c1/squeeze/var/run/fancontrol.pid (I'm running of USB) in the fun_plug script because when the device is restarted it doesn't cleanly shutdown the fancontrol.sh script, leaving the .pid file behind and prevents it from loading after a reboot.

The two script files can be downloaded from here:
https://skydrive.live.com/redir?resid=7 … 0FFF65!179

Far from elegant, but it works. Hope this can help someone else...

If anyone could suggest how I can refine it that would be awesome too.

boredazfcuk

Offline

 

#2 2013-02-07 04:33:52

gustgon
New member
Registered: 2013-02-07
Posts: 1

Re: Fan control on Debian Squeeze

Hi, I need a help.

After that I installed the "Debian Squeeze + SABnzb" on my DNS320, the fan is always on. I checked the specifications of my two HDs and both works on 60 degrees celcius range.

First question:
I read that the operating system of DNS320 works on 0 to 40 degress celcius range. Is it correct ? If yes, I have trouble, because now my NAS has 46 degress. Do you have any suggestion ?

Second question:
If I can install your script, please, put the files of folder /opt/fancontrol/ on something cloud-drive, like your skydrive. I tried to find them, but appears that symbolic link was broked. On my NAS the files appear on:

/mnt/HD/HD_a2/ffp/etc/ffp.subr   (this exist)
/mnt/root/usr/sbin/FT_testing
/mnt/root/usr/sbin/fanspeed
/mnt/root/usr/sbin/smart_ch_hd_result
/mnt/root/usr/sbin/smart_test
/mnt/root/usr/bin/smartctl
/mnt/root/lib/libshare.so

The others are links to the folder   /mnt/root/usr/local/modules. But it is empty.

I have tried many ways, without success.

Can you help me ?

Thank you.

Offline

 

#3 2013-07-29 18:22:20

Gizoe
New member
Registered: 2012-04-07
Posts: 3

Re: Fan control on Debian Squeeze

@boredazfcuk

Thank you very much. The only problem I had to consider moving from fun_plug to Debian was the lack of support on the fancontrol script, which worked perfectly on FFP. With your help I changed it to my system situation. And it worked!

I now have a quiet Debian installation on my DNS-320.

Couples notes:

- I had to change fancontrol.sh to 1 disk. I have only one disk. If you have 1 and you let is set on 2, you will get error messages when executing the script.
- I changed back your modification for the weird temp read-out. I didn't had that problem with my Seagate disk.

The only issue I have is that the temps of the HDD is not showing correctly. 5 celcius most of the time.

Thanks again!

Last edited by Gizoe (2013-07-30 03:30:39)

Offline

 

#4 2013-08-26 12:24:28

baltzatu
Member
From: Bucharest, Romania
Registered: 2013-08-26
Posts: 38

Re: Fan control on Debian Squeeze

Hello.

@boredazfcuk: Thank you for the tool. It works great, after a little tuning.

It looks like the HDDs need special treatment :D I had to alter fancontrol.sh to get accurate temperature readings. Here's what I changed (no need for D1_READING anymore):

Code:

D1_TEMP=`/opt/fancontrol/smartctl -d marvell --all /dev/sda |grep 194 |grep Temperature |head -c 89 |tail -c 2`
D2_TEMP=`/opt/fancontrol/smartctl -d marvell --all /dev/sdb |grep 194 |grep Temperature |head -c 89 |tail -c 2`

You might want to check /opt/fancontrol/smartctl -d marvell --all /dev/sdx |grep 194 |grep Temperature |head -c 89 |tail -c 2 (where x is a or b) output on your NAS, compare it with your HDD temperatures as stated in the web admin interface and (if necessary) alter head commands' length accordingly. For me, it was like this:

/opt/fancontrol/smartctl -d marvell --all /dev/sda |grep 194 |grep Temperature => 194 Temperature_Celsius     0x0022   107   098   000    Old_age   Always       -       40 (WD Caviar Green (WD7500AADS), 750 GB)
/opt/fancontrol/smartctl -d marvell --all /dev/sdb |grep 194 |grep Temperature => 194 Temperature_Celsius     0x0022   039   046   000    Old_age   Always       -       39 (0 21 0 0) (Seagate Barracuda Green 5900 RPM (ST2000DL003), 2 TB)

so I couldn't rely on |head -c 40 |tail -c 3 (it returns the green values) :)

[Edit]
I've asked a friend to help and he recommended using awk to get accurate readings, so I did. Unzip this on your Volume_1 share and unpack the .tar (it contains everything you need):

Code:

service fancontrol stop
tar -xvf fancontrol.tar
service fancontrol start

I also noticed that fancontrol doesn't start properly when added in /boot/linuxrc as service fancontrol start. In order to start properly, use service fancontrol stop && service fancontrol start instead.

Last edited by baltzatu (2013-09-02 15:27:41)


Moo... or something...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB