X7SPA-HF based small (perfect) server build


Recommended Posts

I have the following code block in my /boot/config/go script

 

# enable fan speed control

cp /boot/config/sensors3.conf /etc/

/usr/bin/sensors -s

 

In the original post [#1] it just said run this script from crontab.  Here there seems to be some sensors config needed?  I ran "sensors" and the response I get is "no sensors found!"  I am running 5b12a.  Can someone point me in the right direction please?  Thanks, Dan

Link to comment
  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I should add that I am using the X7SPE-HF-D525 version of this board, not the X7SPA-HF.  I also have the latest BIOS loaded which seems to manage the fan itself - there does not seem to be a way of turning off BIOS control so I have it 100% at the moment. 

 

root@Tower:~# sensors

No sensors found!

Make sure you loaded all the kernel drivers you need.

Try sensors-detect to find out which these are.

root@Tower:~# sensors-detect

-bash: /usr/sbin/sensors-detect: /usr/bin/perl: bad interpreter: No such file or directory

root@Tower:~#

:-[

Link to comment

# enable fan speed control

cp /boot/config/sensors3.conf /etc/

/usr/bin/sensors -s

 

In the original post [#1] it just said run this script from crontab.  Here there seems to be some sensors config needed?  I ran "sensors" and the response I get is "no sensors found!"  I am running 5b12a.  Can someone point me in the right direction please?  Thanks, Dan

 

That's not something you have to have in the go script.  This is the relevant code in my go script:

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

Link to comment

Hi, I just build 3 disk unRaid array with the Supermicro x7spe-h-D525 board with 5beta12a and now im struggling to get the fan control up and running.

 

Mainboard: Supermicro x7spe-h-D525

Memory: Cosair 2x2GB DDR3 1333Mhz CMSO2GX3M1A1333C9

PSU: SeaSonic SS-400FL

Case: old CD-Rack with 2x SlipStream PWM 200-1300rpm

HDD: 3x3TB Hitachi Coolspin 32mb SATA 3

unRaid: 5b12a on 4gb Sandisk Blade

 

 

@dstroot: I had the same problem. First I installed the perl addon via unmenue, then run sensor-detect and added the found sensors via

modprobe coretemp
modprobe w83627ehf

into the go file. Sensor-detect also found some impi-sensors, but as i only have the H version without impi I ignored it. This enabled

root@Tower:~# sensors

and i could see, that fan2 and fan4 were running at about 700rpm. (BIOS fan setting is "Balanced"). I couldnt change the speed manually before adding this line to the go script.

echo 1 > /sys/class/hwmon/hwmon1/device/pwm2_enable

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

From this on I am stuck. I added the fan speed crontab script to the go file but in the syslog it shows

Oct  4 14:04:01 Tower crond[1092]: exit status 126 from user root /boot/scripts/fan_speed.sh 1>/dev/null 2>$stuff$1 
Oct  4 14:06:01 Tower crond[1092]: exit status 126 from user root /boot/scripts/fan_speed.sh 1>/dev/null 2>$stuff$1 
Oct  4 14:08:01 Tower crond[1092]: exit status 126 from user root /boot/scripts/fan_speed.sh 1>/dev/null 2>$stuff$1 
Oct  4 14:10:01 Tower crond[1092]: exit status 126 from user root /boot/scripts/fan_speed.sh 1>/dev/null 2>$stuff$1 

exit status 126 seems to be "not an executable", although its in the go script...

 

when i chmod +x fan_speed.sh and try to run it, i get

 

root@Tower:/boot/scripts# bash fan_speed.sh
: command not found2:
: command not found7:
: command not found9:
: command not found13:
: command not found21:
: command not found27:
")05ntax error: invalid arithmetic operator (error token is "
: command not found40:
: command not found47:
: command not found49:
: command not found62:
fan_speed.sh: line 94: syntax error near unexpected token `elif'
fan_speed.sh: line 94: `  elif [ "$CURRENT_FAN_SPEED" -ge "$FAN_HIGH_PWM" ]; the'
root@Tower:/boot/scripts# ]

anyone any ideas what I am doing wrong?

 

its my first time using linux...thx

Link to comment

anyone any ideas what I am doing wrong?

 

its my first time using linux...thx

If you edited the script in any windows editor you may have introduced errors in the line feeds.  Try this:

 

  • Open a telnet session to your server and use the command "mc" to browse through your directory structure.
  • Go to the location of your script and press "F4" to edit it. Press "F12" and choose "Linux Format (LF)".
  • File is saved now in the correct format.

Link to comment

Rognom:

 

First this section has to be accurate to what is installed on your system:

 

### VARIABLES FOR USER TO SET ###
# Amount of drives in the array. Make sure it matches the amount you filled out below.
NUM_OF_DRIVES=3

# unRAID drives that are in the array/backplane of the fan we need to control
HD[1]=/dev/sda
HD[2]=/dev/sdb
HD[3]=/dev/sdc
#HD[4]=/dev/sdd
#HD[5]=/dev/sde
#HD[6]=/dev/sdf

 

If it is not you will certainly get errors like what you are seeing.  You can see what the "sdx" values should be on your UnRaid "Main" page.

 

Second this also has to match your system:

 

# Fan device. Depends on your system. pwmconfig can help with finding this out. 
# pwm1 is usually the cpu fan. You can "cat /sys/class/hwmon/hwmon0/device/fan1_input"
# or fan2_input and so on to see the current rpm of the fan. If 0 then fan is off or 
# there is no fan connected or motherboard can't read rpm of fan.
ARRAY_FAN=/sys/class/hwmon/hwmon1/device/pwm4
ARRAY_FAN_INPUT=/sys/class/hwmon/hwmon1/device/fan4_input	 # Used to track actual rpm values

 

The way you find these values is "pwmconfig" as indicated in the code above.  Here is what mine looked like:

 

Testing pwm control hwmon1/device/pwm4 ...

hwmon1/device/fan4_input ... speed was 1442 now 706

It appears that fan hwmon1/device/fan4_input is controlled by pwm hwmon1/device/pwm4

 

So I adjusted the code above to match.  BOOM!  Works.  ;)

Link to comment

Nothing is ever as simple as it sounds.   ???

 

I built this machine based on Starcat's tout of the perfect server where everything "just works".  Then I asked specifically:

 

"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!"

 

It turns out nothing really works on 5b12a - it is a PITA to get the fan control to work and sleep is handled by a completely different command.  

 

So here are my tips - first the sleep script is easy.  You only need to change one line:

 

                               # Go to sleep
#                                        echo 3 > /proc/acpi/sleep
# Above deprecated on UnRaid 5 and above
# To go to sleep use this instead ->
		echo -n mem >/sys/power/state

 

Fan speed control is simply a non-starter unless you modprobe the correct drivers first.  Here is my code below:

 

#-----------------------------
#----- Enable Fan Speed ------
#-----------------------------
echo "Starting Fan Script"
# Adapter drivers
modprobe ipmi-si						# If you have IPMI
# Chip drivers
modprobe coretemp
modprobe w83627ehf
chmod +x /boot/scripts/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/scripts/unraid_fan_speed.sh 1>/dev/null 2>&1" >>/tmp/crontab
   cp /tmp/crontab /var/spool/cron/crontabs/root-
   crontab /tmp/crontab
fi

 

Make sure you edit the fan speed script to match your HW configuration - see my previous post.

 

Cheers!  ;D

Link to comment

Here is a brand new fan script specifically for this motherboard that just needs to be added to your go script - no need for the messy "add it to cron" stuff.  It runs like the cache_dirs and S3 sleep scripts.  Enjoy!  ;D

 

#!/bin/bash
#=======================================================================================
#  Name:	fan_speed.sh
#=======================================================================================
#  Description:	
#
#  A simple script to check for the highest hard disk temperature and then set the 
#  fan to an apropriate speed. Fan needs to be connected to a motherboard with pwm 
#  support.
#
#  How to invoke in your "go" script (copy to /boot/scripts):
#  chmod +x /boot/scripts/fan_speed.sh
#  /boot/fan_speed.sh
#=======================================================================================
# Version 1.0   Authored by Aiden
# Version 1.1	Modified by Dan Stroot to run in a loop. Does not require the user 
#               to add this to cron - just start it in your go file.
# 
#=======================================================================================
# Dependencies:	grep,awk,smartctl,hdparm
#=======================================================================================
version=1.1
program_name=`basename $0`
usage() {
echo "Usage: $program_name [-t min_temp] [-T max_temp] [-m loop in minutes]"
echo "       $program_name -V      = print program version "
echo "       $program_name -q      = quit the program if it is running"
echo
echo " Argument descriptions:"
echo " -t NN    =   set the low disk temp, below this temp the fan is off (default=32)"
echo " -T NN    =   set the high disk temp, above this temp the fan is 100% (default=38)"
echo " -m NN    =   number of minutes to wait between fan speed changes (default=5)"
}
#=======================================================================================
# USER DEFINED VARIABLES: *MUST* BE SET TO *YOUR* VALUES
#=======================================================================================
# You must load the correct divers for *your* motherboard.  You must run "sensors-detect" at 
# the command prompt and the add the sensors detected via "modprobe".  You may have to install 
# perl first - easiest way is via unmenu. Search the forums... 
# Load adapter drivers:
modprobe ipmi-si
# Load chip drivers:
modprobe coretemp
modprobe w83627ehf

# Fan device. Depends on *your* system. pwmconfig can help with finding this out. 
# pwm1 is usually the cpu fan. You can "cat /sys/class/hwmon/hwmon1/device/fan4_input"
# to see the current rpm of the fan. If 0 then fan is off or there is no fan connected 
# or motherboard can't read rpm of fan.
ARRAY_FAN=/sys/class/hwmon/hwmon1/device/pwm4				# Power (speed) setting
ARRAY_FAN_INPUT=/sys/class/hwmon/hwmon1/device/fan4_input	# Used to track actual rpm values
#=======================================================================================
# DEFAULT VARIABLES
#=======================================================================================
# Temperature boundaries
FAN_OFF_TEMP=32		 # Anything this number and below - fan is *off*
FAN_HIGH_TEMP=38	 # Anything this number and above - fan is *full*

# Fan speed settings. Run pwmconfig (part of the lm_sensors package) to determine 
# what numbers you want to use for your fan pwm settings. Should not need to
# change the OFF variable, only the LOW and maybe also HIGH to what you desire.
# Any real number between 0 and 255.
FAN_OFF_PWM=10		 # Off Value (note: many PWM fans will not turn off)
FAN_LOW_PWM=90		 # Value to make your fan go slow
FAN_HIGH_PWM=195	 # Value to make your fan go fast

MINUTES=5			 # The default number of minutes to loop
#=======================================================================================
# PROGRAM LOGIC - CHANGE AT YOUR PERIL 
#=======================================================================================
# Get User Input
while getopts "t:T:m:qhV" opt; do
  case $opt in
  t ) FAN_OFF_TEMP=$OPTARG ;;
  T ) FAN_HIGH_TEMP=$OPTARG ;;
  m ) MINUTES=$OPTARG ;;
  V ) echo $program_name version: $version
      exit 0 ;;
  h ) usage >&2 ; exit 0 ;;
  q ) quit_flag="yes" ;;
  \?) usage >&2 ; exit ;;
  esac
