LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-19-2018, 03:23 AM   #1
comcastuser
Member
 
Registered: May 2004
Posts: 189

Rep: Reputation: 22
Mobile USB 3.0 hard drive disconnecting for no reason


I'm using a fileserver with CentOS Linux release 7.5.1804 and I keep having a problem with my WD Passport 1TB drive disconnecting for no apparent reason. When it does this, I cannot in any way get it to mount again on that system until I do a reboot. This has only started to happen very recently, and no other computer seems to suffer this problem with this drive.

The problem persists even though I bought a powered USB 3.0 hub to connect the drive.

My fileserver uses a Gigabyte M68MT-S2P motherboard.

Please see this Pastebin for the error output when I try to re-mount the drive.
https://pastebin.com/XdDEu9Rg

What's wrong and how can I fix it?
 
Old 09-19-2018, 03:50 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Well, it says it's using ohci-hcd as a module. That's usb-1.0. xhci is the usb-3 module, isn't it?

I wopuld look up the status errors. If they're the same as error numbers, you can find them in /usr/include/asm-generic/errno-base.h
 
Old 09-19-2018, 04:06 AM   #3
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by business_kid View Post
Well, it says it's using ohci-hcd as a module. That's usb-1.0. xhci is the usb-3 module, isn't it?

I wopuld look up the status errors. If they're the same as error numbers, you can find them in /usr/include/asm-generic/errno-base.h
I think you're right. How would I get Linux to use xhci instead of ohci?
 
Old 09-19-2018, 04:25 AM   #4
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Better yet how would I be able to reset the bus?

Please see this output for information:
https://pastebin.com/c2TZ81Rp

I tried
Code:
# sudo echo -n "0000:00:02.0" | tee /sys/bus/pci/drivers/ohci-pci/bind
But I only got:

Code:
0000:00:02.0tee: /sys/bus/pci/drivers/ohci-pci/bind: No such device
I know I'm doing it wrong. Instructions for resetting the USB bus are quite confusing...
 
Old 09-19-2018, 04:56 AM   #5
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
Randomly disconnecting and using the "wrong" driver can both be caused by problems with the physical USB port. Have you switched port recently? Could the port itself be worn, or one of the internal connections loose?

I had a box once that was supposedly all USB 2.0, but some of the ports would only work if I disabled the relevant module so that it fell beck to ohci. I suspect they were detected as USB2 but didn't properly implement the standard.
 
Old 09-19-2018, 05:17 AM   #6
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by Pastychomper View Post
Randomly disconnecting and using the "wrong" driver can both be caused by problems with the physical USB port. Have you switched port recently? Could the port itself be worn, or one of the internal connections loose?

I had a box once that was supposedly all USB 2.0, but some of the ports would only work if I disabled the relevant module so that it fell beck to ohci. I suspect they were detected as USB2 but didn't properly implement the standard.
It happens on every port that I use with this device. Once it disconnects, no port (not even a newly attached external hubs) will let me mount the hard drive until I reboot. But only on one machine. I don't even see where my machine uses xhci or ehci, or how to enable it. I'm using kernel 3.10.0-862.11.6.el7.x86_64. I can't find a way to enable x/ehci or reset it...

Last edited by comcastuser; 09-19-2018 at 05:22 AM.
 
Old 09-19-2018, 06:08 AM   #7
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Actually, in further, desperate experiments I found that I cannot re-mount to the same mount point (directory) that I used before, even if I "umount /mountpoint -l", rm -rf /mountpoint and mkdir /mountpoint I cannot mount to that directory name ever again until reboot.

But if I create /mountpoint1 I can re-mount to that.

WTF is this wild new brand of crazy.
 
Old 09-19-2018, 02:00 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
check /etc/mtab or /proc/mounts to see if it's actually unmounted. cat is handiest.

mount --bind dir1 dir2 might find application

Anyhow, this looks like a distro problem, not a usb drive problem. Try it on a hard disk partition, and a usb key. Then giove them hell.

Last edited by business_kid; 09-19-2018 at 02:03 PM.
 
Old 09-22-2018, 05:16 AM   #9
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by business_kid View Post
check /etc/mtab or /proc/mounts to see if it's actually unmounted. cat is handiest.

mount --bind dir1 dir2 might find application

Anyhow, this looks like a distro problem, not a usb drive problem. Try it on a hard disk partition, and a usb key. Then giove them hell.
Nothing unusual showed up in mtab or mounts. No application was bound to the directories.
 
Old 09-23-2018, 11:59 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Is the disk there after you unmount it? Usually mounting/unmounting requires root. Anything mounted on bootup or in unusual places, ore with unusual options requires root privileges. If your usb drive is sdb1, try
Code:
cat /etc/mtab |grep sdb1
before and after mounts and unmounts.
 
Old 09-24-2018, 11:41 AM   #11
comcastuser
Member
 
Registered: May 2004
Posts: 189

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by business_kid View Post
Is the disk there after you unmount it? Usually mounting/unmounting requires root. Anything mounted on bootup or in unusual places, ore with unusual options requires root privileges. If your usb drive is sdb1, try
Code:
cat /etc/mtab |grep sdb1
before and after mounts and unmounts.
I did, still no entry found.

Edit: Wait, yes, it happened again and this time I found an entry. umount -l on that entry re-enabled use of the drive without rebooting.

I'll go with this temporary solution for a week and if it keeps working then mark it as solved. This bug has kept evolving over the last year...

Last edited by comcastuser; 09-24-2018 at 12:29 PM.
 
Old 09-24-2018, 12:47 PM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
From the unount man page:
Code:
Note that a file system cannot be unmounted when it is 'busy' - for example, when there are open files on it, or when some
process has its working directory there, or when a swap file on it is in use.  The offending process could even be  umount
itself - it opens libc, and libc in its turn may open for example locale files.  A lazy unmount avoids this problem.
It's usually good to run 'lsof |grep sdb1' or whatever the usb is if you're having suspicious stuff from umount. Alternatively 'lsof | grep mount/point (trim the initial forward slash to avoid regex type nonsense - always a possibility)
 
Old 09-24-2018, 01:31 PM   #13
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,483

Rep: Reputation: Disabled
Maybe try mounting it with its UUID(?).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
External USB drive keeps on disconnecting randomly djgruby Linux - Laptop and Netbook 22 12-02-2022 07:50 AM
Disconnecting USB External Drive Generates Worrying Message steveoelliott Linux - Server 4 12-15-2016 09:34 AM
USB drive keeps disconnecting and reconnecting, no idea why GuyGizmo Linux - Hardware 6 01-26-2014 02:10 PM
Hard drive spins up for no obvious reason hollywoodb Linux - Hardware 4 01-09-2007 07:42 AM
Problem disconnecting USB flash drive Mordechai Linux - Hardware 8 09-06-2005 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration