Reduce Fan Noise
Contents [hide] |
1. Fan Noise
As mentioned in the section on Hardware/Fan, the fan produces a considerable amount of noise. Reasons can be found in the QNAP's case fan, as well as the software controller.
2. Fan Hardware
The case fan used in the QNAP NAS is fairly loud. This is partly due to the fans quality and is further emphasized by the way it is mounted (see Hardware/Fan for details on Sound Resonance).
|
See the Step-by-Step Guide below for more details...
3. Fan Software 
With "Automatic Fan" enabled in the [[Software/WebInterface | Software/WebInterface], the fan will never completely turn off. Given the fact that most NAS's are operated much of their time in idle mode (harddrives spun down), temperatures do not exceed 32°C. Therefore there is no need for continuous cooling.
To reduce fan noise, we need to:
- read the temperature of all harddrives with "/sbin/get_hd_temp 1" (see Hardware/Harddrive)
- change the fan speed according to a pre-defined threshold using "/sbin/pic_raw 48" (see Hardware/Fan)
Note:
- mainboard or CPU temperature can be neglected: neither the PIC, nor Processor have a temperature sensor
- therefore "cat /proc/cpuinfo |grep temperature" does not yield any result
|
You can read more on the optimal working conditions for a long lifetime of harddrives , in a recent study conducted by Google. The case study also includes a section on harddrive temperature: Google Study: "Failure Trends in a Large Disk Drive Population"
3.1 Smart Fan Script
Here's a shell script that executes on the above:
#!/bin/sh
#########################################################################
# Script to regulate the fan_speed of the QNAP according to HDD temp #
# Use this script at your own risk!!! #
# Check QNAP-Wiki for details (http://www.QNAP-Wiki.homeip.net) #
#########################################################################
# ToDo List: #
# ---------- #
# General: #
# => Benchmark performance of script and improve #
# => Hard-code variables (performance?) #
# (>) Log temp of all HDD's #
# On Start-up: #
# => Copy Script from HDD into RAM-Risk #
# => Load hd_log file from HDD into RAM-Disk #
# => Create hd_fanspeed_log, if it doesn't exist #
# On Shut-Down: #
# => Save hd_log file from RAM-Disk to HDD #
#########################################################################
# initialize script
hd_log='/tmp/hd_temp.log' # logfile of HD_temp and fan_speed
fan_status='/tmp/fan.status' # last change in fan_speed
delay=300 # delay in seconds after which the fan may decrease speed
m=0
# check all harddrives [1-4] and get max_temp ($m)
for i in 1 2 3 4; do
t=$(/sbin/get_hd_temp $i)
t_all=$( echo $t_all $t)
if [ $t != "none" ]; then
if [ $t -gt $m ]; then
m=$t
fi
fi
done
# get new fan_speed ($s) according to max_temp ($m)
if [ $m = 0 ]; then # fan temp unknown
s=5 # fan=fullspeed
# /sbin/pic_raw 81 # give warning signal (long buzzer)
elif [ $m -lt 32 ]; then # <32° fan=off
s=0
elif [ $m -lt 34 ]; then # <34° fan=off
s=0
elif [ $m -lt 36 ]; then # <36° fan=speed2
s=2
elif [ $m -lt 38 ]; then # <38° fan=speed3
s=3
elif [ $m -lt 40 ]; then # <40° fan=speed4
s=4
else # =>40° fan=fullspeed
s=5
fi
# get fan status and change speed if allowed by delay
# variables: new_speed ($s) / old_speed (${f[2]}) / old_date (${f[0]}) / delay ($delay)
if [ ! -f $fan_status ]; then # if fan_status file doesn't exist create one
echo $(/bin/date '+%s') $m $s > $fan_status
/sbin/pic_raw `expr $s + 48`
else # fan_status file exists
f=( `cat $fan_status`) # read fan_status (old_speed) file into array
if [ $s -gt ${f[2]} ]; then # new_speed is greater than old_speed
/sbin/pic_raw `expr $s + 48` # change to new_speed and update fan_status
echo $(/bin/date '+%s') $m $s > $fan_status
elif [ $s -lt ${f[2]} ]; then # new_speed is smaller than old_speed
d=$(date '+%s') # check if delay is accepted
if [ `expr $d - ${f[0]}` -gt $delay ]; then
/sbin/pic_raw `expr $s + 48` # change to new_speed and update fan_status
echo $(/bin/date '+%s') $m $s > $fan_status
#else
#/sbin/pic_raw `expr $s + 48` # (settings should not be reconfirmed through fan_status)
# (code injection possible, through malicious modification of fan_status file)
fi
else # fan_speed is unchanged
/sbin/pic_raw `expr $s + 48` # confirm fan_speed and update fan_status
echo $(/bin/date '+%s') $m $s > $fan_status
fi
fi
# write temp and fan_speed to logfile
# echo $(/bin/date '+%Y-%m-%d %T') 'hd_temp='$m'C' 'fan_speed='$s >> $hd_log
echo $(/bin/date '+%s') $t_all $s >> $hd_log
echo $(/bin/date '+%Y-%m-%d %T') 'hd_temp='$m'C' 'fan_speed='$s
exit 0
|
Optimization of script settings is still ongoing as we collect "hd_temp.log" data.
Download the Shell Script smart_fan.zip.
3.2 Schedule Smart Fan Script
We need to call on the QNAP "Smart Fan Script" continuously to control the fan effectively (and avoid damage). Obviously, calling the script once only checks the temperature and controls the fan once.
We can use OS/CronTab to schedule the "Smart Fan Script" as a recurring job.
4. Step-by-Step Guide to Reducing Fan Noise
4.1 QNAP Smart Fan Script 
a) Installing the QNAP Smart Fan Script
- logon to your QNAP using PuTTY
- enter the following command:
wget -qP /tmp/ http://qnap-wiki.homeip.net/uploads/How_To/Reduce_Fan_Noise/make_smart_fan.sh && chmod 755 /tmp/make_smart_fan.sh && /tmp/make_smart_fan.sh
- restart your QNAP
|
b) Uninstalling the QNAP Smart Fan Script
- logon to your QNAP using PuTTY
- enter the following command:
wget -qP /tmp/ http://qnap-wiki.homeip.net/uploads/How_To/Reduce_Fan_Noise/uninstall_smart_fan.sh && chmod 755 /tmp/uninstall_smart_fan.sh && /tmp/uninstall_smart_fan.sh
- restart your QNAP
4.2 Exchanging the Fan 
...
Warning: You will loose the warranty on your QNAP device, if you exchange the fan!
This will "probably" not affect the warranty of your QNAP device!
Shell script