This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

M1015 in IT mode drives detected as SCSI drives no spindown

Hard disks, HDD, RAID Hardware, disk controllers, SATA, PATA, SCSI, IDE, On Board, USB, Firewire, CF (Compact Flash)
Forum rules
Set-Up GuideFAQsForum Rules
neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

M1015 in IT mode drives detected as SCSI drives no spindown

Post by neptunus »

I'm using two M1015 in IT mode with a lot of HDD's. One thing that still seems to be not working is that the drives are running through the M1015 they are detected as SCSI drives da0, da1, daX instead of ata drives, ata0, ata1, ataX. and it seems none of the controls for power reduction, spindown, idle, etc are working in nas4free.

Code: Select all

sideswipe:~# camcontrol devlist
<NECVMWar VMware IDE CDR10 1.00>   at scbus1 target 0 lun 0 (pass0,cd0)
<VMware Virtual disk 1.0>          at scbus2 target 0 lun 0 (pass1,da0)
<ATA Hitachi HUA72302 A840>        at scbus3 target 0 lun 0 (pass2,da1)
<ATA Hitachi HUA72302 A840>        at scbus3 target 1 lun 0 (pass3,da2)
<ATA Hitachi HUA72302 A840>        at scbus3 target 2 lun 0 (pass4,da3)
<ATA Hitachi HUA72302 A840>        at scbus3 target 3 lun 0 (pass5,da4)
<ATA Hitachi HUA72302 A840>        at scbus3 target 4 lun 0 (pass6,da5)
<ATA Hitachi HUA72302 A840>        at scbus4 target 0 lun 0 (pass7,da6)
<ATA Hitachi HUA72302 A840>        at scbus4 target 1 lun 0 (pass8,da7)
<ATA Hitachi HUA72302 A840>        at scbus4 target 2 lun 0 (pass9,da8)
<ATA Hitachi HUA72302 A840>        at scbus4 target 3 lun 0 (pass10,da9)
<ATA Hitachi HUA72302 A840>        at scbus4 target 4 lun 0 (pass11,da10)
<ATA INTEL SSDSA2CW12 0362>        at scbus4 target 5 lun 0 (pass12,da11)
<ATA INTEL SSDSA2CW12 0362>        at scbus4 target 6 lun 0 (pass13,da12)
etc.
All my HDD's are visible and working.

Code: Select all

sideswipe:~#  camcontrol identify /dev/da1
sideswipe:~#
Not working :?

Code: Select all

sideswipe:~# camcontrol inquiry da1
pass2: <ATA Hitachi HUA72302 A840> Fixed Direct Access SCSI-6 device
pass2: Serial Number YFHSMMZA
pass2: 600.000MB/s transfers, Command Queueing Enabled

Code: Select all

sideswipe:~# camcontrol standby da1
(pass2:mps0:0:0:0): STANDBY_IMMEDIATE. ACB: e0 00 00 00 00 40 00 00 00 00 00 00
(pass2:mps0:0:0:0): CAM status: Function Not Available
Not the output I was hoping for.

Code: Select all

sideswipe:~# dmesg|grep mps0
mps0: <LSI SAS2008> port 0x5000-0x50ff mem 0xd2500000-0xd2503fff,0xd2540000-0xd257ffff irq 19 at device 0.0 on pci11
mps0: Firmware: 16.00.00.00, Driver: 14.00.00.01-fbsd
mps0: IOCCapabilities: 1285c<ScsiTaskFull,DiagTrace,SnapBuf,EEDP,TransRetry,EventReplay,HostDisc>
da1 at mps0 bus 0 scbus3 target 0 lun 0
da2 at mps0 bus 0 scbus3 target 1 lun 0
da3 at mps0 bus 0 scbus3 target 2 lun 0
da4 at mps0 bus 0 scbus3 target 3 lun 0
da5 at mps0 bus 0 scbus3 target 4 lun 0
sideswipe:~# dmesg | grep mps1
mps1: <LSI SAS2008> port 0x6000-0x60ff mem 0xd2600000-0xd2603fff,0xd2640000-0xd267ffff irq 16 at device 0.0 on pci19
mps1: Firmware: 16.00.00.00, Driver: 14.00.00.01-fbsd
mps1: IOCCapabilities: 1285c<ScsiTaskFull,DiagTrace,SnapBuf,EEDP,TransRetry,EventReplay,HostDisc>
da11 at mps1 bus 0 scbus4 target 5 lun 0
da12 at mps1 bus 0 scbus4 target 6 lun 0
da7 at mps1 bus 0 scbus4 target 1 lun 0
da8 at mps1 bus 0 scbus4 target 2 lun 0
da10 at mps1 bus 0 scbus4 target 4 lun 0
da9 at mps1 bus 0 scbus4 target 3 lun 0
da6 at mps1 bus 0 scbus4 target 0 lun 0

Code: Select all

sideswipe:~# ataidle /dev/da1
Model:
Serial:
Firmware Rev:
ATA revision:           unknown/pre ATA-2
LBA 48:                 no
Geometry:               0 cyls, 0 heads, 0 spt
Capacity:               0MB
SMART Supported:        no
Write Cache Supported:  no
APM Supported:          no
AAM Supported:          no

Code: Select all

sideswipe:~# ataidle -S 5 /dev/da0
ataidle: the device does not support power management
My conclusion is that no power functions through the M1015 are working. Camcontrol and/or ataidle, are only for AHCI/SATA controllers.

I would like it if it is possible to get my HDD's in spindown by using the web interface. But it seems that this only works for AHCI/SATA controllers and not for SCSI controllers. There is a tool to spindown SCSI HDD's in BSD: http://www.noresult.net/freebsd/spindown/

Who to get my HDD's in spindown by using the web interface?

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

the freebsd lsi driver does not support the passthrough of the spindown commands from camcontrol.

there is a workaround with zfs however.
You got to run a script
http://forums.freenas.org/threads/unsur ... post-37106
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

b0ssman wrote:the freebsd lsi driver does not support the passthrough of the spindown commands from camcontrol.

there is a workaround with zfs however.
You got to run a script
http://forums.freenas.org/threads/unsur ... post-37106
Thanks, I will check the script. But still it would be very nice is there is a way to get is working from the webinterface in nas4free. I think a lot of people are using the M1015 in IT mode with nas4free.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

your best bet would be to get in touch with the freebsd developers and get them to make changes in the lsi driver to support camcontrol spindown
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

I am having exactly the same problem and was just about to start a thread. Drives plugged into the motherboard SATA controller do spin down, but not on the M1015 in IT. I hope I can get this working as I need drive spin down and am really excited about this SAS card.

craigr

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

b0ssman wrote:the freebsd lsi driver does not support the passthrough of the spindown commands from camcontrol.

there is a workaround with zfs however.
You got to run a script
http://forums.freenas.org/threads/unsur ... post-37106
I'm going to give this a try when I get back from my trip at the end of the week. It would be nice to have spin down working through the GUI though. We'll see, I am a total noob to FreeBSD so the learning curve is still very steep for me ;)

craigr

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

b0ssman wrote:the freebsd lsi driver does not support the passthrough of the spindown commands from camcontrol.

there is a workaround with zfs however.
You got to run a script
http://forums.freenas.org/threads/unsur ... post-37106
I have been researching this problem for three days straight and have put in tons of time. Is there instructions or information that a noob like me can use to lean how to install a script and have it restart again every time the NAS boots up. I know how to log on and navigate using SSH, and I know how to use vi, but I don't know where things are stored on FreeBSD or even where to start with adding a script.

Thanks in advance,
craigr

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

craigr wrote:
b0ssman wrote:the freebsd lsi driver does not support the passthrough of the spindown commands from camcontrol.

there is a workaround with zfs however.
You got to run a script
http://forums.freenas.org/threads/unsur ... post-37106
I'm going to give this a try when I get back from my trip at the end of the week. It would be nice to have spin down working through the GUI though. We'll see, I am a total noob to FreeBSD so the learning curve is still very steep for me ;)

craigr
See also viewtopic.php?f=70&t=4112

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

I had to try some of this before I left for my trip because I really want to solve this problem on my NAS. I think I am doing pretty well for a guy who doesn't know what he is doing.

I made a directory and file for my script:

/mnt/mount/hd_spindown.sh

I edited the hd_spindown.sh file with the script below.

Code: Select all

#!/bin/sh
#set -xv

#VERSION:  0.3.2
#MODIFIED: 17 Jun 2012
#AUTHOR:   Milhouse
#
#DESCRIPTION: Created on FreeNAS 8.0.1-BETA4 with LSI 9211-8i HBA
#             Tested on FreeNAS FreeNAS 8.0.2-RELEASE with LSI 9211-8i HBA
#
#  This script will attempt to stop disks in a ZFS pool connected
#  by a SAS HBA controller, using the camcontrol command. In effect,
#  this is a poor mans ATAIDLE.
#
#  The script is designed to run as a "daemon" process, running
#  constantly from bootup. The idea is that it will consume standard
#  input, which will itself be the output of "zpool iostat n" where n
#  is a time interval, usually 60 (seconds).
#
#  A count (--timeout) is specified as an argument for the script, and this
#  quantity is decremented each time there is no iostat activity, and reset
#  whenever there is iostat activity. When the count reaches zero, the disks
#  will be stopped using "camcontrol stop" (unless the --test option is
#  specified).
#
#  The amount of time elapsed before disks are stopped is calculated as
#  the product of the timeout and the value n specified for zpool iostat.
#  For example, a timeout of 15 and an interval of 60 gives 15 * 60, or
#  900 seconds (ie. 15 minutes). The default timeout is 30.
#
#  By default, disks will be stopped asynchronously (ie. simultaneously)
#  however if this is a problem, specify the --sync option to stop disks
#  in sequence, one after the other.
#
#  If a system has multiple pools, run individual commands for each pool.
#
#  If the script is unable to automatically detect disks/devices, specific
#  devices can be specified using the --devices argument.
#
#CHANGELOG:
#
#  0.1.0: 2011-08-01  - Initial version
#  0.2.0: 2011-09-05  - Tweak CAMCONTROL detection
#  0.2.1: 2011-10-08  - Rewrite device detection to read devices from SQLITE db
#  0.2.2: 2011-11-11  - Log when new disc activity detected after a stop (disable with --nologstart)
#                       Simplify logging.
#  0.2.3: 2011-11-12  - Minor fix for logging.
#  0.3.0: 2012-06-04  - Add support for multiple pools and pool specific devices
#  0.3.1: 2012-06-05  - Minor coding style corrections, remove trailing comma from default pools
#  0.3.2: 2012-06-17  - Fix regression decoding devices and expansion of args
#
#
#USAGE:
#  Execute the script with the -h or --help arguments.
#
#EXAMPLES:
#   zpool iostat tank 60 | sh sasidle --timeout 15
#   zpool iostat tank 60 | sh sasidle --timeout 15 --devices "/dev/da[2-3]"
#   zpool iostat tank 60 | sh sasidle --timeout 15 --devices "tank:/dev/da[1-2] music:/dev/da[3-4]" --pool tank,music
#   zpool iostat tank 60 | sh sasidle --timeout 15 --sync
#   zpool iostat tank 60 | sh sasidle --timeout 15 --test --verbose
#

POOL=`zpool list -H -o name | tr -s '\n' ',' | sed 's/,$//g'`
INTERVAL=60
TIMEOUT=30
DEVICES=
ASYNC=Y
LOGSTART=Y
DOSTOP=Y
DEBUG=
INFO=Y

_log() {
	[ ! -z $RC_PID ] && echo "$1" || echo "`date +'%Y/%m/%d %H:%M:%S'` $1"
}

_help() {
	echo "usage: ${0} [-p --pool <pool1,pool2>] [-i --interval #] [-t --timeout #] [-s -sync]
[-d --devices "pool1:/dev/da[0-2] pool2:/dev/da[3-6]"] [--nologstart] [-x --test]
[-q --quiet|-v --verbose] [-h --help]
-p --pool       name of pool(s) to monitor, comma separated list
-i --inteval    time interval between checks, in seconds
-t --timeout    number of intervals to elaps before stopping disks (default 30)
-s --sync       stop disks synchronously (default, async)
-d --devices    override device detection by specifying devices eg. "/dev/da[0-4]",
                or pool specific (pool1:dev1,dev2 pool2:dev3,dev4)
   --nologstart log message when disk activity detected after a prior stop
-x --test       do not stop disks (simulation)
-q --quiet      suppress all informational and debug messages
-v --verbose    output debug messages
-h --help       display this help"
}

