mlogic / suspend-usb-device Goto Github PK
View Code? Open in Web Editor NEWAn easy-to-use script to properly put an USB device into suspend mode that can then be unplugged safely
License: GNU General Public License v3.0
An easy-to-use script to properly put an USB device into suspend mode that can then be unplugged safely
License: GNU General Public License v3.0
Solution?:
replace line:
echo 'suspend' > "$POWER_LEVEL_FILE"
by
echo "0" > "/sys/bus/usb/devices/$DEV_BUS_ID/power/autosuspend"
echo "auto" > "/sys/bus/usb/devices/$DEV_BUS_ID/power/level"
I'm using ubuntu 11.04 and found the the echo suspend line didn't work.
I searched and found; https://bbs.archlinux.org/viewtopic.php?id=95659 -
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.
solution - replace suspend with;
echo "0" > "/sys/bus/usb/devices/$port/power/autosuspend"
echo "auto" > "/sys/bus/usb/devices/$port/power/level"
Hi, thanks for a great script, it should do what I was looking for.. I just tested it with my USB disk, and I get this output - is that an error or is the disk powered off (the LED is still on so I think it's not):
$ sudo ./suspend-usb-device -v /dev/sdb
Found device /devices/pci0000:00/0000:00:1d.7/usb2/2-1 associated to /dev/sdb; USB bus id is 2-1
Syncing device /dev/sdb
synchronize cache(10): transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]
Stopping device /dev/sdb
start stop unit: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.