done

show_values() {
echo FAN_OFF_TEMP=$FAN_OFF_TEMP
echo FAN_HIGH_TEMP=$FAN_HIGH_TEMP
echo FAN_OFF_PWM=$FAN_OFF_PWM
echo FAN_LOW_PWM=$FAN_LOW_PWM
echo FAN_HIGH_PWM=$FAN_HIGH_PWM
echo MINUTES=$MINUTES
}
#show_values  # uncomment for debugging

# validate the fan off temp
cc="$(echo $FAN_OFF_TEMP | sed 's/[0-9]//g')"
if [ ! -z "$cc" ]
then
  echo "Error: min fan temp must be numeric (whole number, not negative)." >&2
  usage >&2
  exit 2
fi

# validate the fan high temp
cc="$(echo $FAN_HIGH_TEMP | sed 's/[0-9]//g')"
if [ ! -z "$cc" ]
then
  echo "Error: max fan temp must be numeric (whole number, not negative)." >&2
  usage >&2
  exit 2
fi

# validate the minutes
cc="$(echo $MINUTES | sed 's/[0-9]//g')"
if [ ! -z "$cc" ]
then
  echo "Error: minutes must be numeric (whole number, not negative)." >&2
  usage >&2
  exit 2
fi

# Lockfile processing
lockfile="/var/lock/fan_speed.LCK"
if [ -f "${lockfile}" ]; then

  # The file exists so read the PID
  # to see if it is still running
  lock_pid=`head -n 1 "${lockfile}"`

  pid_running=`ps -p "${lock_pid}" | grep ${lock_pid}`

  if [ -z "${pid_running}" ]; then
    if [ "$quit_flag" = "no" ]
    then
      # The process is not running
      # Echo current PID into lock file
      echo $$ > "${lockfile}"
    else
      echo "$program_name ${lock_pid} is not currently running "
      rm "${lockfile}"
      exit 0
    fi
  else
    if [ "$quit_flag" = "yes" ]
    then
      echo killing $program_name process "$lock_pid"
      echo killing $program_name process "$lock_pid" | logger -t$program_name 
      kill "$lock_pid"
      rm "${lockfile}"
      exit 0
    else
      echo "$program_name is already running [${lock_pid}]"
      exit 2
    fi
  fi