# Total hack to avoid consuming arguments (needed for later expansion)
# getopts doesn't support long options in BSD, so this hack will have
# to do.
# In order to kick off the background task, we only need to know --pool
# and --interval so make sure they're first in any arguments, and we'll
# pass them in again to the background job where they can be consumed...
P=1
while [ $P -le $# ]; do
	[ $P -gt 9 ] && break;

	ARG1=`eval echo \$"$P"`
	let P=P+1 >/dev/null
	ARG2=`eval echo \$"$P"`
	let PN=P+1 >/dev/null

	case ${ARG1} in
		"-p" | "--pool")	POOL=${ARG2}; P=$PN;;
		"-i" | "--interval")	INTERVAL=${ARG2}; P=$PN;;
	esac
done

# Being called by rc - fork off a backgroun task
if [ ! -z $RC_PID ]; then
	if [ -z ${PROCMAIN} ]; then
		export PROCMAIN=YES;
		for p in `echo ${POOL} | sed "s/,/ /g"`; do
			zpool list $p >/dev/null
# Pool must exist - if not, ignore it (error message will appear in logs)
			if [ $? -eq 0 ]; then
				zpool iostat ${p} ${INTERVAL} | \
					/bin/sh $0 "$@" --pool ${p} --interval ${INTERVAL} | \
					logger -i -t sasidle &
			fi
		done
		exit 0
	fi
	echo $$ >>/var/run/sasidled.pid
fi

# To have got here, we're either being run manually from the command line, or
# called from rc, so lets validate all arguments - they're safe to consume now.
while [ $# -gt 0 ]; do
	case ${1} in
		"-p" | "--pool")	shift 1; POOL=${1};;
		"-i" | "--interval")	shift 1; INTERVAL=${1};;
		"-t" | "--timeout")	shift 1; TIMEOUT=${1};;
		"-s" | "--sync")	ASYNC=;;
		"-d" | "--devices")     shift 1; DEVICES=${1};;
		       "--nologstart")  LOGSTART=;;
		"-x" | "--test")	DOSTOP=;;
		"-q" | "--quiet")	DEBUG=; INFO=;;
		"-v" | "--verbose")	DEBUG=Y; INFO=Y;;

		"-h" | "--help")	_help; exit;;
		*)			echo "Unrecognised argument: $1"; _help; exit;;
	esac
	shift 1
done

[ "${INFO}" ] && _log "$0 starting"

if [ "${DEVICES}" ]; then
	TEMP_DEV=${DEVICES}
	DEVICES=

	for x in ${TEMP_DEV}; do
		if [ `echo $x | grep "^${POOL}:"` ]; then
			[ "${INFO}" ] && _log "Parsing devices for pool \"${POOL}\"..."
			DEVICES="`echo "$x" | cut -d: -f2- | sed 's/,/ /g'`"
			break
		fi
# Use these unamed devices if no pool is matched
		[ `echo $x | grep -v ":"` ] && DEVICES="${DEVICES} $x"
	done

# Clean up devices if necessary...
	[ "$DEVICES" ] && DEVICES=`eval echo '$DEVICES' | sed 's/,/ /g' | sed 's/"//g'`
fi

# Determine managed devices if not already known...
if [ ! "${DEVICES}" ]; then
	[ "${INFO}" ] && _log "Identifying devices for pool \"${POOL}\"..."

	OLD_RC_PID=$RC_PID
	. /etc/rc.freenas
	RC_PID=$OLD_RC_PID

	DEVICES=`${FREENAS_SQLITE_CMD} ${FREENAS_CONFIG} \
		"SELECT disk_name FROM storage_disk  \
		WHERE LOWER(disk_description) LIKE LOWER('% ${POOL} %') \
		ORDER BY disk_name ASC" | \
		while read disk_name; do
			echo $disk_name|sed "s/p.$//"
		done|tr -s "\n" " "`
