X7SPA-HF based small (perfect) server build


Recommended Posts

Fixed for all drives in my code here.

I'm using the latest version of the code with my C2SEE MB but I'm having some problems.  I can control my fan speeds just fine manually.

 

echo 0 > /sys/class/hwmon/hwmon2/device/pwm2 --> fan does not stop but slows to its lowest speed (680rpm)

echo 255 > /sys/class/hwmon/hwmon2/device/pwm2 --> fan runs at max speed (1900 rpm)

 

I copied the latest version of the script and updated it based on my system. I've attached my version.  The problem is that I've having trouble just running the script manually. Here is what I get when I invoke the script...

root@Tower:/boot# sh unraid_fan_speed.sh
: command not found: line 2:
: command not found: line 7:
: command not found: line 9:
: command not found: line 13:
: command not found: line 21:
: command not found: line 27:
")syntax error: operand expected (error token is "

 

I'm not linux savy so I'm really struggling with how to figure this one out.  Hopefully someone can give it a look and give me some advice. In the meantime I'll be googling linux syntax trying to figure this out.

unraid_fan_speed.txt

Link to comment
  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Make sure when you save the file you're saving it as an ASCII file type.  Windows will default to ANSI.

 

Thanks for the response.

 

Sorry if this is a stupid question but how do I do that?

 

I'm editing the script in Windows Notepad.  When I go to save the file there is a drop down labeled Encoding.  Currently my script is marked ANSI.  The other options are Unicode, Unicode big endian, and UTF-8.  Are one of these other options equivalent to ASCII or should I be using a different editor?

Link to comment

Make sure when you save the file you're saving it as an ASCII file type.  Windows will default to ANSI.

 

Thanks for the response.

 

Sorry if this is a stupid question but how do I do that?

 

I'm editing the script in Windows Notepad.  When I go to save the file there is a drop down labeled Encoding.  Currently my script is marked ANSI.  The other options are Unicode, Unicode big endian, and UTF-8.  Are one of these other options equivalent to ASCII or should I be using a different editor?

you should be using a different editor.  It is not ascii, or utf-8, but the style of end-of-line characters used.

 

Windows uses a line-feed character followed by a carriage return character.

Unix uses only a line-feed character.

 

Notepad2 has been mentioned frequently.

 

See here:

http://lime-technology.com/wiki/index.php?title=FAQ#Why_do_my_scripts_have_problems_with_end-of-lines.3F

and here:

http://lime-technology.com/wiki/index.php?title=UnRAID_Topical_Index#Editors

Link to comment

Ok, I'm making some progress here.  I'm adding a little detail here to fill in the some of the blanks that were left out in a few of the previous posts that weren't so apparent to a noob like me.

 

The filename of my script is unraid_fan_speed.sh.

 

First I used the following command to get the text formatted correctly:

fromdos  <unraid_fan_speed.sh >tempfile
mv  tempfile  unraid_fan_speed.sh

 

Then I ran the script by simply typing unraid_fan_speed.sh at the prompt and got the following messages in my syslog:

Mar 16 17:31:59 Tower root: fan_speed: Highest disk drive temp is: 32°C
Mar 16 17:32:01 Tower root: fan_speed: Changing disk drive fan speed from: 24 (12%) to: 82 (42%)

 

I'm currently running a parity check so after I noticed that the max drive temperature increased to 33C I ran it again.  This time I got this message in my syslog:

Mar 16 17:52:01 Tower logger: fan_speed: Highest disk drive temp is: 33°C
Mar 16 17:52:01 Tower logger: fan_speed: Changing disk drive fan speed from: 82 (42%) to: 109 (55%)

 

So everything with the script appears to be working just fine. Next step was to add this to crontab so that the script will run automatically every 2 minutes.  To do this I used to following command:

crontab -e */2 * * * * /boot/scripts/unraid_fan_speed.sh 1>/dev/null 2>&1

 

After that I checked to see what cron jobs were active by using the crontab -l command and the entry I just added was shown at the bottom.  So it looks like the job was successfully loaded.  I then checked my syslog and I found the following entries which had appeared after I loaded the script into crontab:

