gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

USB drive disconnecting after inactivity

Fri Feb 21, 2014 10:05 am

Hi everyone,
I have a headless ALARM pi sharing my music library via NFS, after a few hours my library becomes unavailable on the network. The library is stored on a (powered) USB drive connected to the pi. If I log on the server, the directory where the drive is mounted is not accessible, with input/output error...
See the following output of lsusb and dmesg:

Code: Select all

[root@piserver medialibrary]# lsusb
Bus 001 Device 004: ID 13fd:1340 Initio Corporation Hi-Speed USB to SATA Bridge
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512/9514 USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

[    6.190629] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    6.418093] systemd-journald[70]: Received request to flush runtime journal from PID 1
[   18.090430] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   18.403991] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   18.466622] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   18.895548] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   19.840039] NFSD: starting 90-second grace period (net c0839040)
[   20.187732] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
then after a few hours:

Code: Select all

[ 5270.175709] hub 1-1:1.0: port 3 disabled by hub (EMI?), re-enabling...
[ 5270.185374] usb 1-1.3: USB disconnect, device number 4
[ 5270.536662] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[ 5270.638160] usb 1-1.3: New USB device found, idVendor=13fd, idProduct=1340
[ 5270.638198] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5270.638215] usb 1-1.3: Product: External
[ 5270.638229] usb 1-1.3: Manufacturer: Generic
[ 5270.638245] usb 1-1.3: SerialNumber: 57442D574341533831303838
[ 5270.656639] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[ 5270.663782] scsi1 : usb-storage 1-1.3:1.0
[ 5271.657721] scsi 1:0:0:0: Direct-Access     Generic  External         2.10 PQ: 0 ANSI: 4
[ 5271.661909] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[ 5271.663235] sd 1:0:0:0: [sdb] Write Protect is off
[ 5271.663278] sd 1:0:0:0: [sdb] Mode Sense: 21 00 00 00
[ 5271.664529] sd 1:0:0:0: [sdb] No Caching mode page found
[ 5271.681680] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[ 5271.705009] sd 1:0:0:0: [sdb] No Caching mode page found
[ 5271.719878] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[ 5278.237500]  sdb: sdb1
[ 5278.244885] sd 1:0:0:0: [sdb] No Caching mode page found
[ 5278.260551] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[ 5278.270914] sd 1:0:0:0: [sdb] Attached SCSI disk
[11054.334913] EXT4-fs error (device sda1): ext4_find_entry:1309: inode #23232513: comm nfsd: reading directory lblock 0
[11054.426675] EXT4-fs error (device sda1): ext4_find_entry:1309: inode #23232513: comm nfsd: reading directory lblock 0
[97620.966149] EXT4-fs (sda1): error count: 2
[97620.966188] EXT4-fs (sda1): initial error at 1392850801: ext4_find_entry:1309: inode 23232513
[97620.966213] EXT4-fs (sda1): last error at 1392850801: ext4_find_entry:1309: inode 23232513
[111918.384709] EXT4-fs error (device sda1): ext4_find_entry:1309: inode #23232513: comm nfsd: reading directory lblock 0
Thanks for any hint!

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: USB drive disconnecting after inactivity

Sun Feb 23, 2014 6:34 pm

I used to have those random disconnects, although it was different kinds of USB devices. It could be due to a bad cable or weak power supply to the Pi. Is the drive powered by something else?

Now that I have better powered hubs, that just does not happen to me.

Take a look above the part of dmesg that you posted, are any other USB devices plugged in and also getting disconnected? That would be an important clue.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: USB drive disconnecting after inactivity

Tue Feb 25, 2014 1:25 pm

Thanks for the advice, the USB drive is a 3.5" thus independently powered, and directly connected to the pi, no hub. No other USB device is connected, so I cannot really see if anything else is disappearing...
Note that the filesystem is ext3, I see "mounted using the ext4 subsystem" in the log. Converting the partition to ext4 might help?

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: USB drive disconnecting after inactivity

Wed Feb 26, 2014 9:07 am

I don't think it is the file system type, that message is okay. Maybe your Pi itself does not have an adequate power supply? Or the drive itself is requiring more power than it's own supply provides and for some reason drawing power from the Pi just long enough to cause a problem. Are there cables you can swap out to see if you have a bad cable? I think this sort of thing is usually a power or cable problem. Or inadequate memory/too slow of an SD card are other possibilities?
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “Arch”