# USB drive spin-down, smartmontools

## Massimo B.

I have seen USB 2.0 drives, that supports power modes, but I have lot like this Trekstor 04b4:6830 (Cypress chipset) that I can't spin-down:

```
Bus 001 Device 013: ID 04b4:6830 Cypress Semiconductor Corp. CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI
```

https://www.smartmontools.org/wiki/Supported_USB-Devices reports some of these IDs as supported, some as unsupported. However I'm able to read smart data:

```
 # smartctl -d usbcypress /dev/disk/by-id/usb-ST375064_0A_D-0:0 -a

smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.10.14-ck] (local build)

Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===

Model Family:     Seagate Barracuda 7200.10

Device Model:     ST3750640A

Serial Number:    3QD0PQBQ

Firmware Version: 3.AAD

...
```

But setting power modes fails:

```
# smartctl -d usbcypress /dev/disk/by-id/usb-ST375064_0A_D-0:0 -s standby,240 -s aam,254

smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.10.14-ck] (local build)

Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===

AAM enable failed: Non-SMART commands not implemented

ATA IDLE command failed: Non-SMART commands not implemented
```

hdparm failing as well:

```
# hdparm -y /dev/disk/by-id/usb-ST375064_0A_D-0:0

/dev/disk/by-id/usb-ST375064_0A_D-0:0:

 issuing standby command

SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
```

This is actually not about Linux support for the devices, but those USB cases don't support port modes. It is hard to find a case that supports it. I have one that works, but own a lot of USB cases that don't support spin-down. I usually take them for backup only and like to spin-down them in the meanwhile.

Is there any way to put the device into low-power mode without physically disconnecting the USB connection?

I tried

```
echo '1-1.4.1' |tee /sys/bus/usb/drivers/usb/unbind
```

which makes the device disappear but not spinning down.

I tried 

```
# echo off > /sys/bus/usb/devices/1-1.4.1/power/level 

-bash: echo: write error: Invalid argument
```

Any idea?

----------

## eccerr0r

Some of them, you get no SMART data through it.

Some of them will spin down but you can't control it.

Some of them, you just have to live with the fact it won't spin down... and not get SMART data either.

All depends on what the chip decided to implement and not to implement.

Genesys Logic is the worst one I've seen.  All of the ones I've seen have no SMART pass through.  One of them has powerdown but you can't control it as far as I know.

Initio - I've seen one with SMART but I don't remember if it passes powerdown properly.  I used it for a CDROM drive so not sure how it behaves with a hard drive.

These USB-IDE bridges are a PITA...

----------

## Massimo B.

So you mean from https://www.smartmontools.org/wiki/Supported_USB-Devices supported list I can't even know how many of the SMART commands and power mode commands are supported? I noticed that all the power mode commands don't seem to be even SMART commands, though they are implemented in smartctl.

Which chipset is the best in general? This is some Cypress chipset eventhough I remember that I had some other Cypress chipset that I was able to power-off by smartctl.

----------

## NeddySeagoon

Massimo B.,

USB bridges are very hit and miss about what they deal with beyond data reading and writing.

Older samples don't even support LBA48 addressing.

I have just bought a USB 3.1 USB/SATA bridge.  It won't pass the trim command to the SSD its connected to.

I know the drive supports it, since it used to be in a PC.

----------