else
  if [ "$quit_flag" = "yes" ]
  then
    echo "$program_name not currently running "
    exit 0
  else
    echo $$ > "${lockfile}"
  fi
fi

# Enable speed change on fan
if [ `cat ${ARRAY_FAN}_enable` != "1" ]; then
echo 1 > "${ARRAY_FAN}_enable"
fi

# Calculate size of increments. This only needs to be done once so it is ouside of loop.
FAN_TEMP_INCREMENTS=$(($FAN_HIGH_TEMP-$FAN_OFF_TEMP))  
FAN_PWM_INCREMENTS=$(($(($FAN_HIGH_PWM-$FAN_LOW_PWM))/$FAN_TEMP_INCREMENTS))

# Obtain the ID of your flash drive (your flash drive is named "UnRaid" right?)
flash=/dev/`ls -l /dev/disk/by-label| grep UNRAID | cut -d/ -f3 | cut -c 1-3`

# Count the number of drives in your array (ignoring the flash drive we identified)
NUM_OF_DRIVES=$((ls /dev/[hs]d? | grep -v "$flash") | wc -l)

# Identify the drives in your array so we can test their temperature
COUNT=1
for d in $(ls /dev/[hs]d? | grep -v "$flash")
do
HD[$COUNT]=$d
#echo HDD=${HD[$COUNT]}								# Uncomment for debugging
COUNT=$[$COUNT+1]
done

