trev said:"atacontrol spindown" works with my SATA drives in AHCI mode (FreeBSD 7.2-STABLE amd64).
aragon said:Have you tried the idle and standby commands in camcontrol(8)?
Tzim said:camcontrol spindown ada0 does not works.
camcontrol idle ada0 does not works either.
camcontrol standby ada0 -t 10
# atacontrol spindown <disk> <time in seconds>
camcontrol cmd ada1 -a "EF 05 00 00 00 00 00 00 00 00 60 00"
camcontrol identify ada1
camcontrol cmd ada1 -a "EF 85 00 00 00 00 00 00 00 00 00 00"
camcontrol cmd ada1 -a "EF 05 00 00 00 00 00 00 00 00 60 00"
camcontrol: error sending command
camcontrol identify ada1
pass1: <ST31000528AS CC35> ATA-8 SATA 2.x device
pass1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
...
camcontrol cmd ada0 -a "EF 05 00 00 00 00 00 00 00 00 60 00"
camcontrol: error sending command
camcontrol identify ada0
pass0: <MAXTOR STM3750330AS MX15> ATA-8 SATA 2.x device
pass0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
...
camcontrol identify ada1
pass1: <ST31000528AS CC35> ATA-8 SATA 2.x device
pass1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
protocol ATA/ATAPI-8 SATA 2.x
device model ST31000528AS
firmware revision CC35
serial number 9VP0VXQK
WWN 5000c5001532e420
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 512, offset 0
LBA supported 268435455 sectors
LBA48 supported 1953525168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6
media RPM 7200
Feature Support Enable Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management no no 0/0x00
automatic acoustic management yes yes 254/0xFE 254/0xFE
media status notification no no
power-up in Standby yes no
write-read-verify yes no 0/0x0
unload no no
free-fall no no
data set management (TRIM) no
camcontrol standby ada1 -t 3600
(pass1:ahcich1:0:0:0): STANDBY. ACB: e2 00 00 00 00 40 00 00 00 00 f3 00
(pass1:ahcich1:0:0:0): CAM status: Command timeout
ahcich1: Timeout on slot 0
ahcich1: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd c0 serr 00000000
ahcich1: Timeout on slot 0
ahcich1: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd c0 serr 00000000
camcontrol identify ada1
pass1: <ST31000528AS CC35> ATA-8 SATA 2.x device
pass1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
protocol ATA/ATAPI-8 SATA 2.x
device model ST31000528AS
firmware revision CC35
% camcontrol cmd ada0 -a "EF 85 00 00 00 00 00 00 00 00 00 00"
camcontrol: error sending command
camcontrol identify ada0
pass0: <WDC WD10EARS-00Y5B1 80.00A80> ATA-8 SATA 2.x device
pass0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
protocol ATA/ATAPI-8 SATA 2.x
device model WDC WD10EARS-00Y5B1
firmware revision 80.00A80
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 512, offset 0
LBA supported 268435455 sectors
LBA48 supported 1953525168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6
Feature Support Enable Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management no no 0/0x00
automatic acoustic management yes no 254/0xFE 128/0x80
media status notification no no
power-up in Standby yes no
write-read-verify no no 0/0x0
unload no no
free-fall no no
data set management (TRIM) no
rft said:I'm unable to disable power management feature on the HDD.
Code:camcontrol identify ada0 pass0: <WDC WD10EARS-00Y5B1 80.00A80> ATA-8 SATA 2.x device
Please suggest how to disable power management.
Thanks
sub_mesa said:To disable APM:
camcontrol cmd ada1 -a "EF 85 00 00 00 00 00 00 00 00 00 00"
I'm not sure why the standby commands don't work anymore; hope they'll get introduced back to camcontrol before 8.1 releases.
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD5000BEVT-22A0RT0 01.01A01> ATA-8 SATA 2.x device
ada0: Serial Number WD-WX70AA9L4426
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
pass0: Command Queueing enabledGEOM: new disk ada0
# ataidle /dev/ada0
gives
could not get device information: is a device attached?
ataidle: an error occurred identifying the device /dev/ada0
bugboy said:I just found out that camcontrol(8) in FreeBSD 8.1-RELEASE now supports the following commands:
I haven't had the time to investigate if we can use these commands to spin down disks when the system is idle, but I will look into it soon. I someone else has more info, then please post the information in this thread.
- idle: Put ATA device into IDLE state. Optional parameter specifies automatic idle timer value in seconds.
- standby: Put ATA device into STANDBY state. Optional parameter specifies automatic standby timer value in seconds.
- sleep: Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset.
camcontrol standby ada0 -t 900
#!/bin/sh
case "$1" in
start)
/sbin/camcontrol idle ada0 -t 900
/sbin/camcontrol idle ada1 -t 900
/sbin/camcontrol idle ada2 -t 900
/sbin/camcontrol idle ada3 -t 900
/sbin/camcontrol idle ada4 -t 900
/sbin/camcontrol idle ada5 -t 900
/sbin/camcontrol standby ada0 -t 900
/sbin/camcontrol standby ada1 -t 900
/sbin/camcontrol standby ada2 -t 900
/sbin/camcontrol standby ada3 -t 900
/sbin/camcontrol standby ada4 -t 900
/sbin/camcontrol standby ada5 -t 900
echo "Set sata spindown to 900 seconds"
exit 0
;;
stop)
exit 0
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac