- 追加された行はこのように表示されます。
- 削除された行は
このように表示されます。
!! USB のリセットの仕方
*https://server-setting.info/blog/usb-reset-for-command.html
! unbind && bind する
[ unbind ]
# USB番号 1-2.1 を指定して unbind します。
$ echo -n "1-2.1" > /sys/bus/usb/drivers/usb/unbindreturn
$ echo -n "1-2.1" > /sys/bus/usb/drivers/usb/unbind
# USB 1-2.1 ポートが非表示になったことを確認します。
$ lsusb -treturn
...
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/3p, 480M
[ bind ]
# USB番号 1-2.1 を指定して bind します。
$ echo -n "1-2.1" > /sys/bus/usb/drivers/usb/bindreturn
$ echo -n "1-2.1" > /sys/bus/usb/drivers/usb/bind
! usb_modeswitch
# あるいは、USB のベンダー番号 1、プロダクト番号 9 を指定して リセット します。
$ usb_modeswitch -v 0x152d -p 0x2338 --reset-usbreturn
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 009 on bus 001
Current configuration number is 1
Use interface number 0
USB description data (for identification)
-------------------------
Manufacturer: JMicron
Product: USB to ATA/ATAPI bridge
Serial No.: 45342D6D2A72
-------------------------
Warning: no switching method given. See documentation
Reset USB device .
Device was reset
-> Run lsusb to note any changes. Bye!
# 同じUSBが 2つ以上挿してある場合、
# さらに、USB のバス番号 1、デバイス番号 9 を指定して リセット します。
$ usb_modeswitch -v 0x152d -p 0x2338 -b 1 -g 9 --reset-usbreturn
...
# USB 1-2.1 ポートが表示になったことを確認します。
$ lsusb -treturn
...
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/3p, 480M
|__ Port 1: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M