fi

# Strip /dev/ prefix, eliminate any duplicates and stop disks in ascending sequence...
DEVICES=`echo ${DEVICES} | sed "s#/dev/##g" | tr -s " " "\n" | sort -u | tr -s "\n" " "`

# Show config info...
if [ "${INFO}" ]; then
	_log "---------------------------------------------------------"
	_log "Monitored Pool:    ${POOL}"
	_log "Monitored Devices: ${DEVICES}"
	_log "Polling Interval:  ${INTERVAL} seconds"
	_log "Idle Timeout:      ${TIMEOUT} * ${INTERVAL} seconds"
	_log "ASync Enabled:     $([ ${ASYNC} ] && echo "Yes" || echo "No")"
	_log "Simulated Stop:    $([ ${DOSTOP} ] && echo "No" || echo "Yes")"
	_log "Log Disk Start:    $([ ${LOGSTART} ] && echo "Yes" || echo "No")"
	_log "---------------------------------------------------------"
	_log ""
fi

# Skip 3 lines of "zpool iostat" headers...
for H in 1 2 3; do
	read HEADER
	[ "$DEBUG" ] && _log "$(printf "%.3d: %s\n" ${TIMEOUT} "${HEADER}")"
done

COUNT=${TIMEOUT}
STOPPED=

# Main infinite loop...
while [ true ]; do
	read POOL_NAME POOL_USED POOL_AVAIL POOL_OP_READ POOL_OP_WRITE POOL_BW_READ POOL_BW_WRITE

# If no activity, decrement count, else reset it
	if [ ${POOL_OP_READ-1} = 0 -a ${POOL_OP_WRITE-1} = 0 -a \
	     ${POOL_BW_READ-1} = 0 -a ${POOL_BW_WRITE-1} = 0 ]; then
		[ ! ${STOPPED} ] && let COUNT=COUNT-1 >/dev/null
	else
		if [ "${STOPPED}" -a "${LOGSTART}" ]; then
			[ "${INFO}" ] && _log "** Restarting devices in pool \"${POOL_NAME}\" due to activity **"
		fi

		COUNT=${TIMEOUT}
		STOPPED=
	fi

# Optional diagnostic output...
	[ "${DEBUG}" ] && _log "$(printf "%.3d: %-10s  %5s  %5s  %5s  %5s  %5s  %5s\n" \
		${COUNT} ${POOL_NAME} ${POOL_USED} ${POOL_AVAIL} \
		${POOL_OP_READ} ${POOL_OP_WRITE} ${POOL_BW_READ} ${POOL_BW_WRITE})"

# If count reaches zero, stop devices
	if [ ${COUNT} -le 0 -a ! "${STOPPED}" ]; then
		[ "${INFO}" ] && _log "** Stopping devices in pool \"${POOL_NAME}\" **"

		for DISK in ${DEVICES}; do
			if [ "${DOSTOP}" ]; then
				[ "${INFO}" ] && _log "camcontrol stop ${DISK}"
				[   "${ASYNC}" ] && camcontrol stop ${DISK} &
				[ ! "${ASYNC}" ] && camcontrol stop ${DISK}
			else
				[ "${INFO}" ] && _log "#camcontrol stop ${DISK}"
			fi
		done

		STOPPED=Y
	fi
done

exit 0
But when I run the script I get the following output:
nas4free:/mnt/mount# /mnt/mount/hs_spindown.sh
2013/06/11 17:02:05 /mnt/mount/hs_spindown.sh starting
/mnt/mount/hs_spindown.sh: 1: Syntax error: Unterminated quoted string
/mnt/mount/hs_spindown.sh: 161: Syntax error: Error in command substitution
Could someone please send me a little guidance. I don't know how to fix the errors on my machine in the author's script. I'm running Nas4Free 9.1.0.1.

Thanks again,
craigr
Last edited by raulfg3 on 11 Jun 2013 20:35, edited 2 times in total.
Reason: replace quote by code

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

there is an missing " in line 161

try this
if [ `echo $x | grep "^${POOL}:"` ]; then

also there is a version 0.3.3 of the script


EDIT: corrected now, 2013/06/11
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