Mar 16 20:04:02 Tower logger: fan_speed: Highest disk drive temp is: 34°C
Mar 16 20:04:02 Tower logger: fan_speed: Changing disk drive fan speed from: 109 (55%) to: 136 (69%)
Mar 16 20:16:02 Tower logger: fan_speed: Highest disk drive temp is: 33°C
Mar 16 20:16:02 Tower logger: fan_speed: Changing disk drive fan speed from: 136 (69%) to: 109 (55%)
Mar 16 20:20:02 Tower logger: fan_speed: Highest disk drive temp is: 32°C
Mar 16 20:20:02 Tower logger: fan_speed: Changing disk drive fan speed from: 109 (55%) to: 82 (42%)

 

These changes were done without me having to run the script manually.  Yes!!! Finally I think this is working.  Note: I removed a piece of tape that I had put over part of the front inlet of my case and that caused the temps to cool down pretty fast.

 

Now if I understand this correctly all I need to do is add the following entry in my go file and it should automatically whenever I reboot the server. Correct?  I guess I'll find out after my parity check is completed and I can reboot my server.

chmod +x /boot/unraid_fan_speed.sh
crontab -l >/tmp/crontab
grep -q "unraid_fan_speed.sh" /tmp/crontab 1>/dev/null 2>&1
if [ "$?" = "1" ]
then
    crontab -l | egrep -v "control unRAID fan speed based on temperature:|unraid_fan_speed.sh" >/tmp/crontab
    echo "#" >>/tmp/crontab
    echo "# control unRAID fan speed based on temperature" >>/tmp/crontab
    echo "*/2 * * * * /boot/unraid_fan_speed.sh 1>/dev/null 2>&1" >>/tmp/crontab
    cp /tmp/crontab /var/spool/cron/crontabs/root-
    crontab /tmp/crontab
fi

 

Thanks again to everyone for the helpful posts.

 

 

Update: I just rebooted my server and verified that my script was properly loaded into crontab.  Now if I can just find a fan that I can command to zero rpm.

 

Link to comment

I'm a little annoyed that I can't command the fan to zero RPM.  When my server is sitting idle and all the disks are spun down I'd like to turn the fan off.  I can't get the fan to spin any less than 700 rpm no matter what command I send.  Perhaps this is a limitation of the fan I am using?  Right now I'm using a COOLER MASTER R4-BMBS-20PK-R0 Blade Master 120mm Case Fan. I'm wondering if anyone else has a fan that they can command to zero rpm?

Link to comment

Ok, I'm making some progress here.  I'm adding a little detail here to fill in the some of the blanks that were left out in a few of the previous posts that weren't so apparent to a noob like me.

 

The filename of my script is unraid_fan_speed.sh.

...

Update: I just rebooted my server and verified that my script was properly loaded into crontab.  

Excellent.  You probably should add a link to which fan_speed script you used, since there are two in this thread.

 

Now if I can just find a fan that I can command to zero rpm.

I'm not sure what the problem is technically, but I can confirm that my fans will not run slower than a certain rpm.  

Running the "sensors" command after installing lm-sensors confirms that my fans have a minimum speed of 712 rpm.

