Hey guys,
This is my first post here (hopefully useful). I'm gonna describe a 'simple' procedure to remove the integrated fan on the Edimax NS-2502/MKZ-NAS02SG and replace it with a upgraded one (more silent, more powerful and more efficient). For this we need to create a script that disables the integrated fan protection (that some may argue that shouldn't be disabled in the first place).
The procedure needs the latest firmware installed, the latest bit-torrent client (comes with the firmware) and the deployment of a custom script I crated to allow the NAS to function without the integrated fan. This script is necessary because the fan is monitored by the firmware (google '3 wired fans') and if it's RPM drops below 4000 in one minute after startup a alarm will trigger every 10 seconds indefinitely, if you remove the fan the signal will read 0 RPM, and the alarm will be triggered also.
A process was created by the developers ('fan_monitor') to monitor this signal at all time. 'fan_monitor' is started at boot time, and when if this process is closed the problem is gone. I could always remove the alarm buzzer from the board, or create a custom mini board to simulate the RPM signal sent by the fan to the NAS
http://hardforum.com/showthread.php?t=1606397 but I guess I'm just lazy. So I removed the fan (physically) and went on from there.
The main reason I did this is that the integrated fan is REALLY noisy and inefficient (all the HDDs and the NAS board are hot ALL the time). This could translate into a failure in a 1-2 year time. So I came up with a procedure to allow you to remove it and attach a more efficient 2 fan cooler on the top of the NAS (considering the convection currents
http://en.wikipedia.org/wiki/Convection , that's the perfect place for a cooler).
!Some Linux knowledge is required to make sure you don't mess up the scripts and/or commands!
STEPS :
-A NAS with the latest firmware from Planex installed (Edimax NS-2502 or Planex MKZ-NAS02SG). I'm not gonna describe the procedure here, you can google it. I used 1.4.2 from the Planex Japanese site - it seems to be the only updated one?! [
http://www.planex.co.jp/support/download…k-nas02sg.shtml].
-Install the FIRMWARE.
-Install and activate the BitTorrent module (remember what drive you used in the HTTP-UI, we will use it later).
-Buy a USB powered mini laptop cooler for about 3-4$ (really cheap and good for what we need) [search here
http://www.ebay.co.uk/sch/i.html?_trksid…cat=0&_from=R40].
-I used a fan similar to this one [
http://www.ebay.co.uk/itm/USB-Super-Mini…=item2a2187cffd].
-Power off the NAS first (keep release button pressed for more than 5-6 seconds/power off.
-Remove the HDDs.
-Open the NAS case - this is harder than it looks, use a credit card and make sure not to break the plastic clamps that keep it close.
-Remove the integrated FAN by removing the three wired plug from the board and DON'T COVER the 'barred' hole that is left on the case where the fan was located, because this will be a circulation area.
-Carve the plastic from the top case in the shape of the new cooler - make sure to leave a small portion on both sides where you can use glue or screws! (you can use a circular drill bit - 60mm diameter - [
https://www.google.com/search?safe=off&h…0.0.qV--sI4Wz9E ]).
-Close the case & reattach the HDDs.
-Attach the new fan to the top using special glue or screws and connect the USB cable at the back of the NAS to the integraded USB2 port. REMEMBER, The fan(s) must ventilate the air OUT of the NAS not the other way around, so flip the cooler accordingly.
-Next we'll discuss the software part that manages the alerts and bypasses it's protection.
-Power ON the NAS (the fan alert should start in 1-2 minutes from power-on, just ignore it while we configure the NAS).
-Connect to the NAS using Putty [
http://www.chiark.greenend.org.uk/~sgtat…y/download.html].
-Connect using the NAS IP, port 1192, select TELNET connection type. Use the user 'root' and use the password you currently have when you connect with 'admin' in the HTTP-UI.
-Should connect with a delay of 1-2 seconds.
-Manually disable the alert for this session (while we configure the NAS), just type the following commands :
|
PHP kaynak kodu
|
1
|
ps -f | grep 'fan_monitor' | grep -v 'grep' | awk '{print $1}'
|
-A PID (process id) will pop-up, use it in the next command :
|
PHP kaynak kodu
|
1
|
kill <PID>
|
-The fan alert sound should now stop.
-Now we can configure the NAS.
-Type the following (I'm gonna use full paths for clarity) :
|
PHP kaynak kodu
|
1
2
3
|
cd /DataFolder/.bittorrent/bin/
mv /DataFolder/.bittorrent/bin/btdog /DataFolder/.bittorrent/bin/btdog_bak
vi /DataFolder/.bittorrent/bin/btdog
|
-Edit the 'btdog' file :
|
PHP kaynak kodu
|
1
2
|
/DataFolder/.bittorrent/bin/fanmonitor_killer.sh &
/DataFolder/.bittorrent/bin/btdog_bak /DataFolder/.bittorrent/bin/bt -daemon-loop --default-settings-file /DataFolder/.bittorrent/bin/btsettings.txt
|
|
PHP kaynak kodu
|
1
|
vi /DataFolder/.bittorrent/bin/fanmonitor_killer.sh
|
-Edit the 'fanmonitor_killer.sh' file :
|
PHP kaynak kodu
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
FAN_MONITOR_PID=""
COUNTER=0
LOG_FILE_SIZE_THRESHOLD=512000
LOG_FILE='/DataFolder/.bittorrent/bin/fanmonitor_killer_log'
LOG_FILE_SIZE=$(ls -nl $LOG_FILE | awk '{print $5}')
# Check if the log file is larger then 500kB, if YES delete it (it will be recreated)
if [ $LOG_FILE_SIZE -ge $LOG_FILE_SIZE_THRESHOLD ]; then
rm -f $LOG_FILE
fi
# Log the START event
#stty -echo
echo '' >> $LOG_FILE
echo '~.~.~.~.~' >> $LOG_FILE
date >> $LOG_FILE
echo 'fanmonitor_killer.sh has STARTED' >> $LOG_FILE
ps -f | grep 'fan_monitor' | grep -v 'grep' | awk '{print $1}' >> $LOG_FILE
while [ "$FAN_MONITOR_PID" == "" ]
do
FAN_MONITOR_PID="$(ps -f | grep 'fan_monitor' | grep -v 'grep' | awk '{print $1}')"
if [ "$FAN_MONITOR_PID" != "" ]; then
# Log the process KILL event
date >> $LOG_FILE
echo "fan_monitor has been found and terminated [after $COUNTER seconds with PID=$FAN_MONITOR_PID]" >> $LOG_FILE
kill $FAN_MONITOR_PID
fi
COUNTER=`expr $COUNTER + 1`
sleep 1
done
# Log the STOP event
date >> $LOG_FILE
echo 'fanmonitor_killer.sh has FINISHED' >> $LOG_FILE
#stty echo
return 0;
|
Finish it :
|
PHP kaynak kodu
|
1
2
3
|
chmod 755 /DataFolder/.bittorrent/bin/btdog
chmod 755 /DataFolder/.bittorrent/bin/fanmonitor_killer.sh
exit
|
-perform a cold restart to test the new config (keep the release button pressed for more than 5-6 seconds / power off / power on).
-enjoy!
IMPORTANT : The fan protection is now disabled!!! In case the new fan fails the NAS could overheat in time.
And, remember, if you remove the drive that holds the modified scripts above (or unmount it), the monitoring process will start and the alert will trigger.
Basically the modified script will be run automatically at startup using the bit-torrent watchdog trick and will monitor the list of processes until a match is found ('fan_monitor'), this can also be used to launch custom processes (php, mysql, etc.) but this is not the goal of this article. When the script founds something that matches, it kills it based on it's PID and exits. All the details are logged in 'X:/.bittorrent/bin/fanmonitor_killer_log' (external link) OR '/DataFolder/.bittorrent/bin/fanmonitor_killer_log' (internal, TELNET link), where X: is the HDD that you selected in the BitTorrent HTTP-UI. When the log file grows beyond 512 kB it will be deleted and a new one will be created.
Everything above was tested on a Edimax NS-2502 upgraded to the Planex firmware. What you will do to you hardware/software will not be my responsibility.
Tell me what you think and if you can publish this guide to specialised WIKIs please do (I couldn't find the time lately).
Cheers,
Dorin.