I also came across: http://www.noresult.net/freebsd/spindown/

Works nice!
Install

Code: Select all

pkg_add -r spindown
OR

Code: Select all

cd /usr/ports/sysutils/spindown
make && make install
Edit
nano /etc/rc.conf

Code: Select all

#Enable Spindown
spindown_enable="YES"
spindown_flags="-b -d da0 -d da1 -d da2 -d da3 -d da4 -d da5 -d da6 -d da7 -t 300"
-b for background, -d per device, -t for timeout in seconds

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

i didnt know that existed. that would be great to incorporate into nas4free
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

b0ssman wrote:i didnt know that existed. that would be great to incorporate into nas4free
Yes it would: I'm dutch so I'm also following this forum/topic: http://gathering.tweakers.net/forum/lis ... es/1452380 spindown was mentioned there.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

The next problem is how to get "Disks|Management|S.M.A.R.T." Self-Monitoring, Analysis and Reporting Technology working.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

smart is working for me
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

b0ssman wrote:smart is working for me
What settings are you using in: "Disks|Management|S.M.A.R.T." Self-Monitoring, Analysis and Reporting Technology working.

What happens if you do: smartctl -a -n standby /dev/*DISK*
Something like

Code: Select all

Device is in STANDBY mode, exit (2)
OR

Code: Select all

smartctl 5.42 2011-10-20 r3458 [FreeBSD 8.2-RELEASE-p9 amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda Green (Adv. Format)
Device Model:     ST1500DL003-9VT16L
Serial Number:    5YD5N239
LU WWN Device Id: 5 000c50 0440536b3
Firmware Version: CC3C
User Capacity:    1,500,301,910,016 bytes [1.50 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Sun Sep 23 19:22:40 2012 AST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (  623) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 255) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x30b7) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   115   099   006    Pre-fail  Always       -       88859896
  3 Spin_Up_Time            0x0003   097   092   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       78
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   060   060   030    Pre-fail  Always       -       1079267
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       339
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       8
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   057   054   045    Old_age   Always       -       43 (Min/Max 35/44)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       6
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       78
194 Temperature_Celsius     0x0022   043   046   000    Old_age   Always       -       43 (0 24 0 0 0)
195 Hardware_ECC_Recovered  0x001a   019   006   000    Old_age   Always       -       88859896
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       4191888081235
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       1809810849
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       28389223

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Interrupted (host reset)      50%       311         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
The last output is not OKE.

From the man page of smartctl:

Code: Select all

-n POWERMODE, --nocheck=POWERMODE
    [ATA only] Specifies if smartctl should exit before performing any checks when the device is in a low-power mode. It may be used to prevent a disk from being spun-up by smartctl. The power mode is ignored by default. A nonzero exit status is returned if the device is in one of the specified low-power modes (see RETURN VALUES below).

    Note: If this option is used it may also be necessary to specify the device type with the '-d' option. Otherwise the device may spin up due to commands issued during device type autodetection.

    The valid arguments to this option are:

    never - check the device always, but print the power mode if '-i' is specified.

    sleep - check the device unless it is in SLEEP mode.

    standby - check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a disk from spinning up, this is probably what you want.

    idle - check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably not what you want. 

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

b0ssman wrote:there is an missing " in line 161

try this
if [ `echo $x | grep "^${POOL}:"` ]; then

also there is a version 0.3.3 of the script


EDIT: corrected now, 2013/06/11
Thanks for the help. I figured I needed a " someplace, but I had no idea where ;) Now the script runs, but it can't find a cf file for FreeNAS. Not surprised because I am not running FreeNAS, but I don't see it in the code anywhere... I'm trying the spindown daemon now instead as it seems a lot simpler that the script. We'll see how I do with that. I may come back to the script if things don't go well.

Kind regards,
craigr

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

neptunus wrote:I also came across: http://www.noresult.net/freebsd/spindown/

Works nice!
Install

Code: Select all

pkg_add -r spindown
OR

Code: Select all

cd /usr/ports/sysutils/spindown
make && make install
Edit
nano /etc/rc.conf

Code: Select all

#Enable Spindown
spindown_enable="YES"
spindown_flags="-b -d da0 -d da1 -d da2 -d da3 -d da4 -d da5 -d da6 -d da7 -t 300"
-b for background, -d per device, -t for timeout in seconds
So I don't know what's up because this isn't working for me :oops: This is what I have done.

Logged in as root in putty. Typed and got back:

Code: Select all

nas4free:~# pkg_add -r spindown
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/Latest/spindown.tbz... Done.
Then I edited my rc.conf file so that the last three lines are as below.

nano /etc/rc.conf

Code: Select all

#Enable Spindown
spindown_enable="YES"
spindown_flags="-b -d da0 -d da1 -d da2 -d da3 -d da4 -d da5 -t 300"
Saved and exited and then verified by going into the web gui file editor to double check the settings were there.

Then in putty I typed to run the rc.conf file:

Code: Select all

/etc/rc.conf
And got back to the prompt. My drives never spin down. Any idea why it's not working on my machine?

Also, if I tried:

Code: Select all

cd /usr/ports/sysutils/spindown
make && make install
I get back:

Code: Select all

nas4free:~# cd /usr/ports/sysutils/spindown
/usr/ports/sysutils/spindown: No such file or directory.
Thanks again to all from this noob :oops:

craigr

Onichan
Advanced User
Advanced User
Posts: 238
Joined: 04 Jul 2012 21:41
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by Onichan »

Nice find on that spindown utility I will have to look into that. I too have been using the M1015 for a while now and I currently just made a script and cron job to spin them down nightly at 0130. I would like the after idle, but this was better than nothing. If you want here is the script I use

Code: Select all

#!/bin/sh

DISKS=`camcontrol devlist | grep 'WD30' | grep -Eo 'da[0-9]+'`

for X in $DISKS
do
		camcontrol stop $X
done
I have multiple types of drives in my NAS so I first filter out all the WD30 which are the 3TB drives as those are the ones I want spundown. Anyways just save that as something.sh and modify the grep as needed and run it.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by b0ssman »

Code: Select all

nas4free:~# cd /usr/ports/sysutils/spindown
/usr/ports/sysutils/spindown: No such file or directory.
please try

Code: Select all

/usr/ports/sysutils/spindown
regarding smartctl deamon.

unfortunatly smartctl can not check the scsi stop command unlike the camcontrol spindown
Last edited by b0ssman on 12 Jun 2013 10:27, edited 1 time in total.
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

b0ssman wrote:

Code: Select all

nas4free:~# cd /usr/ports/sysutils/spindown
/usr/ports/sysutils/spindown: No such file or directory.
versuch mal nur

Code: Select all

/usr/ports/sysutils/spindown
und zum smartctl deamon. ja leider can smartctl den stop status bei scsi nicht auswerten. aber normale smart abfragen gehen.
English please.

Exit the shell en login again. Now at any location the command spindown will work.

Just for a test run: spindown -Db -i 10 -t 10-d da0 (where da0 is the SCSI disk)

After 20 seconds the status of the disk is running or in spindown is shown. Perhaps we can add a command option just to show the status of the disk(s).

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

Thanks guys. I will try it when I get home from my trip on Friday.

Kind regards,
craigr

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by raulfg3 »

latest rev775 have a new smartmontools 6.1, perhaps your board this time working, please test it:

viewtopic.php?f=78&t=4122

http://sourceforge.net/apps/trac/smartm ... ontrollers
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

raulfg3 wrote:latest rev775 have a new smartmontools 6.1, perhaps your board this time working, please test it:

viewtopic.php?f=78&t=4122

http://sourceforge.net/apps/trac/smartm ... ontrollers
smartctl -t short /dev/daX is working
smartctl -a /dev/daX is working

But with the version before 9.1.0.1 - Sandstorm (revision 775) it was also working. The problem is Disks|Management|S.M.A.R.T. >> Self-Monitoring, Analysis and Reporting Technology Probably the check:
Standby - Check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a laptop disk from spinning up each poll, this is probably what you want.
is not working.

I'm still searching for a alternative to fix this.

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

neptunus wrote:
b0ssman wrote:

Code: Select all

nas4free:~# cd /usr/ports/sysutils/spindown
/usr/ports/sysutils/spindown: No such file or directory.
versuch mal nur

Code: Select all

/usr/ports/sysutils/spindown
und zum smartctl deamon. ja leider can smartctl den stop status bei scsi nicht auswerten. aber normale smart abfragen gehen.
English please.

Exit the shell en login again. Now at any location the command spindown will work.

Just for a test run: spindown -Db -i 10 -t 10-d da0 (where da0 is the SCSI disk)

After 20 seconds the status of the disk is running or in spindown is shown. Perhaps we can add a command option just to show the status of the disk(s).
Thanks for this little extra help. Sometimes things are not so obvious to a noob like me.

I installed the spindown package again and then through ssh entered and got back:

Code: Select all

nas4free:~# spindown -i 60 -t 300 -d da0 -d da1 -d da2 -d da3 -d da4 -d da5
Stopping device da0
Unit stopped successfully
Stopping device da1
Unit stopped successfully
Stopping device da2
Unit stopped successfully
Stopping device da3
Unit stopped successfully
Stopping device da4
Unit stopped successfully
Stopping device da5
Unit stopped successfully
I also verified that they were spun down by physically inspecting the drives and they were certainly not spinning :)

Now all I have to do is learn how to install the spindown package so that it doesn't get deleted when I reboot and then figure out the little bit of script... should be doable.

Thanks again,
craigr

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

Got spindown running nicely with the aid of these two pages/posts:

viewtopic.php?f=72&t=210

http://barbz.com.au/blog/?p=665

This is great! Thanks for all the help.

craigr

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

craigr wrote: Now all I have to do is learn how to install the spindown package so that it doesn't get deleted when I reboot and then figure out the little bit of script... should be doable.
craigr
Edit nano /etc/rc.conf see posting.php?mode=quote&f=59&p=22253#pr22083

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

I actually just added a command script thorough the web gui:

System > Advanced > Command Scripts >

Code: Select all

spindown -b -i 60 -t 900 -d da0 -d da1 -d da2 -d da3 -d da4 -d da5
PostInit

craigr

neptunus
experienced User
experienced User
Posts: 79
Joined: 11 Jun 2013 08:50
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by neptunus »

If I use:

Code: Select all

spindown -b -i 60 -t 10800 -d da0 -d da1 -d da2 -d da3 -d da4 -d da5
then the disk are spindown too fast. Still have to check how fast.

Are there people how see the same?

This is true:
http://wiki.nas4free.org/doku.php?id=warnings

craigr
NewUser
NewUser
Posts: 12
Joined: 11 Jun 2013 16:00
Status: Offline

Re: M1015 in IT mode drives detected as SCSI drives no spind

Post by craigr »

neptunus wrote:If I use:

Code: Select all

spindown -b -i 60 -t 10800 -d da0 -d da1 -d da2 -d da3 -d da4 -d da5
then the disk are spindown too fast. Still have to check how fast.

Are there people how see the same?

This is true:
http://wiki.nas4free.org/doku.php?id=warnings
Three hours is a long time to wait for spindown. If you are noticing that the drives are spinning down too soon, maybe it's a bug. I would not be surprised if the spidown program only recognizes three or four digits for the timer. Try using 999 seconds or 9999 seconds instead of 10800 seconds. Your drives may be spinning down at the default time (which I think is 10 minutes, at 108 seconds, or at 1080 seconds.

I have always spun down my drives ever since I have been using zfs. I think the statement that:
also it wears out the hard drives faster while saving you some minor power usage
It's not a minor amount of power. If you have ten green drives this is 60+ watts of power when the drives are spinning (more with non-green and 7200rpm drives). This drops to 5 watts while the drives are idle. Reducing your full time load by 55 watts will add up to many dollars over a year and also wastes power for no reason. If you go hours without accessing your drives than spinning them down will make them last longer too, not shorter. You don't want your drives spinning up and down every hour, but you also don't want them to run for 12 hours for no reason at all.

I have 20 green drives in two pools and my power usage drops by 110 watts when the drives spin down.

I have never had to reboot my system after the drives have spun down. Never seen any errors from this.

craigr



craigr

Post Reply

Return to “Hard disk & controller”