RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Fan control and hard drive temperature on Thecus N2100 with Debian Lenny

If you have installed a Debian lenny ( kernel 2.6.26-2-iop32x ) on your Thecus 2100 NAS device the fan is not automatically controlled by default and it is running on a full speed. The default value is 255 as specified in :

cat /sys/class/i2c-adapter/i2c-0/0-002e/pwm2

To change the default values use a echo command. For example to turn off the fan use:

echo 0 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm2

NOTE:

if the pwm2 file did not produce the desired outcome you may try pwm1 instead.

The main reason to put a fan on lower RPM is to get rid of the noise. However, make sure that you check your hard drives temperature before you leave the fan turned off completely:

# apt-get install hddtemp

Not check your hard drive temperature with something like:

# hddtemp /dev/sd?
/dev/sda: SAMSUNG HD501LJ: 50°C
/dev/sdb: SAMSUNG HD501LJ: 50°C

For me, at the moment the best solution is to switch off a fan if the hard drive's temperature is below working temperature. This is specified by the hard drive vendor. My SAMSUNG HD501LJ working temperature is from 0 - 60 C so I'm willing to take that risk to let it heat up to 57 C and then turn on the fan with some low value such as 40. If the hard drive temperature increases to the MAX level of 60 C then the fan will start to spin with a full power ( 255 ) and the system will beep 3 times to get me notified. Here is a very primitive bash script to do this job. The script is run by a cron every 5 minutes.

NOTE:

From some reason /sys/class/i2c-adapter/i2c-0/0-002e/pwm2 can regulate the fan and sometimes it is /sys/class/i2c-adapter/i2c-0/0-002e/pwm1 which need to be altered to change the fan speed. Because of this I'm resetting values of both files in the script below. First install beep and hddtemp if you have not done it previously:

# apt-get install beep hddtemp

Now create a script with a following code:

#!/bin/bash

TEMP=$(/usr/sbin/hddtemp /dev/sdb | cut -d: -f3 | sed 's/..$//' | sed 's/ //')

if [ $TEMP -ge 60 ]; then
        beep -l 1000 -r 3 
        echo 255 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm1
        echo 255 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm2

elif [ $TEMP -ge 57 ]; then
        echo 40 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm1
        echo 40 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm2

else 
        echo 0 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm1
        echo 0 > /sys/class/i2c-adapter/i2c-0/0-002e/pwm2
fi

Make the script executable open up a root's cron file:

# crontab -e

and place a following line there to run the above script every 5 minutes:

*/5 * * * * /path/to/your/script/fan-control-n2100.sh

Share this linux post:

Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Delicious Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Digg Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in FaceBook Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Google Bookmarks Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Stumbleupon Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Technorati Submit Fan control and hard drive temperature on Thecus N2100 with Debian Lenny in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download