marchello
Posts: 81
Joined: Fri Oct 11, 2013 8:59 am

usb external drive reconnect from console

Thu Oct 06, 2016 12:13 pm

Hi all,

My need is to reconnect my usb external drive from console.
For unknown reason it disappears from time to time (rarely) and restores after system reboot.
I'd like to know how do I restore it without need to reboot.
Please tell me what additional details should I provide.
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

epoch1970
Posts: 5479
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: usb external drive reconnect from console

Thu Oct 06, 2016 5:50 pm

"sudo udevadm trigger" perhaps?
That command asks udev to reapply all rules, perhaps it can grab the usb drive again.

I think it would be interesting to know if the mount disappears, or the block device disappears, or the usb port becomes incapacitated somehow.
You should see relevant information in /var/log/syslog when that happens.
Or look in /dev/ to see it the disk device is still there, and lsusb should tell if the usb device is seen (look for details in the /sys/bus/usb/ sysfs hierarchy)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
cisc0box
Posts: 8
Joined: Mon Oct 19, 2015 10:45 pm

Re: usb external drive reconnect from console

Thu Oct 06, 2016 9:28 pm

Is

Code: Select all

max_usb_power = 1
in /boot/config.txt?

marchello
Posts: 81
Joined: Fri Oct 11, 2013 8:59 am

Re: usb external drive reconnect from console

Fri Oct 07, 2016 10:13 am

cisc0box wrote:Is

Code: Select all

max_usb_power = 1
in /boot/config.txt?
Well, I don't have this row in my /boot/config.txt, but I use usb hub with external power, so it should not be my case. But I will check if that helps next time.

marchello
Posts: 81
Joined: Fri Oct 11, 2013 8:59 am

Re: usb external drive reconnect from console

Fri Oct 07, 2016 10:16 am

epoch1970 wrote:"sudo udevadm trigger" perhaps?
That command asks udev to reapply all rules, perhaps it can grab the usb drive again.

I think it would be interesting to know if the mount disappears, or the block device disappears, or the usb port becomes incapacitated somehow.
You should see relevant information in /var/log/syslog when that happens.
Or look in /dev/ to see it the disk device is still there, and lsusb should tell if the usb device is seen (look for details in the /sys/bus/usb/ sysfs hierarchy)
Ok, will use next time when it will happen. The problem is that it happens rarely, so it is hard to investigate, I can't reproduce this situation by myself.
Thanks for now.

Return to “General discussion”