# [solved] How can I spin down USB attached drive?

## dbc

On my home file server, I use SATA drives in external USB cases as back-up media.  Currently, I have a kludgey set-up using an IP controlled AC relay box to power the external on/off for the nightly rsync.  Works well, if a bit Rube Goldberg.

Then the other day I was using a USB volume on my Macbook, and when I unmounted the drive, OS X spun it down and powered it off.  Golly, I didn't realize the USB interface could do that.  I could eliminate the silly relay box if I could do that on the file server. So I went digging around in man pages and thought I'd try using hdparm to see if I could accomplish the same thing in Linux.  The USB volume shows up as /dev/sdc, so I tried both

```

hdparm -Y /dev/sdc

```

and

```

hdparm -y /dev/sdc

```

But both give error messages like the low level command is getting rejected.

Any clues?Last edited by dbc on Tue Jul 14, 2009 11:28 pm; edited 1 time in total

----------

## eccerr0r

Most 'cheap' USB-IDE controllers do not support this functionality.

Likely if it doesn't spin down on its own, you can't spin down at all...does it spin down on its own ever?

I don't think I was able to get any of my 'cheap' Genesys logic USB-IDE controllers to spin down.  If it was implemented properly, most likely need to use SCSI commands to initiate power save mode...

----------

## dbc

I'll have to check with the same physical unit.  All of my cases are Vantec Nexstar 3 units, all SATA, similar to this:

http://www.centralcomputers.com/commerce/ccp28778--vantec-nst-360su-bk-nexstar3-3-5--sata-to-usb2-0-nst-360su-bk-drizvanns38r.htm

but my units are all of various vintage.  And I know the unit that spun down on the mac is a different physical unit than the one I was testing with on the Gentoo box.  They could wll have some internal differences.

----------

## eccerr0r

Oh..there's another issue here, some PCs can turn off power to the USB ports, some cannot...  Most cheap USB implementations cannot turn off power to the port (i.e., most generic PC hardware).  This is different than spinning down of course...

A lot of 'cheap' USB adapters use Genesys Logic chips... It may show up in lsusb as to what chip a particular device uses.  I have one Genesys logic controller that could spin down disks after inactivity but the usual methods of spinning down the disk didn't work.

I found a page http://www.nslu2-linux.org/wiki/FAQ/SpinDownUSBHarddisks for a NAS.  I suppose this data is relevant for regular PCs.

----------

## dbc

Outstanding link!  Pointed to exactly the information that I needed.

Since USB attached SATA drives show up as /dev/sda*, not /dev/hda*, it makes good sense that sdparm, not hdparm, is the tool of choice.  That cluestick raised a bruise.  Anyway:

```

sdparm --command=stop /dev/sdX

```

spins the drive down nicely.

----------