function_get_highest_hd_temp() {
# while loop to get the highest temperature of active drives. 
# If all are spun down then high temp will be set to 0.	
CURRENT_TEMP=0
HIGHEST_TEMP=0
CURRENT_DRIVE=1
while [ $CURRENT_DRIVE -le $NUM_OF_DRIVES ]
do
	SLEEPING=`hdparm -C ${HD[$CURRENT_DRIVE]} | grep -c standby`
	if [ "$SLEEPING" -eq 0 ]; then
		CURRENT_TEMP=`smartctl -d ata -A ${HD[$CURRENT_DRIVE]} | grep -m 1 -i Temperature_Celsius | awk '{print $10}'`
		if [ "$HIGHEST_TEMP" -le "$CURRENT_TEMP" ]; then
			HIGHEST_TEMP=$CURRENT_TEMP
		fi
	fi
	CURRENT_DRIVE=$[$CURRENT_DRIVE+1]
done
}

function_get_current_fan_speed() {
# Function to get current fan values
CURRENT_FAN_SPEED=0
CURRENT_FAN_RPM=0
CURRENT_PERCENT_SPEED=0
CURRENT_FAN_SPEED=`cat $ARRAY_FAN`
CURRENT_FAN_RPM=`cat $ARRAY_FAN_INPUT`
CURRENT_PERCENT_SPEED=$(($(($CURRENT_FAN_SPEED*100))/$FAN_HIGH_PWM))
#echo Current Fan Speed = $CURRENT_FAN_SPEED    		# Uncomment for debugging
#echo Current Fan RPM = $CURRENT_FAN_RPM				# Uncomment for debugging
#echo Current Percent Speed = $CURRENT_PERCENT_SPEED	# Uncomment for debugging
if [ "$CURRENT_FAN_SPEED" -le "$FAN_OFF_PWM" ]; then
	CURRENT_OUTPUT="OFF (0% @ 0 rpm)"
	#echo Current output = $CURRENT_OUTPUT				# Uncomment for debugging
else
	if [ "$CURRENT_FAN_SPEED" -ge "$FAN_HIGH_PWM" ]; then
		CURRENT_OUTPUT="FULL (100% @ "$CURRENT_FAN_RPM" rpm)"
		#echo Current output = $CURRENT_OUTPUT			# Uncomment for debugging
	else
		CURRENT_OUTPUT="$CURRENT_FAN_SPEED ($CURRENT_PERCENT_SPEED% @ $CURRENT_FAN_RPM rpm)"
		#echo Current output = $CURRENT_OUTPUT			# Uncomment for debugging
	fi
fi
}

function_calc_new_fan_speed() {
# Calculate new fan values based on highest drive temperature
ADJUSTED_FAN_SPEED=0
ADJUSTED_PERCENT_SPEED=100
DIFF_FROM_FAN_OFF_TEMP=0
DIFF_FROM_FAN_OFF_TEMP=$(($HIGHEST_TEMP-$FAN_OFF_TEMP))
if [ "$HIGHEST_TEMP" -le "$FAN_OFF_TEMP" ]; then
	ADJUSTED_FAN_SPEED=$FAN_OFF_PWM
	ADJUSTED_PERCENT_SPEED=0
	ADJUSTED_OUTPUT="OFF"
else
	if [ "$HIGHEST_TEMP" -ge "$FAN_HIGH_TEMP" ]; then
		ADJUSTED_FAN_SPEED=$FAN_HIGH_PWM
		ADJUSTED_PERCENT_SPEED=100
		ADJUSTED_OUTPUT="FULL"
	else
		ADJUSTED_FAN_SPEED=$(($(($DIFF_FROM_FAN_OFF_TEMP*$FAN_PWM_INCREMENTS))+$FAN_LOW_PWM))
		ADJUSTED_PERCENT_SPEED=$(($(($ADJUSTED_FAN_SPEED*100))/$FAN_HIGH_PWM))
		ADJUSTED_OUTPUT=$ADJUSTED_FAN_SPEED	 
	fi
fi
#echo Adjusted output = $ADJUSTED_OUTPUT 			# Uncomment for debugging
}

function_change_fan_speed() {
# Implemenent fan speed change if neeeded
if [ "$CURRENT_FAN_SPEED" -ne "$ADJUSTED_FAN_SPEED" ]; then
	# set fan to new value
	echo $ADJUSTED_FAN_SPEED > $ARRAY_FAN
	sleep 5
	# Get new rpm value
	ADJUSTED_FAN_RPM=`cat $ARRAY_FAN_INPUT`
	ADJUSTED_OUTPUT=$ADJUSTED_OUTPUT" ("$ADJUSTED_PERCENT_SPEED"% @ "$ADJUSTED_FAN_RPM" rpm)"
	# Output the change
	echo "Highest disk drive temp is: "$HIGHEST_TEMP"C"
	logger "fan_speed: Highest disk drive temp is: "$HIGHEST_TEMP"C"
	echo Changing disk drive fan speed from: $CURRENT_OUTPUT to: $ADJUSTED_OUTPUT
	logger fan_speed: Changing disk drive fan speed from: $CURRENT_OUTPUT to: $ADJUSTED_OUTPUT
fi
}

# Main Loop
while [ -f "$lockfile" ]
do
# Get highest drive temperature
function_get_highest_hd_temp

# Get current fan speed
function_get_current_fan_speed

# Calculate new fan speed
function_calc_new_fan_speed

# Cange fan speed if necessary
function_change_fan_speed

#echo Sleeping for $MINUTES minutes  #uncomment for debugging
sleep $(($MINUTES*60))

done &

# while loop was put into background, now disown it so it will continue to run when you log off.
# to get it to stop, type: rm /var/lock/fan_speed.LCK
background_pid=$!
echo $background_pid > "${lockfile}"
echo "$program_name process ID $background_pid started, To terminate it, type: $program_name -q" >&2
echo "$program_name process ID $background_pid started, To terminate it, type: $program_name -q" | logger -t$program_name 
disown %%

Link to comment
  • 3 weeks later...

Here is a brand new fan script specifically for this motherboard that just needs to be added to your go script - no need for the messy "add it to cron" stuff.  It runs like the cache_dirs and S3 sleep scripts.  Enjoy!   ;D

 

Thanks for updating this, Dan.  I am clearly a novice at linux and bash scripting, so while I wanted to write it with proper functions and loops, I didn't have the experience to do so.  I might add that the script I wrote was in fact a modification of the script started by Starcat.  You might want to include him in your author list in the opening comments.

 

Also, I wanted to mention that my comment about this script working for v5 was based on beta-11, which was the last beta to use the 2.6.37.6 kernel.  beta-12a uses 3.0.4.  Now that may or may not have anything to do with your difficulties, but I don't want you to feel like I just "phoned in" my comment without checking.

