Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

USB flash unplugged suddenly.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

USB flash unplugged suddenly.

#1 Post by hack3rcon »

Hello,
I have a USB flash that it has a problem and umounted suddenly and I should unplug and plug it from USB port for mount.
Can I do this plug and unplug by Linux and not physically?

Thank you.

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: USB flash unplugged suddenly.

#2 Post by CwF »

If I remember right you have some vm capability? You don't need them exactly, but if you pass the device temporarily to a vm and back it will force a refresh of the device. Or you happen to have it on a powered hub that can cycle the power. Or if you like danger, dig for the sysfs commands.

The sysfs approach works and if you fool around wrong bad things happen.
with your device id and the correct directory, something like, if the id is the argument? Could be wrong..
#echo pcid > /sys/bus/usb/devices/usb4/remove
To add it back in often just modprobe the correct driver module.
Maybe look at /sys/bus/usb/uevent and /sys/bus/usb/drivers_probe instead.

Enjoy!

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: USB flash unplugged suddenly.

#3 Post by hack3rcon »

CwF wrote:If I remember right you have some vm capability? You don't need them exactly, but if you pass the device temporarily to a vm and back it will force a refresh of the device. Or you happen to have it on a powered hub that can cycle the power. Or if you like danger, dig for the sysfs commands.

The sysfs approach works and if you fool around wrong bad things happen.
with your device id and the correct directory, something like, if the id is the argument? Could be wrong..
#echo pcid > /sys/bus/usb/devices/usb4/remove
To add it back in often just modprobe the correct driver module.
Maybe look at /sys/bus/usb/uevent and /sys/bus/usb/drivers_probe instead.

Enjoy!
When it unplugged then I can't mount it in VM too.

Post Reply