LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Power off USB (https://www.linuxquestions.org/questions/debian-26/power-off-usb-509328/)

michaeljensen 12-11-2006 04:53 AM

Power off USB
 
Does anybody know how to power off the individual usb ports? Like on windows. I would like to power on / off usb mounted disks.

macemoneta 12-11-2006 11:19 PM

Well, I don't have anything that I can test with at the moment, but it looks to me that if you find your device with

lsusb -v | less

You should be able to power it off with:

echo "0" > /sys/bus/usb/devices/device/power/state

For example:

echo "0" > /sys/bus/usb/devices/6-0:1.0/power/state

Why don't you try it and let us know?

mjrclark 01-01-2007 02:43 AM

$:/sys/bus/usb/devices/6-1/power$ echo "0" > /sys/bus/usb/devices/6-0:1.0/power/state
bash: /sys/bus/usb/devices/6-0:1.0/power/state: Permission denied

Even with all combinations of sudo. It seems this attribute is read only, I have not seen this "permission denied" anywhere else.
Discussion continues in other thread, the one I started.
http://www.linuxquestions.org/questi....php?p=2565927
Edit-Clarification
I am not the original poster, and I was trying to use these commands to do something slightly different- power down usb ports, that have various peripherals attached. This turned out to be impossible to do.

galle 01-01-2007 02:49 PM

Couldn't you just use hdparm to power down the disks?

Hobart 07-01-2008 04:27 PM

Quote:

Originally Posted by mjrclark (Post 2565925)
$:/sys/bus/usb/devices/6-1/power$ echo "0" > /sys/bus/usb/devices/6-0:1.0/power/state
bash: /sys/bus/usb/devices/6-0:1.0/power/state: Permission denied

Even with all combinations of sudo. It seems this attribute is read only, I have not seen this "permission denied" anywhere else.
Discussion continues in other thread, the one I started.

Edit-Clarification
I am not the original poster, and I was trying to use these commands to do something slightly different- power down usb ports, that have various peripherals attached. This turned out to be impossible to do.

You may have to do "echo -n 0 > file" instead of "echo 0 > file".

Cheers,
-jon


All times are GMT -5. The time now is 12:07 AM.