fan4:       2445 RPM  (min =  712 RPM, div = 

 

I don't know why there is no "off" value, but I am going to try different values to see if I can find a "magic" number that will stop the fan completely.  You should probably try the same thing, since my value will probably differ from yours.  Different motherboards, different fans, etc.

Link to comment

I used the code from your post here and modified the user defined variables based on my system particulars.  You can download a text version of my script here.

 

Here is the sensors output for my fan...

Aux Fan:        697 RPM  (min =  712 RPM, div =   ALARM

 

Here is the output from the detailed correlation that pwmconfig generated...

It appears that fan hwmon2/device/fan3_input
    is controlled by pwm hwmon2/device/pwm2
Would you like to generate a detailed correlation (y)? y
    PWM 255 FAN 1917
    PWM 240 FAN 2109
    PWM 225 FAN 1917
    PWM 210 FAN 1917
    PWM 195 FAN 1917
    PWM 180 FAN 1757
    PWM 165 FAN 1506
    PWM 150 FAN 1506
    PWM 135 FAN 1318
    PWM 120 FAN 1240
    PWM 105 FAN 1110
    PWM 90 FAN 917
    PWM 75 FAN 811
    PWM 60 FAN 753
    PWM 45 FAN 753
    PWM 30 FAN 703
    PWM 28 FAN 680
    PWM 26 FAN 680
    PWM 24 FAN 680
    PWM 22 FAN 659
    PWM 20 FAN 680
    PWM 18 FAN 680
    PWM 16 FAN 680
    PWM 14 FAN 680
    PWM 12 FAN 680
    PWM 10 FAN 659
    PWM 8 FAN 680

Based on that output I have my fan settings in the script set at - Fan low speed = 28, Fan high speed = 195, Fan off = 0.

 

This post leads me to believe that the following command should stop the fan...

echo 0 > /sys/class/hwmon/hwmon2/device/pwm2

 

I have tried that and I still get ~700rpm.  So I'm wondering if the ability to stop is a characteristic of the fan itself?

Link to comment

I used the code from your post here and modified the user defined variables based on my system particulars.

 

I just updated that code with rpm readings in the output.

 

I have tried that and I still get ~700rpm.  So I'm wondering if the ability to stop is a characteristic of the fan itself?

After seeing the minimum speed value, I'm beginning to think it's a hardware limitation within the PWM control specification.

Link to comment

I just updated that code with rpm readings in the output.

Sweet. I'll update my script then.  Thanks!

 

After seeing the minimum speed value, I'm beginning to think it's a hardware limitation within the PWM control specification.

I'm pretty sure it's a design characteristic of the fan itself.  I've attached a copy of the 4-pin PWM specification from bubbaQ's post.  Take a look at Section 3.4.  Based upon what I've seen my fan is following the Type A Operation model.  Ideally I'd like to have a Type B, but Type C would work.  I'm not sure if the mfg actually specifies the Operation Below Minimum RPM model their product utilizes so I think you just have to try it and see.

REV1_2_Public.pdf

Link to comment
  • 1 month later...

I thought I had the same problem until I set the fans (120mm Delta) to run at full speed in the X8SIL-F BIOS. Before that they would only drop to around 700rpm. Having said that I only got the fans to completely stop once and I can't replicate it.

 

My problem is that the fans spin down but then spin back up straight away. I assume it is because I need to disable automatic fan control. So I stepped through the pwmconfig wizard and saved the config to /boot/scripts/AutoFanControlOff then ran the following command:

/usr/bin/sensors -c /boot/scripts/AutoFanControlOff

 

But when I run the command I get this error:

Error: Line 2: Invalid keyword

 

The config file looks like this:

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
FCTEMPS=
FCFANS=
MINTEMP=
MAXTEMP=
MINSTART=
MINSTOP=

 

Am I on completely the wrong track here? I feel like I am so close.

Link to comment

Well since my last post I've installed a 120mm Delta fan and it stops when commanded to zero.  I have a C2SEE MB so my BIOS settings might be a little different than yours. Here is what my manual says about the Fan Speed Control Modes...

 

This feature allows the user to decide how the system controls the speeds of the onboard fans. The CPU temperature and the fan speed are correlative. When the CPU on-die temperature increases, the fan speed will also increase, and vice versa. Select Workstation if your system is used as a Workstation. Select Server if your system is used as a Server. Select Disabled to disable the fan speed control function and allow the onboard fans to constantly run at the full speed (12V). The Options are: Disabled, 4-pin (Super Quiet), and 4-pin (Workstation).

 

I have found that in order for me to gain control of the fan I have to set this BIOS option to Disabled. I never had to turn off the AutoFanControl included in the kernel.  Now I never enabled it either when I ran pwmconfig either.  IIRC whenever I used the pwmconfig command it asked me if I wanted to enable AutoFanControl and I always said No.

 

Link to comment
  • 1 month later...

Woah! Go figure I just built my first ever unRaid server with this board TODAY! I was getting ready to post a writeup on it and saw this post.

 

Right now I'm pre-clearing 3 brand new 2TB WD WEARS hard drives. One is pre-clearing twice as fast as the other two; is this common?  Once these three are ready to go, I have another 2TB and two 1TB hard drives sitting in my gaming computer ready to be copied to the array and then cleared and added into the server case.

 

I went a slightly different route with my case selection. I bought a 4U server case that can hold 15 hard drives (this board can support 14 with an 8 port SuperMicro add in card) and I will have a backup drive ready to go in the case.

 

img1198sl.jpg

img1212s.jpg

img1218sk.jpg

img1204s.jpg

 

Hey Smitty, or anyone,

 

What brand of case is this please?

 

Cheers

Link to comment
  • 2 months later...

Interesting stuff  :D

 

I really got to learn how to do scripts. Where can you find info on command lines?

 

Anyways, I was thinking, for those of us who have different drives (Not all EARS) it would be a nice alternative to be able to shut the fans down when the corresponding drive is spun down. This way all you would need to check is the spin status of the drive.

 

:-\

Link to comment
  • 2 weeks later...

I'm running beta12 and have a Gigabyte K8N Ultra-SLI motherboard with 3x 3-pin fans attached. In the past I've been able to control the fan speeds on windows by using the program speedfan. Can the script provided here be used to control my fan speeds? I read about PWM but that's 4-pin fans. Or should I start a new topic?

 

I already did sensors-detect which in the end gave me below results. I don't know if I have to do the copy and service start what is displays. Do I? Newbie here :)

Driver `it87':
* ISA bus, address 0x290
    Chip `ITE IT8712F Super IO Sensors' (confidence: 9)

Driver `k8temp' (autoloaded):
* Chip `AMD K8 thermal sensors' (confidence: 9)

Do you want to generate /etc/sysconfig/lm_sensors? (yes/NO): yes
Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors
for initialization at boot time.
You should now start the lm_sensors service to load the required
kernel modules.

Unloading i2c-dev... OK

 

running sensors now returns:

k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp:  +37.0 C

it8712-isa-0290
Adapter: ISA adapter
in0:         +1.39 V  (min =  +0.00 V, max =  +4.08 V)
in1:         +2.61 V  (min =  +0.00 V, max =  +4.08 V)
in2:         +3.33 V  (min =  +0.00 V, max =  +4.08 V)
in3:         +2.46 V  (min =  +0.00 V, max =  +4.08 V)
in4:         +3.12 V  (min =  +0.00 V, max =  +4.08 V)
in5:         +2.35 V  (min =  +0.00 V, max =  +4.08 V)
in6:         +1.74 V  (min =  +0.00 V, max =  +4.08 V)
in7:         +2.21 V  (min =  +0.00 V, max =  +4.08 V)
Vbat:        +2.77 V
fan1:        912 RPM  (min =    0 RPM, div = 
fan2:       1222 RPM  (min =    0 RPM, div = 
fan3:       1562 RPM  (min =    0 RPM, div = 
temp1:       +25.0 C  (low  = +127.0 C, high = +127.0 C)  sensor = thermistor
temp2:       +31.0 C  (low  = +127.0 C, high = +127.0 C)  sensor = thermistor
temp3:       +69.0 C  (low  = +127.0 C, high = +127.0 C)  sensor = thermistor
cpu0_vid:   +1.400 V

Link to comment

For the folks who are actually using the HW defined: X7SPA-HF and Fractal Array case.  Are you running UnRaid 4.7 or one of the new 5 betas?  Will the scripts in this thread work the same on both releases?  I am planning building this exact system and am thinking about starting right off on the latest 5 beta.  Cheers!

Link to comment

snip

img1204s.jpg

 

Hey Smitty, or anyone,

 

What brand of case is this please?

 

Cheers

 

It's actually a ARK 4U-500.

http://www.newegg.com/Product/Product.aspx?Item=N82E16811182566

They have a larger version the -600 but it can't actually hold anything bigger unless you are worried about long video cards Despite the newegg specs, the 500 can hold 9 internal 3.5 HDDs. 7 as shown in the hard drive cage and then an additional 2 in a smaller cage that bolts onto a case brace above the Mobo area. Combine that with the 3 - 5.25" external bays (5 in 3 add on cage) and 1 - 3.5" external bay and you can hold 15 HDDs. This motherboard combined with the 8x supermicro add in card can hold a total of 14 hard drives.

Link to comment

For the folks who are actually using the HW defined: X7SPA-HF and Fractal Array case.  Are you running UnRaid 4.7 or one of the new 5 betas?  Will the scripts in this thread work the same on both releases?  I am planning building this exact system and am thinking about starting right off on the latest 5 beta.  Cheers!

 

Just asking this question one more time - is anyone running 5b12a on this platform?  If so, any issues?  I am building a brand new array and trying to decide if I start with 4.7 or jump straight to the 5b12a version.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.