Grimoire-
Command
.es

GNU+Linux command memo

Simulate unplug / replug of USB devices

Simuler le débranchement / rebranchement d’un periphérique USB.

$ dmesg | grep usb
[…]
[84602.462281] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 (1)
[84602.462291] usb 1-1.3: Product: USB Flash Drive
[84602.462300] usb 1-1.3: Manufacturer: …
[…]
1 So the interesting USB device id is 1-1.3.

To logically unplug / disconnect it :

$ sudo sh -c 'echo 1-1.3 > /sys/bus/usb/drivers/usb/unbind'

To get the peripheral back / connect or plug it :

$ sudo sh -c 'echo 1-1.3 > /sys/bus/usb/drivers/usb/bind'

Source : debian-user-french@lists.debian.org 2019-11-16 à 13:32