Link to comment

Thanks Aiden - didn't mean to call you out on the 5 beta stuff.  I have an even newer version of the script I should post.  I also wrote a 5 beta plugin to learn about plugins hoping we get a "release candidate" of 5 soon but that's a whole different subject.

 

One thing I will say is thanks to the starter of this thread and all the contributors - I built a box using the case recommended here, an X7SPE-HF-525 board, and 4 Hitatchi 2Tb Coolspin drives and I couldn't be happier.  It's quiet, cool, performs great, looks cool and IPMI is really, really great.  Thanks for the thread!

Link to comment

I also wrote a 5 beta plugin to learn about plugins hoping we get a "release candidate" of 5 soon but that's a whole different subject.

 

This should be easy enough to configure using the plugin system and providing an easy GUI for the settings.  Perhaps even updates of the fan status. 

 

I have one additional challenge for you, though.  In my case, I have 4 drive cages, with their own PWM fans.  I want to configure the fan script so that it addresses each fan speed according to the drives available for THAT cage.  AHA!!!  Since invoking the script 4 times is not efficient, you would need to go back to the arrayed drive approach to configure one set of drives per fan control.  I was planning on visiting this in my original script, but yours is much more advanced, including the detection loop that bypasses the need to configure all the drives.  Being able to independently control the fans isn't critical, and the script works fine pushing all the fans to the same speed based on the hottest drive.  Think of this as more of a fine tuning.  :)

Link to comment
  • 4 weeks later...

Hi all, this is my first post here.

 

I have a X7SPA-HF-D525 that I'm trying to control the fan speed on. The problem I'm having is when I set the pwm to a rate that results in the fans spinning lower than about 700rpm it gets kicked out of manual control mode and the fans spin up to full speed. Has anyone else had this issue? I am convinced it is either the BIOS or the BMC firmware that is panicking when it sees the fan speed drop too low. Have I missed a setting tin my BIOS or something? I currently have the fans set to the Full Speed mode in the Hardware Health section.

 

Perhaps if you have the same mobo as me, and don't have this issue you could post your BIOS and/or BMC firmware version so I can compare with mine? Any help with this would be greatly appreciated. I'm out of ideas.

 

Tom

Link to comment

@TomAdam - Take a look at my post from earlier in this thread here. I have a different Supermicro MB (C2SEE) than you but I'd bet that the pwm control logic is probably the same. What I've found is that the fan is what determines if you can command it to zero speed. The first fan I used would not go below 700 rpm but now I'm using a Delta pwm fan and it can be commanded to zero speed.

Link to comment

I did see your earlier post and thought that may be the case, but my fans aren't being restricted by the controller in the fan itself. If I pick a fan speed below 700rpm (for example on one of my fans at a pwm setting of 140) then after about 2 seconds something resets the pwm to 255 and switches the pwm_enable setting to 4, which is an auto fan speed control mode. To retake control of the fan I have to set pwm_enable back to 1 and then alter the pwm setting again. I think this is a failsafe either built into the bios or the bmc. I only see the following solutions to this problem:

 

  • Beg supermicro to update the bios / bmc firmware to allow this feature to be disabled (yeah right)
  • Sever the RPM cable to the fans. I assume if there is no RPM signal that the system will allow full control
  • Accept that it is not possible to slow the fans below a certain point

 

I am going to send Supermicro a mail just in case there is something that they can suggest / do before I cut my cables.

Link to comment

Thought I had made a breakthrough. I found a package called FreeIPMI that can alter internal values of the IPMI data tables. I have found the fan thresholds that seem to be causing the problem, but disabling assertion of the threshold events doesn't work, and you cant change the thresholds as something magically resets the values.

 

If anyone is interested, here are the data tables for the CPU fan. Chassis fan is identical.

 

