On Tue, 20 Jul 2010, David Gwynne wrote:
On 20/07/2010, at 2:48 AM, Jan Stary wrote:
I run a small server using an ALIX box and a CF card (wd0)
plus two external disks (sd0, sd1) - see the dmesg at bottom.
The CF card holds the system, while the two external disks are
big storages that are only used sparsely; one of them is a (NFS exported)
/backup dir that is only used for about an hour a night, for example.
I wonder whether there is something like atactl(8) that I could use
to control the power management of these disks - spin them down
when not used etc, to reduce noise and heat (I have yet to measure
if it would also mean a nontrivial power saving).
I understand that atactl only works with ATA drives, which my disks
dmesgly are not, being connected through sd(4) - although what's
inside the external USB boxes is actually a Seagate Momentus (SATA)
and a a Samsung Spinpoint (SATA).
there is a (very very) slight chance that the chip that translates from scsi
over usb to ata on the actual drive supports the ATA PASSTHRU scsi commands,
which the openbsd kernel will now try. this means you might be able to run
atactl against those disks.
Maybe I don't read it right what you wrote, but the chip is part of an
enclosure, not the actual drive.
The chances are better than it might seem. Some vendors support SAT ATA
PASSTHRU (like new chips from Oxford Semiconductor/PLX or Initio), some
other vendors support their own proprietary (and mostly undocumented) "ATA
PASSTHRU" (Cypress, JMicron, Sunplus) and the rest don't support anything
at all. Not all chips from each mentioned vendor work though.
you will need a -current system to try that with though.
If you don't want to use atactl(8) or can't use -current, talking directly
to drive with scsi(8) works well for this purpose, even with OS version
couple of years old. You need to prepare the ATA PASSTHROUGH command
yourself then.
With Oxford 934DSB, I use the following commands to put the drive to:
STOP:
/sbin/scsi -f /dev/rsd0c -c "1b 00 00 00 00 00"
STANDBY:
/sbin/scsi -f /dev/rsd0c -c "a1 06 00 00 00 00 00 00 a0 e0 00 00"
SLEEP:
/sbin/scsi -f /dev/rsd0c -c "a1 06 00 00 00 00 00 00 a0 e6 00 00"
IDLE:
/sbin/scsi -f /dev/rsd0c -c "a1 06 00 00 00 00 00 00 a0 e1 00 00"
FLUSH CACHE:
/sbin/scsi -f /dev/rsd0c -c "a1 06 00 00 00 00 00 00 a0 e7 00 00"
Wih JMicron, the following command should put the drive to Standby, but in
my case it fails with JM20336. JMicron tech people are reluctant to
provide any documentation about their proprietary "ATA PASSTHRU" command.
STANDBY:
/sbin/scsi -f /dev/rsd0c -c "df 00 00 00 00 00 00 00 00 00 a0 e0"
or
/sbin/scsi -f /dev/rsd0c -c "df 00 00 00 01 00 00 00 00 00 a0 e0"
For Cypress, tech specs is available.
considering how budget those usb to ata chips are, i wouldnt hold much hope.
I am very happy with Oxford 934DSB, works reliably for me (i.e. with
scsi(8) and SAT ATA PASSTHRU). It is quite frequent, even with (better
quality) consumer USB drives. Look for USB 2.0 + FireWire + eSATA.
Regards,
David