If your machine runs old kernel, you could issue echo suspend > /sys/bus/usb/devices/X-X/power/level
to force suspension of device.
However, since 2.6.32 this is no longer possible:
We can categorize power management events in two broad classes:
external and internal. External events are those triggered by some
agent outside the USB stack: system suspend/resume (triggered by
userspace), manual dynamic resume (also triggered by userspace), and
remote wakeup (triggered by the device). Internal events are those
triggered within the USB stack: autosuspend and autoresume. Note that
all dynamic suspend events are internal; external agents are not
allowed to issue dynamic suspends.
power/control
This file contains one of two words: "on" or "auto".
You can write those words to the file to change the
device's setting.
"on" means that the device should be resumed and
autosuspend is not allowed. (Of course, system
suspends are still allowed.)
"auto" is the normal state in which the kernel is
allowed to autosuspend and autoresume the device.
(In kernels up to 2.6.32, you could also specify
"suspend", meaning that the device should remain
suspended and autoresume was not allowed. This
setting is no longer supported.
(from http://www.kernel.org/doc/Documentation/usb/power-management.txt)
I guess the best thing you can do is to unbind device from driver, so there would be no activity on it, and then configure the device to autosuspend as soon as possible (echo auto > /sys/bus/usb/devices/X-X/power/control && echo 0 > /sys/bus/usb/devices/X-X/power/autosuspend_delay_ms
).
However, as far as I understand USB specs, even if you suspend the device, some power on port will remain, so it might be impossible to disable led if it is powered by 'dumb' scheme (i.e. directly connected to +5V and GND pins).
For a flash drive, the one way to remove the disk is
echo 1 > /sys/block/sd<letter[s]>/device/delete
... (eject might be doing that...) It MIGHT result in the device being (soft) "powered off"... (If it works for disks, it won't work for non-disk devices..) – Gert van den Berg – 2018-06-22T14:45:17.117Yes. Simply unmount the device. – iglvzx – 2011-12-23T19:02:53.003
1No, that doesn't help. There is also the possibility that there are no usable partitions (which could be mounted) on the stick. – Daniel Jour – 2011-12-24T00:25:33.187