Section 138_CPU_FAN
        ## Possible values: Yes/No
        Enable_All_Event_Messages                                                   Yes
        ## Possible values: Yes/No
        Enable_Scanning_On_This_Sensor                                              Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Lower_Non_Critical_Going_Low                         Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Lower_Critical_Going_Low                             Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Lower_Non_Recoverable_Going_Low                      Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Upper_Non_Critical_Going_High                        Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Upper_Critical_Going_High                            Yes
        ## Possible values: Yes/No
        Enable_Assertion_Event_Upper_Non_Recoverable_Going_High                     Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Lower_Non_Critical_Going_Low                       Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Lower_Critical_Going_Low                           Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Lower_Non_Recoverable_Going_Low                    Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Upper_Non_Critical_Going_High                      Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Upper_Critical_Going_High                          Yes
        ## Possible values: Yes/No
        Enable_Deassertion_Event_Upper_Non_Recoverable_Going_High                   Yes
        ## Give valid input for sensor type = Fan; units = RPM
        Lower_Non_Critical_Threshold                                                770.000000
        ## Give valid input for sensor type = Fan; units = RPM
        Lower_Critical_Threshold                                                    585.000000
        ## Give valid input for sensor type = Fan; units = RPM
        Lower_Non_Recoverable_Threshold                                             400.000000
        ## Give valid input for sensor type = Fan; units = RPM
        Upper_Non_Critical_Threshold                                                29260.000000
        ## Give valid input for sensor type = Fan; units = RPM
        Upper_Critical_Threshold                                                    29815.000000
        ## Give valid input for sensor type = Fan; units = RPM
        Upper_Non_Recoverable_Threshold                                             30370.000000
        ## Give valid input for sensor type = Fan; units = RPM; 'None' to not use hysteresis
        Positive_Going_Threshold_Hysteresis                                         -2375.000000
        ## Give valid input for sensor type = Fan; units = RPM; 'None' to not use hysteresis
        Negative_Going_Threshold_Hysteresis                                         -2375.000000
EndSection

 

I have tried setting everything to No, and changing the thresholds, but no dice. Next I'm going to try altering the IPMI OS itself (you can login using ssh!).

Link to comment

The BMC OS was a dead end unfortunately. Even with the BMC disabled entirely the fans still exhibit the minimum RPM issue. I did however discover a very interesting vulnerability. See here for more info: http://lime-technology.com/forum/index.php?topic=16793.0

 

Looks like it is the BIOS that is overriding the fan speed control. Next I'm going to try removing the RPM feedback pin from the fan connectors to see if it helps.

Link to comment

By setting the lower boundary at the point where the fan won't decrease speed any further I get a nice smooth ramp up:

 

(note the reported 0 rpm is actually hard coded - the fan never goes below about 720rpm)

 

Nov 24 09:07:59 Tower fan_speed.sh: Highest disk drive temp is: 31C
Nov 24 09:07:59 Tower fan_speed.sh: Changing disk drive fan speed from: [OFF (0% @ 0 rpm) ] to: [64 (38% @ 746 rpm) ]
Nov 24 09:18:07 Tower fan_speed.sh: Highest disk drive temp is: 32C
Nov 24 09:18:07 Tower fan_speed.sh: Changing disk drive fan speed from: [64 (38% @ 733 rpm) ] to: [78 (47% @ 774 rpm) ]
Nov 24 09:28:15 Tower fan_speed.sh: Highest disk drive temp is: 33C
Nov 24 09:28:15 Tower fan_speed.sh: Changing disk drive fan speed from: [78 (47% @ 774 rpm) ] to: [92 (55% @ 819 rpm) ]
Nov 24 09:48:26 Tower fan_speed.sh: Highest disk drive temp is: 34C
Nov 24 09:48:26 Tower fan_speed.sh: Changing disk drive fan speed from: [92 (55% @ 815 rpm) ] to: [106 (64% @ 907 rpm) ]

Link to comment
  • 2 weeks later...

The solution to the minimum 712rpm problem was much simpler that I thought. If you look in your hwmon folder where you can control the pwm and read the fan rpm there are registers called fanX_min. For me both fan2_min and fan4_min were set to 712. Setting these to 0 allows you to change the fan speed to anything you want. My server is now truly silent.

 

It's worth noting that this needs to be set every time the machine starts up as it defaults back to 712.

 

Happy hacking.

Link to comment

Hi dstroot,

thanks for that nice script.

As I am not familiar with bash/scripting I have a question:

If I understand right, the script currently switches fans off, whenever all drives are spun down.

This is made to make it compatible with non WDgreen drives, that do not allow reading temps if spun down, right?

I only have WDgreen drives in my build - so I would like to continue temp reading and fan setting, can you tell me, what needs to be changed?

My goal is to cool down the drives before the script switches the fans off, when all disks go down.

Thanks a lot for your help,

Guzzi

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.